Add setting for font size

This commit is contained in:
Jon Staab
2025-05-13 14:31:34 -07:00
parent 60ec6924f3
commit 823058e335
5 changed files with 48 additions and 8 deletions
+13 -1
View File
@@ -51,7 +51,13 @@
import {setupTracking} from "@app/tracking"
import {setupAnalytics} from "@app/analytics"
import {nsecDecode} from "@lib/util"
import {INDEXER_RELAYS, userMembership, ensureUnwrapped, canDecrypt} from "@app/state"
import {
INDEXER_RELAYS,
userMembership,
userSettingValues,
ensureUnwrapped,
canDecrypt,
} from "@app/state"
import {loadUserData, listenForNotifications} from "@app/requests"
import {theme} from "@app/theme"
import * as commands from "@app/commands"
@@ -126,6 +132,12 @@
document.body.setAttribute("data-theme", $theme)
})
// Sync font size
userSettingValues.subscribe($userSettingValues => {
// @ts-ignore
document.documentElement.style["font-size"] = `${$userSettingValues.font_size}rem`
})
if (!db) {
setupTracking()
setupAnalytics()
+18
View File
@@ -166,6 +166,24 @@
<p>Choose a media server type and url for files you upload to {PLATFORM_NAME}.</p>
{/snippet}
</Field>
<strong class="text-lg">Accessibility</strong>
<Field>
{#snippet label()}
<p>Font size</p>
{/snippet}
{#snippet secondary()}
<p>{Math.round(settings.font_size * 100)}%</p>
{/snippet}
{#snippet input()}
<input
class="range range-primary"
type="range"
min="0.8"
max="1.3"
step="0.05"
bind:value={settings.font_size} />
{/snippet}
</Field>
<div class="mt-4 flex flex-row items-center justify-between gap-4">
<Button class="btn btn-neutral" onclick={reset}>Discard Changes</Button>
<Button type="submit" class="btn btn-primary">Save Changes</Button>