From 67c492db47f72064f75e333fe2c01c6d5ad35b33 Mon Sep 17 00:00:00 2001 From: bytedream Date: Sun, 28 Jul 2024 23:04:04 +0200 Subject: [PATCH] Update popup UI --- .eslintrc.cjs | 3 +- src/entries/popup/Popup.svelte | 230 +++++++++++++------------------- src/entries/popup/index.html | 5 +- src/entries/popup/toggle.svelte | 65 +++++++++ src/lib/settings.ts | 9 +- 5 files changed, 169 insertions(+), 143 deletions(-) create mode 100644 src/entries/popup/toggle.svelte diff --git a/.eslintrc.cjs b/.eslintrc.cjs index 89fc307..c21af39 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -28,6 +28,7 @@ module.exports = { } ], rules: { - '@typescript-eslint/no-explicit-any': 'off' + '@typescript-eslint/no-explicit-any': 'off', + 'no-undef': 'off' } }; diff --git a/src/entries/popup/Popup.svelte b/src/entries/popup/Popup.svelte index 46972fb..28957ff 100644 --- a/src/entries/popup/Popup.svelte +++ b/src/entries/popup/Popup.svelte @@ -1,117 +1,93 @@ -
-
-

Hosters

-
- - -
- - {#each hosters as hoster} - - - - + } + }} + > + {/each} -
-

{hoster.name}

-
- - -
-
-
-
-

Other

- - - - - -
-

ff2mpv

-
- - + + + {#if !isMobile} +
+ Other +
+ +
+ Other.setFf2mpv(ff2mpvEnabled)} + > 🛈? -
-
-
- Something does not work + + + {/if} + Report issues or requests
@@ -125,7 +101,12 @@ padding: 0 8px; } - #bug-notice { + fieldset { + border-radius: 5px; + border-color: gray; + } + + #report-notice { border: none; color: white; display: block; @@ -148,52 +129,33 @@ text-align: center; } - .setting-table { - border-collapse: collapse; - border-spacing: 0; - } + .setting-container { + display: grid; + grid-template-columns: auto auto; + grid-column-gap: 5px; + grid-row-gap: 4px; + align-items: end; + width: 100%; - .setting-name { - height: 34px; - - p { + & > label { + height: 34px; margin: 0; - cursor: default; - } - } - - .buttons { - display: flex; - flex-direction: row; - height: 34px; - - button, - a { - border: 1px solid #281515; - background-color: transparent; - color: white; + user-select: none; cursor: pointer; - padding: 5px 8px; - margin: 0; - text-decoration: none; - - &.active { - background-color: rgba(255, 65, 65, 0.74); - cursor: default; - } - - &.disabled { - background-color: gray; - cursor: not-allowed; - } - } - - &.super-buttons { display: flex; - justify-content: center; - gap: 4px; - width: 100%; - margin-bottom: 10px; + align-items: center; } + + & > hr { + grid-column: 1 / span 2; + width: 100%; + } + } + + .info-questionmark { + display: inline-block; + transform: translateX(-40%) translateY(-100%); + color: black; + text-decoration: none; } diff --git a/src/entries/popup/index.html b/src/entries/popup/index.html index d8ffad5..e6fbe27 100644 --- a/src/entries/popup/index.html +++ b/src/entries/popup/index.html @@ -1,10 +1,11 @@ - + + Stream Bypass - + + + + + diff --git a/src/lib/settings.ts b/src/lib/settings.ts index 9d9ebae..985dabd 100644 --- a/src/lib/settings.ts +++ b/src/lib/settings.ts @@ -25,11 +25,8 @@ export const Hosters = { getAllDisabled: async () => { return await storageGet('hosters.allDisabled', false); }, - disableAll: async () => { - await storageSet('hosters.allDisabled', true); - }, - enableAll: async () => { - await storageSet('hosters.allDisabled', false); + setAll: async (enable: boolean) => { + await storageSet('hosters.allDisabled', !enable); } }; @@ -47,7 +44,7 @@ export const Redirect = { export const Other = { getFf2mpv: async () => { - return await storageGet('other.ff2mpv', true); + return await storageGet('other.ff2mpv', false); }, setFf2mpv: async (enable: boolean) => { await storageSet('other.ff2mpv', enable);