-
Notifications
You must be signed in to change notification settings - Fork 0
/
mg155769-slider.html
160 lines (143 loc) · 3.13 KB
/
mg155769-slider.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
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
<!DOCTYPE html>
<html>
<head>
<title>Cape Ivy</title>
<style>
.container {
max-width: 800px;
}
#comparison {
width: 100%;
padding-bottom: 100%;
overflow: hidden;
position: relative;
}
figure {
position: absolute;
background-image: url(CI-mg155769-after.jpg);
background-size: cover;
font-size: 0;
width: 100%;
height: 100%;
margin: 0;
}
#divisor {
background-image: url(CI-mg155769-before.jpg);
background-size: cover;
position: absolute;
width: 50%;
box-shadow: 0 5px 10px -2px rgba(0,0,0,0.3);
bottom: 0; height: 100%;
&::before,
&::after {
content: '';
position: absolute;
right: -2px;
width: 4px;
height: calc(50% - 25px);
background: white;
z-index: 3;
}
&::before {
top: 0;
box-shadow: 0 -3px 8px 1px rgba(0,0,0,.3);
}
&::after {
bottom: 0;
box-shadow: 0 3px 8px 1px rgba(0,0,0,.3);
}
}
#handle {
position: absolute;
height: 50px;
width: 50px;
top: 50%;
left: 50%;
transform: translateY(-50%) translateX(-50%);
z-index: 1;
&::before,
&::after {
content: '';
width: 0;
height: 0;
border: 6px inset transparent;
position: absolute;
top: 50%;
margin-top: -6px;
}
&::before {
border-right: 6px solid white;
left: 50%;
margin-left: -17px;
}
&::after {
border-left: 6px solid white;
right: 50%;
margin-right: -17px;
}
}
input[type=range]{
-webkit-appearance:none;
-moz-appearance:none;
position: absolute;
top: 50%; left: -25px;
transform: translateY(-50%);
background-color: transparent;
width: calc(100% + 50px);
z-index: 2;
&:focus,
&:active {
border: none;
outline: none;
}
}
input[type=range]::-webkit-slider-thumb {
-webkit-appearance: none;
border: none;
height: 50px;
width: 50px;
border-radius: 50%;
background: transparent;
border: 4px solid white;
box-shadow: 0 0 8px 1px rgba(0,0,0,.3);
}
input[type=range]::-moz-range-track {
-moz-appearance:none;
height:15px;
width: 100%;
background-color: transparent;
position: relative;
outline: none;
}
</style>
<body>
<div class="container">
<div id="comparison">
<figure>
<div id="handle"></div>
<div id="divisor"></div>
</figure>
<input type="range" min="0" max="100" value="50" id="slider" oninput="moveDivisor()">
</div>
</div>
<div>
Move center circle left and right to view site progress.
<br>
<br>
Workday, February 12th 2022. 1 Staff, 4 Volunteers.
<Br>
<br>
<!--this part adds a google form, i don't yet know how to format this to look nice, and this may not be the form to use, this is just a test-->
<!--<iframe src="https://docs.google.com/forms/d/e/1FAIpQLSer8DvzxQEHUvLRI3earx5XStmioJEOuzfN_T6IU6WGO0_zdg/viewform?embedded=true" width="270" height="100%" frameborder="0" marginheight="0" marginwidth="0">Loading…</iframe>!-->
<script>
var divisor = document.getElementById("divisor"),
handle = document.getElementById("handle"),
slider = document.getElementById("slider");
function moveDivisor() {
handle.style.left = slider.value+"%";
divisor.style.width = slider.value+"%";
}
window.onload = function() {
moveDivisor();
};
</script>