markup and styles for simple mobile only

This commit is contained in:
Ginger Wong 2020-06-15 23:32:26 -07:00
parent 903fdc33ae
commit 97c71771df
5 changed files with 211 additions and 123 deletions

View file

@ -40,123 +40,130 @@ possible hacks
</script>
<body class="bg-gray-300 text-gray-800">
<div id="app-container" class="flex no-chat">
<header class="flex border-b border-gray-900 border-solid shadow-md">
<h1 class="text-gray-400">
😈 Owncast
</h1>
<div id="user-options-container" class="flex">
<div id="user-info">
<div id="user-info-display" title="Click to update user name" class="flex">
<img src="https://robohash.org/username123" id="username-avatar" class="rounded-full bg-black bg-opacity-50 border border-solid border-gray-700" />
<span id="username-display" class="text-indigo-600"></span>
</div>
<div id="fixed-content">
<header class="flex border-b border-gray-900 border-solid shadow-md">
<h1 class="text-gray-400">
😈 Owncast
</h1>
<div id="user-info-change">
<input type="text"
id="username-change-input"
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-black-500 rounded py-1 px-1 leading-tight focus:bg-white"
value="Random Username 123"
maxlength="100"
placeholder="Update username"
>
<button id="button-update-username" class="bg-blue-500 hover:bg-blue-700 text-white py-1 px-1 rounded user-btn">Update</button>
<button id="button-cancel-change" class="bg-gray-900 hover:bg-gray-800 py-1 px-2 rounded user-btn text-white text-opacity-50" title="cancel">X</button>
</div>
</div>
<button type="button" id="chat-toggle" class="flex bg-gray-800 hover:bg-gray-700">💬</button>
</div>
<div id="user-options-container" class="flex">
<div id="user-info">
<div id="user-info-display" title="Click to update user name" class="flex">
<img src="https://robohash.org/username123" id="username-avatar" class="rounded-full bg-black bg-opacity-50 border border-solid border-gray-700" />
<span id="username-display" class="text-indigo-600"></span>
</div>
</header>
<div id="main-content-container" class="flex">
<!-- LEFT CONTAINER SIDE-->
<div class="flex main-cols left-col">
<div id="video-container" class="flex owncast-video-container bg-black">
<video
class="video-js"
id="video"
preload="auto"
controls
autoplay
playsinline
muted
poster="/thumbnail.png"
data-setup='{}'
>
<source src="hls/stream.m3u8" type="application/x-mpegURL"/>
</video>
</div>
<div id="stream-info" class="flex font-mono bg-gray-900 text-indigo-200 shadow-md border-b border-gray-100 border-solid">
<span>{{ streamStatus }}</span>
<span>{{ viewerCount }} {{ 'viewer' | plural(viewerCount) }}.</span>
<span>Max {{ sessionMaxViewerCount }} {{ 'viewer' | plural(sessionMaxViewerCount) }}.</span>
<span>{{ overallMaxViewerCount }} overall.</span>
</div>
<div id="user-content">
<!-- USER CONTENT... -->
<div>
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
</div>
<div>
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
</div>
</div>
</div>
<!-- RIGHT CONTAINER SIDE-->
<div class="flex main-cols right-col">
<div id="chat-container" class="bg-gray-800">
<div id="messages-container">
<div v-for="(message, index) in messages">
<div class="message flex">
<img
v-bind:src="message.image"
class="message-avatar rounded-full bg-black bg-opacity-50"
v-bind:style="{ backgroundColor: message.userColor() }"
/>
<div class="message-content">
<p class="message-author text-white font-bold">{{ message.author }}</p>
<p class="message-text text-gray-400 font-thin " v-html="message.formatText()"></p>
</div>
</div>
<div id="user-info-change">
<input type="text"
id="username-change-input"
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-black-500 rounded py-1 px-1 leading-tight focus:bg-white"
value="Random Username 123"
maxlength="100"
placeholder="Update username"
>
<button id="button-update-username" class="bg-blue-500 hover:bg-blue-700 text-white py-1 px-1 rounded user-btn">Update</button>
<button id="button-cancel-change" class="bg-gray-900 hover:bg-gray-800 py-1 px-2 rounded user-btn text-white text-opacity-50" title="cancel">X</button>
</div>
</div>
<div id="message-input-container" class="shadow-md bg-gray-900 border-t border-gray-700 border-solid">
<form id="message-form" class="flex" /*@submit="submitChatForm"*/>
<button type="button" id="chat-toggle" class="flex bg-gray-800 hover:bg-gray-700">💬</button>
</div>
<input type="hidden" name="inputAuthor" id="self-message-author" v-model="message.author" />
</header>
<textarea
id="message-body-form"
placeholder="Message"
v-model="message.body"
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-black-500 rounded py-2 px-2 my-2 focus:bg-white"
></textarea>
<div id="message-form-actions" class="flex">
<span id="message-form-warning" class="text-red-600 text-xs"></span>
<button
id="button-submit-message"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded"
> Send
</button>
</div>
</form>
<div id="video-container" class="flex owncast-video-container bg-black">
<video
class="video-js"
id="video"
preload="auto"
controls
autoplay
playsinline
muted
poster="/thumbnail.png"
data-setup='{}'
>
<source src="hls/stream.m3u8" type="application/x-mpegURL"/>
</video>
</div>
<div id="stream-info" class="flex font-mono bg-gray-900 text-indigo-200 shadow-md border-b border-gray-100 border-solid">
<span>{{ streamStatus }}</span>
<span>{{ viewerCount }} {{ 'viewer' | plural(viewerCount) }}.</span>
<span>Max {{ sessionMaxViewerCount }} {{ 'viewer' | plural(sessionMaxViewerCount) }}.</span>
<span>{{ overallMaxViewerCount }} overall.</span>
</div>
</div>
<div id="main-mobile-container" class="flex">
<div id="user-content">
<!-- USER CONTENT... -->
<div>
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
</div>
<div>
Blathers is an owl with brown feathers. His face is white and he has a yellow beak. His arms are wing shaped and he has yellow talons. His eyes are very big with small black irises. He also has big pink cheek circles on his cheeks. His belly appears to be checkered in diamonds with light brown and white squares, similar to an argyle vest, which is traditionally associated with academia. His green bowtie further alludes to his academic nature.
</div>
</div>
<div id="chat-container" class="bg-gray-800">
<div id="messages-container">
<div v-for="(message, index) in messages">
<div class="message flex">
<img
v-bind:src="message.image"
class="message-avatar rounded-full bg-black bg-opacity-50"
v-bind:style="{ backgroundColor: message.userColor() }"
/>
<div class="message-content">
<p class="message-author text-white font-bold">{{ message.author }}</p>
<p class="message-text text-gray-400 font-thin " v-html="message.formatText()"></p>
</div>
</div>
</div>
</div>
<div id="message-input-container" class="shadow-md bg-gray-900 border-t border-gray-700 border-solid">
<form id="message-form" class="flex">
<input type="hidden" name="inputAuthor" id="self-message-author" v-model="message.author" />
<textarea
id="message-body-form"
placeholder="Message"
v-model="message.body"
class="appearance-none block w-full bg-gray-200 text-gray-700 border border-black-500 rounded py-2 px-2 my-2 focus:bg-white"
></textarea>
<div id="message-form-actions" class="flex">
<span id="message-form-warning" class="text-red-600 text-xs"></span>
<button
id="button-submit-message"
class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-1 px-2 rounded"
> Send
</button>
</div>
</form>
</div>
</div>
</div>
</div>

