From 6e2aec604b44d9b8cb010e2012dfbad38d9ee7b0 Mon Sep 17 00:00:00 2001 From: Ed Asriyan Date: Fri, 30 Aug 2024 19:35:38 -0700 Subject: [PATCH] Update UI --- src/App.svelte | 61 +------ src/app.scss | 29 +++- .../{ => controls}/card-copy-url.svelte | 13 +- .../{ => controls}/card-video-selector.svelte | 24 +-- src/components/controls/index.svelte | 141 +++++++++++++++ .../{ => controls}/language-selector.svelte | 4 +- .../{ => controls}/users/index.svelte | 4 +- .../{ => controls}/users/user.svelte | 2 +- .../{ => controls}/video-selector-btn.svelte | 12 +- src/components/fullscreen.svelte | 39 +++++ src/components/header.svelte | 40 +++++ src/components/index.svelte | 24 +-- src/components/room.svelte | 164 ++---------------- src/components/video-player/index.svelte | 36 ++-- .../video-player/player-magnet.svelte | 2 +- .../video-player/video-player-vidstack.svelte | 13 +- src/i18n/_.ts | 1 + src/i18n/fr.ts | 1 + src/i18n/ru.ts | 1 + .../video-player => stores}/cursor.ts | 20 +-- src/stores/room/index.ts | 3 +- src/stores/video-example.ts | 1 + 22 files changed, 340 insertions(+), 295 deletions(-) rename src/components/{ => controls}/card-copy-url.svelte (83%) rename src/components/{ => controls}/card-video-selector.svelte (85%) create mode 100644 src/components/controls/index.svelte rename src/components/{ => controls}/language-selector.svelte (79%) rename src/components/{ => controls}/users/index.svelte (84%) rename src/components/{ => controls}/users/user.svelte (97%) rename src/components/{ => controls}/video-selector-btn.svelte (81%) create mode 100644 src/components/fullscreen.svelte create mode 100644 src/components/header.svelte rename src/{components/video-player => stores}/cursor.ts (60%) diff --git a/src/App.svelte b/src/App.svelte index 814fcfe..66445e0 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -3,14 +3,11 @@ import { _ } from 'svelte-i18n'; import { randomStr } from './utils'; import Analytics from './analytics.svelte'; - import LanguageSelector from './components/language-selector.svelte'; import Page from './components/index.svelte'; import { environment, isProduction } from './settings'; import './app.scss'; - let header; let roomId: string; - let isOnline: boolean; const testPrefix = 'test_'; const syncHashAndRoomId = function () { @@ -26,45 +23,20 @@ syncHashAndRoomId(); - + {#if !isProduction} - + Running in non-production environment: environment="{ environment }", isProd={ isProduction } {/if} -

- {#if isOnline} - 🎬 Watch Together - {:else} - { $_('noInternet')} - {/if} -

-
-
-
- {#if roomId} - - {/if} -
-
- -
- { $_('poweredBy') } - · Svelte - · Firebase - · Vidstack - · WebTorrent - · UIkit -
- -
+ {#if roomId} + + {/if}
diff --git a/src/app.scss b/src/app.scss index 37501f2..ee1411e 100644 --- a/src/app.scss +++ b/src/app.scss @@ -17,11 +17,34 @@ html { background-color: #000; } +.glass { + border: 1px solid rgba(255, 255, 255, .25); + background-color: rgba(255, 255, 255, 0.01); + box-shadow: 0 0 10px 1px rgba(0, 0, 0, 0.25); + backdrop-filter: blur(30px) brightness(70%); +} + .tile { - border: 1px solid rgb(255 255 255 / .1); - background-color: #1c1c1c; - border-radius: 1rem; + @extend .glass; padding: 2rem 1rem; + color: white; + border-radius: 1rem; +} + +@keyframes hue { + from { + filter: hue-rotate(0deg); + } + to { + filter: hue-rotate(-360deg); + } +} + +.gradient-text { + color: transparent !important; + background-image: linear-gradient(92deg, #f35626, #feac3a); + background-clip: text; + animation: hue 5s infinite linear; } .video-text { diff --git a/src/components/card-copy-url.svelte b/src/components/controls/card-copy-url.svelte similarity index 83% rename from src/components/card-copy-url.svelte rename to src/components/controls/card-copy-url.svelte index 6db0014..5b1fa06 100644 --- a/src/components/card-copy-url.svelte +++ b/src/components/controls/card-copy-url.svelte @@ -1,11 +1,12 @@ + +
+
+
+

🍿 { $_('selectVideo.title') }

+ +
+
+
+
+
+

👥 { $_('invite.title') }

+ +
+
+
+ +
+
+ +
+
+ +
+
+
+
+ + {#if data.name === 'link'} + { data.text } + {/if} + +
+ + + diff --git a/src/components/language-selector.svelte b/src/components/controls/language-selector.svelte similarity index 79% rename from src/components/language-selector.svelte rename to src/components/controls/language-selector.svelte index 5bd606b..3e97767 100644 --- a/src/components/language-selector.svelte +++ b/src/components/controls/language-selector.svelte @@ -1,7 +1,7 @@ + +{#if visible} + +{/if} + + \ No newline at end of file diff --git a/src/components/header.svelte b/src/components/header.svelte new file mode 100644 index 0000000..e316e36 --- /dev/null +++ b/src/components/header.svelte @@ -0,0 +1,40 @@ + + + + +{#if display || !isOnline} +

+ {#if isOnline} + 🎬 Watch Together + {:else} + { $_('noInternet')} + {/if} +

+{/if} + + \ No newline at end of file diff --git a/src/components/index.svelte b/src/components/index.svelte index d3abf21..569914b 100644 --- a/src/components/index.svelte +++ b/src/components/index.svelte @@ -1,12 +1,10 @@
{#await init(roomId)} - + {:then room} - + {:catch e}

{ $_('error.description') } 💩

diff --git a/src/components/room.svelte b/src/components/room.svelte index 368fc37..bcec87b 100644 --- a/src/components/room.svelte +++ b/src/components/room.svelte @@ -1,177 +1,47 @@ -
+ + +
+
-
-
-
-
-
-

🍿 { $_('selectVideo.title') }

- -
-
-
-
-
-
-

👥 { $_('invite.title') }

- -
-
-
- -
-
- -
-
- -
-
-
-
- - {#if data.name === 'link'} - { data.text } - {/if} - -
+
+
+ diff --git a/src/components/video-player/index.svelte b/src/components/video-player/index.svelte index dec39f7..2ca7b0d 100644 --- a/src/components/video-player/index.svelte +++ b/src/components/video-player/index.svelte @@ -1,6 +1,5 @@