blob: 3d502f184902da3c16a40119be1fe8d63b4e9ae5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
<script lang="ts">
import Slider from '@hollowdark/lib/components/Slider.svelte'
import ToggleSwitch from '@hollowdark/lib/components/ToggleSwitch.svelte'
import { ambientVolume, masterMuted } from '@hollowdark/lib/audio/state'
interface Props {
onBack: () => void
}
let { onBack }: Props = $props()
const volumePercent = $derived(Math.round($ambientVolume * 100))
function setMuted(next: boolean): void {
masterMuted.set(next)
}
function setVolume(next: number): void {
ambientVolume.set(next)
}
</script>
<section class="settings">
<header class="top">
<button class="back" onclick={onBack}>← Back</button>
<h1 class="heading">Settings</h1>
</header>
<div class="body">
<section class="group">
<h2 class="group-label">Audio</h2>
<div class="row">
<div class="row-label">
<p class="row-name">Mute everything</p>
<p class="row-hint">Silence all sound, regardless of volume.</p>
</div>
<ToggleSwitch value={$masterMuted} label="Mute everything" onChange={setMuted} />
</div>
<div class="row">
<div class="row-label">
<p class="row-name">Ambient volume</p>
<p class="row-hint">Title music and region beds.</p>
</div>
<div class="slider-cell">
<Slider
value={$ambientVolume}
min={0}
max={1}
step={0.01}
label="Ambient volume"
onChange={setVolume}
/>
<span class="slider-value">{volumePercent}%</span>
</div>
</div>
</section>
</div>
</section>
<style>
.settings {
min-height: 100dvh;
padding: var(--space-8) var(--space-6) var(--space-12);
max-width: 640px;
margin: 0 auto;
display: flex;
flex-direction: column;
}
.top {
display: flex;
align-items: baseline;
gap: var(--space-6);
margin-bottom: var(--space-12);
}
.back {
font-family: var(--font-ui);
font-size: var(--text-sm);
color: var(--color-text-secondary);
letter-spacing: 0.3px;
transition: color var(--transition-fast);
}
.back:hover {
color: var(--color-text);
}
.heading {
font-family: var(--font-body);
font-size: var(--text-xl);
font-style: italic;
font-weight: 400;
letter-spacing: 1px;
color: var(--color-text);
margin: 0;
}
.body {
display: flex;
flex-direction: column;
gap: var(--space-8);
}
.group {
display: flex;
flex-direction: column;
gap: var(--space-4);
}
.group-label {
font-family: var(--font-ui);
font-size: var(--text-xs);
color: var(--color-accent);
letter-spacing: 2px;
text-transform: uppercase;
margin: 0 0 var(--space-2);
}
.row {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-6);
padding: var(--space-3) 0;
border-bottom: 1px solid rgba(232, 226, 213, 0.06);
}
.row-label {
display: flex;
flex-direction: column;
gap: var(--space-1);
flex: 1;
min-width: 0;
}
.row-name {
font-family: var(--font-body);
font-size: var(--text-base);
color: var(--color-text);
margin: 0;
}
.row-hint {
font-family: var(--font-ui);
font-size: var(--text-sm);
color: var(--color-text-tertiary);
margin: 0;
}
.slider-cell {
display: flex;
align-items: center;
gap: var(--space-4);
}
.slider-value {
font-family: var(--font-ui);
font-size: var(--text-sm);
color: var(--color-text-secondary);
min-width: 3.5ch;
text-align: right;
}
</style>
|