-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.html
47 lines (46 loc) · 1.17 KB
/
example.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
<html>
<head>
<title>Rating</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="build/build.css" type="text/css">
<style>
body {
margin: 50px;
}
#star-rating-1,
#star-rating-2,
form {
display: block;
font-size: 2em;
margin-top: .5em;
}
#star-rating-2 .stars {
color: orange;
}
#star-rating-2 .shadow {
color: lightgreen;
}
</style>
</head>
<body>
<h1>Rating</h1>
<div id='star-rating-1'></div>
<div id='star-rating-2'></div>
<form>
<input id='counter' type='range' min='0' max='100' value='25' step='5'>
</form>
<script src='build/build.js'></script>
<script>
var rating = require('rating'),
r1 = rating(document.getElementById('star-rating-1'), 25),
r2 = rating(document.getElementById('star-rating-2'), {
value: 25,
star: '❤'
});
document.getElementById('counter').addEventListener('change', function(e) {
r1.set(this.value);
r2.set(this.value);
});
</script>
</body>
</html>