Skip to content

Commit

Permalink
feat: add dark background option
Browse files Browse the repository at this point in the history
  • Loading branch information
khui0 committed Jul 16, 2024
1 parent e52671e commit 88316e4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/lib/components/GameFeed.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script lang="ts">
import { settings } from "$lib/settings";
interface Country {
code: string;
name: string;
Expand Down Expand Up @@ -32,6 +34,7 @@
src={guess.diff}
alt="{guess.name} diff"
class="bg-base-100/50 h-full aspect-[3/2] ml-2"
class:bg-[#1a1a1a]={$settings.diffDarkBg === "true"}
/>
{/if}
</div>
Expand Down
8 changes: 8 additions & 0 deletions src/routes/settings/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@
<SettingsField type="select" title="Theme" options={themes} bind:value={$settings.theme}>
Select a theme
</SettingsField>
<SettingsField
type="checkbox"
title="Dark Background"
options={themes}
bind:value={$settings.diffDarkBg}
>
Use a dark background behind the "difference" panel regardless of theme
</SettingsField>
<a href="https://github.com/khui0/flaggle" title="GitHub" class="self-center text-2xl"
><BiGithub></BiGithub></a
>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/settings/SettingsField.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
value = checkbox.checked ? "true" : "false";
}}
/>
<span class="label-text text-neutral-content"><slot></slot></span>
<span class="label-text text-neutral-content mt-0.5"><slot></slot></span>
</label>
{:else if type === "select"}
<label class="label cursor-pointer flex-col items-start justify-normal gap-2 p-1">
Expand Down

0 comments on commit 88316e4

Please sign in to comment.