aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-04-22 09:39:03 +0530
committerBobby <[email protected]>2026-04-22 09:39:03 +0530
commitae02de7dd6c402d8cc4923668a1e7c17e152ca36 (patch)
tree88c8b4a662beeecc35ceda6919f62e6584ba0708 /lib
parent0bf04a2f4cc4675df0598bc2a4d604f442a36413 (diff)
downloadhollowdark-ae02de7dd6c402d8cc4923668a1e7c17e152ca36.tar.xz
hollowdark-ae02de7dd6c402d8cc4923668a1e7c17e152ca36.zip
Co-locate AudioPlayer and TextSizeChoice with their stores and move version and credits to their new homes
Diffstat (limited to 'lib')
-rw-r--r--lib/audio/AudioPlayer.svelte (renamed from lib/components/AudioPlayer.svelte)0
-rw-r--r--lib/components/AppVersion.svelte2
-rw-r--r--lib/credits/credits.ts48
-rw-r--r--lib/reading/TextSizeChoice.svelte (renamed from lib/components/TextSizeChoice.svelte)0
-rw-r--r--lib/screens/CreditsScreen.svelte2
-rw-r--r--lib/screens/SettingsScreen.svelte4
-rw-r--r--lib/version/version.ts11
7 files changed, 52 insertions, 15 deletions
diff --git a/lib/components/AudioPlayer.svelte b/lib/audio/AudioPlayer.svelte
index d5aa1d0..d5aa1d0 100644
--- a/lib/components/AudioPlayer.svelte
+++ b/lib/audio/AudioPlayer.svelte
diff --git a/lib/components/AppVersion.svelte b/lib/components/AppVersion.svelte
index 28554a7..703b810 100644
--- a/lib/components/AppVersion.svelte
+++ b/lib/components/AppVersion.svelte
@@ -1,5 +1,5 @@
<script lang="ts">
- import { APP_VERSION } from '@hollowdark/lib/version/version'
+ import { APP_VERSION } from '@hollowdark/utils/version/version'
</script>
<p class="app-version">v {APP_VERSION}</p>
diff --git a/lib/credits/credits.ts b/lib/credits/credits.ts
new file mode 100644
index 0000000..d86517d
--- /dev/null
+++ b/lib/credits/credits.ts
@@ -0,0 +1,48 @@
+/**
+ * The kind of third-party resource a credit entry describes. Drives
+ * grouping on the Credits screen.
+ */
+export type CreditKind = 'font' | 'audio' | 'library'
+
+/**
+ * One entry on the Credits screen. Add a new `Credit` to `CREDITS` below
+ * whenever a new third-party resource lands in the repo, alongside its
+ * license file.
+ */
+export interface Credit {
+ readonly title: string
+ readonly kind: CreditKind
+ readonly author: string
+ readonly license: string
+ readonly sourceUrl?: string
+ readonly note?: string
+}
+
+/**
+ * The master list of third-party credits. Append a new entry whenever a
+ * new resource is added to the repo.
+ */
+export const CREDITS: readonly Credit[] = [
+ {
+ title: 'Literata',
+ kind: 'font',
+ author: 'Type Network',
+ license: 'SIL Open Font License 1.1',
+ sourceUrl: 'https://fonts.google.com/specimen/Literata'
+ },
+ {
+ title: 'Inter',
+ kind: 'font',
+ author: 'Rasmus Andersson',
+ license: 'SIL Open Font License 1.1',
+ sourceUrl: 'https://fonts.google.com/specimen/Inter'
+ },
+ {
+ title: 'Piano Relaxing',
+ kind: 'audio',
+ author: 'atlasaudio',
+ license: 'Pixabay Content License',
+ sourceUrl: 'https://pixabay.com/music/ambient-piano-relaxing-510242/',
+ note: 'Title screen music.'
+ }
+]
diff --git a/lib/components/TextSizeChoice.svelte b/lib/reading/TextSizeChoice.svelte
index f508c84..f508c84 100644
--- a/lib/components/TextSizeChoice.svelte
+++ b/lib/reading/TextSizeChoice.svelte
diff --git a/lib/screens/CreditsScreen.svelte b/lib/screens/CreditsScreen.svelte
index 7482361..2f4bdd5 100644
--- a/lib/screens/CreditsScreen.svelte
+++ b/lib/screens/CreditsScreen.svelte
@@ -1,5 +1,5 @@
<script lang="ts">
- import { CREDITS, type CreditKind } from '@hollowdark/credits/credits'
+ import { CREDITS, type CreditKind } from '@hollowdark/lib/credits/credits'
interface Props {
onBack: () => void
diff --git a/lib/screens/SettingsScreen.svelte b/lib/screens/SettingsScreen.svelte
index 63b6ba0..aa7d1c9 100644
--- a/lib/screens/SettingsScreen.svelte
+++ b/lib/screens/SettingsScreen.svelte
@@ -1,11 +1,11 @@
<script lang="ts">
import Slider from '@hollowdark/lib/components/Slider.svelte'
- import TextSizeChoice from '@hollowdark/lib/components/TextSizeChoice.svelte'
+ import TextSizeChoice from '@hollowdark/lib/reading/TextSizeChoice.svelte'
import ToggleSwitch from '@hollowdark/lib/components/ToggleSwitch.svelte'
import { ambientVolume, masterMuted } from '@hollowdark/lib/audio/state'
import { highContrast, reduceMotion } from '@hollowdark/lib/accessibility/state'
import { textSize, type TextSize } from '@hollowdark/lib/reading/state'
- import { APP_VERSION_FULL } from '@hollowdark/lib/version/version'
+ import { APP_VERSION_FULL } from '@hollowdark/utils/version/version'
interface Props {
onBack: () => void
diff --git a/lib/version/version.ts b/lib/version/version.ts
deleted file mode 100644
index 69377b8..0000000
--- a/lib/version/version.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-const [major, minor] = __APP_VERSION__.split('.')
-
-/**
- * The app's version in short display form (`<major>.<minor>`), derived
- * from the `version` field in `package.json` at build time via Vite's
- * `define`. Used in the UI footer.
- */
-export const APP_VERSION: string = `${major}.${minor}`
-
-/** The full semver string from `package.json`. */
-export const APP_VERSION_FULL: string = __APP_VERSION__