From b228d3a4e5367dda50496f7ec92395c225dd28a3 Mon Sep 17 00:00:00 2001 From: Ginger Wong Date: Sun, 28 Jun 2020 17:15:53 -0700 Subject: [PATCH] componentize user info --- webroot/index.html | 48 ++++++++++++++++++--------------------- webroot/js/app.js | 1 + webroot/js/footer.js | 28 +++++++++++++++++++++-- webroot/js/message.js | 3 +++ webroot/styles/layout.css | 25 ++++++++------------ 5 files changed, 62 insertions(+), 43 deletions(-) diff --git a/webroot/index.html b/webroot/index.html index ae1a82317..1e9e71266 100644 --- a/webroot/index.html +++ b/webroot/index.html @@ -84,45 +84,41 @@ GW TODO: -
+
{{ streamStatus }} {{ viewerCount }} {{ 'viewer' | plural(viewerCount) }}. Max {{ sessionMaxViewerCount }} {{ 'viewer' | plural(sessionMaxViewerCount) }}. {{ overallMaxViewerCount }} overall. -
+ -
-
- -
-
-
-

About {{streamerName}}

- -
- -
- -
-
+
+ {{streamerName}}
- +
-
- - -
-
- -
+
+ {{streamerName}} + + +
diff --git a/webroot/js/app.js b/webroot/js/app.js index 5898194ba..275901393 100644 --- a/webroot/js/app.js +++ b/webroot/js/app.js @@ -11,6 +11,7 @@ async function setupApp() { messages: [], extraUserContent: "", isOnline: false, + layout: "desktop", // from config logo: null, socialHandles: [], diff --git a/webroot/js/footer.js b/webroot/js/footer.js index f2b3de6a0..760ef62f3 100644 --- a/webroot/js/footer.js +++ b/webroot/js/footer.js @@ -2,7 +2,7 @@ Vue.component('owncast-footer', { props: { appVersion: { type: String, - default: "0.1", + default: '0.1', }, }, @@ -32,4 +32,28 @@ Vue.component('stream-tags', { `, -}); \ No newline at end of file +}); + +Vue.component('user-details', { + props: ['logo', 'platforms', 'summary', 'tags', 'extraContent'], + template: ` +
+
+ +
+
+

+ About + + +

+ +
+ +
+ +
+ +
+ `, +}); diff --git a/webroot/js/message.js b/webroot/js/message.js index b8f37f1f7..3b0768018 100644 --- a/webroot/js/message.js +++ b/webroot/js/message.js @@ -78,10 +78,13 @@ class Messaging { if (hasTouchScreen()) { this.scrollableMessagesContainer = document.body; this.tagAppContainer.classList.add("touch-screen"); + window.app.layout = "touch"; window.onorientationchange = this.handleOrientationChange.bind(this); this.handleOrientationChange(); } else { this.tagAppContainer.classList.add("desktop"); + window.app.layout = "desktop"; + } } diff --git a/webroot/styles/layout.css b/webroot/styles/layout.css index 7150c8a48..74fc01769 100644 --- a/webroot/styles/layout.css +++ b/webroot/styles/layout.css @@ -85,6 +85,7 @@ footer { justify-content: flex-start; font-size: .75em; padding: 2em; + opacity: .5; } footer span { display: inline-block; @@ -109,20 +110,18 @@ footer span { .user-content { padding: 2em; } -#user-content { +/* #user-content { display: block; } #user-content-touch { display: none; -} +} */ /* ************************************************8 */ .user-content { padding: 3em; -} -#user-content { display: flex; flex-direction: row; } @@ -215,9 +214,6 @@ h2 { list-style: unset; } -#footer-touch { - display: none; -} /* ************************************************8 */ @@ -471,15 +467,14 @@ h2 { } +.touch-screen .user-content { + flex-direction: column; + align-content: center; +} +.touch-screen .user-image { + margin: auto; +} -.touch-screen #footer, -.touch-screen #user-content { - display: none; -} -.touch-screen #footer-touch, -.touch-screen #user-content-touch { - display: block; -} .touch-screen #stream-info { height: 2.5em;