generated from sveltejs/component-template
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
47 lines (46 loc) · 1.01 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Svelte Slider</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="dist/bundle.css">
<script src="dist/index.js"></script>
<style>
body {
font-family: sans-serif;
}
:root {
--sliderPrimary: #FF9800;
--sliderSecondary: rgba(0, 0, 0, 0.05);
}
</style>
</head>
<body>
<h2>Single Slider</h2>
<div id="slider-single"></div>
<h2>Range Slider</h2>
<div id="slider-range"></div>
<script>
const singleSlider = new Slider({
target: document.getElementById('slider-single'),
props: {
value: [0, 0.5],
single: true,
},
});
singleSlider.$on('change', (event) => {
console.log(event.detail);
});
const rangeSlider = new Slider({
target: document.getElementById('slider-range'),
props: {
value: [0.2, 0.8],
},
});
rangeSlider.$on('change', (event) => {
console.log(event.detail);
});
</script>
</body>
</html>