View file

@ -27,7 +27,7 @@ function setupApp() {
// style hackings
window.VIDEOJS_NO_DYNAMIC_STYLE = true;
setVHvar();
// setVHvar();
// init messaging interactions

View file

@ -99,12 +99,16 @@ class Messaging {
this.imgUsernameAvatar.src = this.avatarSource + username;
}
displayChat() {
this.tagAppContainer.className = this.chatDisplayed ? "flex" : "flex no-chat";
if (this.chatDisplayed) {
this.tagAppContainer.classList.remove("no-chat");
} else {
this.tagAppContainer.classList.add("no-chat");
}
}
handleOrientationChange() {
console.log("====orientation change 123", event, window.screen.orientation, window.orientation, window.matchMedia("(orientation: landscape)"))
mobileVHhack();
// mobileVHhack();
// if small landscape, hide chat
// var mql = window.matchMedia("(orientation: landscape)"); // what it _was_

View file

@ -23,9 +23,9 @@ function clearLocalStorage(key) {
}
function jumpToBottom(id) {
const div = document.querySelector(id);
const div = id ? document.querySelector(id) : document.body;
div.scrollTo({
top: div.scrollHeight,// - div.clientHeight,
top: div.scrollHeight,
left: 0,
behavior: 'smooth'
});

View file

@ -2,7 +2,7 @@
:root {
--header-height: 3em;
--right-col-width: 24em;
--video-container-height: 50vh;
--header-bg-color: rgba(20,0,40,1);
--vh: 1vh;
}
@ -184,7 +184,7 @@ header h1 {
/* ************************************************8 */
#chat-container {
#xchat-container {
position: fixed;
z-index: 9;
right: 0;
@ -248,13 +248,13 @@ header h1 {
/* ************************************************8 */
/*
.no-chat .left-col {
width: 100vw;
}
.no-chat .right-col {
display: none;
}
} */
.no-chat #chat-toggle {
opacity: .75;
@ -273,7 +273,7 @@ header h1 {
--right-col-width: 20em;
}
#chat-container {
#xchat-container {
width: var(--right-col-width);
}
.left-col {
@ -283,7 +283,7 @@ header h1 {
/* ************************************************8 */
/*
@media screen and (max-width: 640px ) {
#main-content-container {
flex-direction: column;
@ -312,7 +312,7 @@ header h1 {
#user-content {
display: none;
}
#chat-container {
#xchat-container {
width: 100%;
height: 100%;
position: relative;
@ -331,15 +331,15 @@ header h1 {
.no-chat .right-col {
display: none;
}
.no-chat #stream-info {
.no-chat #xstream-info {
display: flex;
}
.no-chat #user-content {
display: block;
}
}
} */
/*
.message-input-focus #main-content-container {
flex-direction: column;
justify-content: space-between;
@ -377,4 +377,81 @@ header h1 {
height: 40vh;
height: calc((var(--vh, 1vh) * 40));
min-height: 300px;
}
} */
/* ************************************************8 */
/* ************************************************8 */
.touch-screen header {
position: relative;
}
.touch-screen #fixed-content {
position: fixed;
left: 0;
top: 0;
width: 100%;
}
.touch-screen #main-content-container {
display: none;
}
.touch-screen #stream-info {
height: 2.5em;
overflow: hidden;
}
#main-mobile-container {
flex-direction: column;
margin-top: calc(var(--header-height) + var(--video-container-height));
}
.touch-screen #video-container {
height: var(--video-container-height);
}
.touch-screen .owncast-video-container {
height: 100%;
}
.touch-screen #user-content {
display: none;
}
.touch-screen #chat-container {
display: block;
}
.touch-screen.no-chat #user-content {
display: block;
}
.touch-screen.no-chat #chat-container {
display: none;
}
@media screen and (max-width: 640px ) {
:root {
--video-container-height: 36vh;
}
}
@media screen and (orientation: landscape) and (min-width: 1024px) {
:root {
--video-container-height: 65vh;
}
}
@media screen and (orientation: landscape) and (max-width: 1024px) {
:root {
--video-container-height: 75vh;
}
#main-mobile-container {
margin-top: calc(var(--header-height) + var(--video-container-height));
}
.touch-screen #user-content {
display: block;
}
.touch-screen #chat-container {
display: none;
}
.touch-screen #chat-toggle {
display: none;
}
}