/
_Sliders.svelte
52 lines (49 loc) · 1.41 KB
/
_Sliders.svelte
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
<Dialog
bind:open
aria-labelledby="slider-title"
aria-describedby="slider-content"
>
<Title id="slider-title">Volumes</Title>
<Content id="slider-content">
<div>
<FormField style="display: flex; flex-direction: column-reverse;">
<Slider
bind:value={volumeMedia}
use={[InitialFocus]}
style="width: 100%;"
/>
<span slot="label">Media Volume</span>
</FormField>
</div>
<div>
<FormField style="display: flex; flex-direction: column-reverse;">
<Slider bind:value={volumeRingtone} style="width: 100%;" />
<span slot="label">Ringtone Volume</span>
</FormField>
</div>
<div>
<FormField style="display: flex; flex-direction: column-reverse;">
<Slider bind:value={volumeAlarm} style="width: 100%;" />
<span slot="label">Alarm Volume</span>
</FormField>
</div>
</Content>
<Actions>
<Button action="accept">
<Label>Done</Label>
</Button>
</Actions>
</Dialog>
<Button on:click={() => (open = true)}>
<Label>Open Dialog</Label>
</Button>
<script lang="ts">
import Dialog, { Title, Content, Actions, InitialFocus } from '@smui/dialog';
import Button, { Label } from '@smui/button';
import Slider from '@smui/slider';
import FormField from '@smui/form-field';
let open = false;
let volumeMedia = 100;
let volumeRingtone = 80;
let volumeAlarm = 80;
</script>