-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (106 loc) · 3 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
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
<!DOCTYPE html>
<html>
<head>
<title>SPEEDOMETER</title>
<link href="http://fonts.cdnfonts.com/css/lcd" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="./speedometer.css" />
</head>
<body>
<main class="root">
<svg
viewBox="0 0 250 250"
xmlns="http://www.w3.org/2000/svg"
id="svg-main"
class="svg-main"
>
<defs>
<linearGradient
id="gradient"
x1="20"
y1="110"
x2="125"
y2="110"
gradientUnits="userSpaceOnUse"
>
<stop offset="0%" stop-color="red" />
<stop offset="100%" stop-color="#f75757" />
</linearGradient>
<linearGradient
id="gradient-speedometer"
x1="0%"
y1="0%"
x2="100%"
y2="0%"
>
<stop offset="0%" stop-color="silver" />
<stop offset="100%" stop-color="black" />
</linearGradient>
<radialGradient id="main-gradient">
<stop
offset="0%"
stop-color="#bfb6b6"
style="color: #bfb6b6"
></stop>
<stop offset="75%" stop-color="#3b3838"></stop>
<stop offset="100%" stop-color="#181616"></stop>
</radialGradient>
</defs>
<circle
cx="50%"
cy="50%"
r="125"
fill="url(#gradient-speedometer)"
></circle>
<circle
cx="50%"
cy="50%"
r="118"
stroke="white"
fill="#3b3838"
stroke-width="1.5"
></circle>
<circle
cx="50%"
cy="50%"
r="115"
stroke="silver"
fill="#3b3838"
></circle>
<circle
cx="50%"
cy="50%"
r="107"
stroke="black"
fill="#3b3838"
style="filter: drop-shadow(0px 0px 6px black)"
></circle>
<circle cx="50%" cy="50%" r="105" class="speedometer"></circle>
<text x="111" y="62%" class="unit-kmh">Km/h</text>
<g class="mileage">
<rect width="60" height="30" class="mileage-rect" />
<foreignObject width="60" height="30">
<div class="mileage-text-container">
<p class="mileage-text">DISTANCE TRAVELLED</p>
</div>
</foreignObject>
<text x="5" y="25" class="mileage-digits" id="mileage-digits">
0.00 km
</text>
</g>
</svg>
<div class="pedal-container">
<img
src="./brake.png"
alt="pedals"
class="pedal"
onmouseenter="onPedalEnter()"
onmouseleave="onPedalLeave()"
/>
<h6>HOVER ME</h6>
<button class="pause-button" id="pause-button">Pause Speed</button>
</div>
</main>
<script src="./speedometer.js" type="text/javascript"></script>
</body>
</html>