diff --git a/web/src/components/buttons/SettingsContextButton.svelte b/web/src/components/buttons/SettingsButton.svelte similarity index 100% rename from web/src/components/buttons/SettingsContextButton.svelte rename to web/src/components/buttons/SettingsButton.svelte diff --git a/web/src/components/buttons/SettingsCheckbox.svelte b/web/src/components/buttons/SettingsCheckbox.svelte new file mode 100644 index 00000000..81c8c00a --- /dev/null +++ b/web/src/components/buttons/SettingsCheckbox.svelte @@ -0,0 +1,31 @@ + + +
+ + updateSetting({ + [settingContext]: { + [settingId]: isChecked, + }, + })} + /> + +
diff --git a/web/src/components/save/Omnibox.svelte b/web/src/components/save/Omnibox.svelte index 5686764d..3a4e6d58 100644 --- a/web/src/components/save/Omnibox.svelte +++ b/web/src/components/save/Omnibox.svelte @@ -12,7 +12,7 @@ import IconMute from "$lib/icons/Mute.svelte"; import IconClipboard from "$lib/icons/Clipboard.svelte"; - import SettingsContextButton from "../buttons/SettingsContextButton.svelte"; + import SettingsButton from "../buttons/SettingsButton.svelte"; let link: string = ""; let isFocused = false; @@ -68,15 +68,15 @@
- + auto - - + + audio - - + + mute - + diff --git a/web/src/lib/settings/defaults.ts b/web/src/lib/settings/defaults.ts index ddaa83be..124e8751 100644 --- a/web/src/lib/settings/defaults.ts +++ b/web/src/lib/settings/defaults.ts @@ -31,5 +31,16 @@ const defaultSettings: CobaltSettings = { trafficAnalytics: true } } - export default defaultSettings; + +export const settingArrays = { + appearance: { + theme: ["auto", "light", "dark"] + }, + save: { + audioFormat: ["best", "mp3", "ogg", "wav", "opus"], + filenameStyle: ["classic", "basic", "pretty", "nerdy"], + videoQuality: ["max", "2160", "1440", "1080", "720", "480", "360", "240", "144"], + youtubeVideoCodec: ["h264", "av1", "vp9"], + }, +} diff --git a/web/src/routes/settings/+page.svelte b/web/src/routes/settings/+page.svelte index d6a792fb..5f94bc32 100644 --- a/web/src/routes/settings/+page.svelte +++ b/web/src/routes/settings/+page.svelte @@ -1,5 +1,41 @@ - - +
+
settings (placeholder)
+
+ {#each Object.entries(switchers) as [context, settingIdParent]} +
+
{context} context:
+
+
+ {#each Object.entries(settingIdParent) as [settingId, settingValue]} + {#if settingValue instanceof Array} +
{settingId}
+ + {#each settingValue as value} + + {value} + + {/each} + +
+ {/if} + + {#if typeof settingValue === "boolean"} + + {settingId} + +
+ {/if} + {/each} + {/each} +