-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
290 lines (281 loc) · 10.2 KB
/
main.html
File metadata and controls
290 lines (281 loc) · 10.2 KB
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>title</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,700;1,300&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
<script>
var rotation = 0;
const UP = 1;
const DOWN = -1;
var buttons = [
"Remake",
"Recycle",
"Home",
"Find",
"Repair"
]
var buttons_dict = {
"Home": {
"Title": "<h1>Home</h1>",
"Text":
`Did you know that most plastic waterbottles are only useful for 12 minutes? What if that were 12 years?
<br>
With Re, you can find out how to be a concious custodian of the goods you bring into your home, so that we can achieve a circular economy.
<br>
To get started, search for a good below.`,
"Color": "#E7F498",
"Image": "url('./resources/Waterbottle.png')"
},
"Recycle": {
"Title": "<h1>Recycle</h1>",
"Text": `
While goods should be used up until their lifespan, we’re aware they won’t always last. Here are options to make the most out of your good’s materials and convert them back into raw materials
<br>
- Sell a waterbottle if it still functions
<br>
- Donate it to someone else in need
<br>
- Recycle your waterbottle local recycling facility
`,
"Color": "#99BEF6",
"Image": "url('./resources/Recycle.png')"
},
"Remake": {
"Title": "<h1>Remake</h1>",
"Text": `
Sometimes goods may retain their forms but lose their functionality. We’ve collected some tips from the community on how you can reuse your object!
<br>
- Turn it into a planter
<br>
- Create dab painters
<br>
- An insect trapper
<br>
- Zipper containers
<br>
- DIY spray paint container
<br>
- Sprinkler
`,
"Color": "#85D983",
"Image": "url('./resources/Reuse.png')"
},
"Repair": {
"Title": "<h1>Repair</h1>",
"Text": `
Here are some community suggestions for repairing your good. These may not be permanent solutions but they’ll expand the lifespan of your good.
<br>
- Repaint your waterbottle
- Decorate your bottle with stickers or doodles
<br>
- Use a rubberband to replace the waterbottle seal
`,
"Color": "#5E68C9",
"Image": "url('./resources/Repair.png')"
},
"Find": {
"Title": "<h1>Find</h1>",
"Text": `
Looking to take custody of a good? Here are some ways to find your good within the circular economy
<br>
- Reusable bottle instead of disposable
<br>
- Shop secondhand at thrift store
<br>
- Decorate your old bottle instead of buying new one
`,
"Color": "#6AD3E1",
"Image": "url('./resources/Obtain.png')"
},
}
const rotateCircle = async function (dir) {
for(var i = 0; i < 36; i++){
rotation+=dir;
document.getElementById("circWrapper").style.transform = "rotate(" + rotation + "deg)";
await sleep(1).then(() => { console.log("World!"); });
}
if(dir == UP){
var spare = buttons[0]
for(var i = 0; i < 5; i++)
{
if(i == 4)
{
buttons[i] = spare;
}
else {
buttons[i] = buttons[i+1];
}
}
}
else {
var spare = buttons[4]
for(var i = 4; i >= 0; i--)
{
if(i == 0)
{
buttons[i] = spare;
}
else {
buttons[i] = buttons[i-1];
}
}
}
}
function homeSpoke() {
switch(buttons.indexOf("Home")){
case 0:
rotateCircle(DOWN);
case 1:
rotateCircle(DOWN);
break;
case 4:
rotateCircle(UP);
case 3:
rotateCircle(UP);
}
document.getElementById("cont").innerHTML = buttons_dict["Home"]["Text"];
document.getElementById("PageText").style.color = buttons_dict["Home"]["Color"];
document.getElementById("PageText").innerHTML = buttons_dict["Home"]["Title"];
document.getElementById("image").style.backgroundImage = buttons_dict["Home"]["Image"];
}
function recycleSpoke() {
switch(buttons.indexOf("Recycle")){
case 0:
rotateCircle(DOWN);
case 1:
rotateCircle(DOWN);
break;
case 4:
rotateCircle(UP);
case 3:
rotateCircle(UP);
}
document.getElementById("cont").innerHTML = buttons_dict["Recycle"]["Text"];
document.getElementById("PageText").style.color = buttons_dict["Recycle"]["Color"];
document.getElementById("PageText").innerHTML = buttons_dict["Recycle"]["Title"];
document.getElementById("image").style.backgroundImage = buttons_dict["Recycle"]["Image"];
}
function remakeSpoke() {
switch(buttons.indexOf("Remake")){
case 0:
rotateCircle(DOWN);
case 1:
rotateCircle(DOWN);
break;
case 4:
rotateCircle(UP);
case 3:
rotateCircle(UP);
}
document.getElementById("cont").innerHTML = buttons_dict["Remake"]["Text"];
document.getElementById("PageText").style.color = buttons_dict["Remake"]["Color"];
document.getElementById("PageText").innerHTML = buttons_dict["Remake"]["Title"];
document.getElementById("image").style.backgroundImage = buttons_dict["Remake"]["Image"];
}
function repairSpoke() {
switch(buttons.indexOf("Repair")){
case 0:
rotateCircle(DOWN);
case 1:
rotateCircle(DOWN);
break;
case 4:
rotateCircle(UP);
case 3:
rotateCircle(UP);
}
document.getElementById("cont").innerHTML = buttons_dict["Repair"]["Text"];
document.getElementById("PageText").style.color = buttons_dict["Repair"]["Color"];
document.getElementById("PageText").innerHTML = buttons_dict["Repair"]["Title"];
document.getElementById("image").style.backgroundImage = buttons_dict["Repair"]["Image"];
}
function findSpoke() {
switch(buttons.indexOf("Find")){
case 0:
rotateCircle(DOWN);
case 1:
rotateCircle(DOWN);
break;
case 4:
rotateCircle(UP);
case 3:
rotateCircle(UP);
}
document.getElementById("cont").innerHTML = buttons_dict["Find"]["Text"];
document.getElementById("PageText").style.color = buttons_dict["Find"]["Color"];
document.getElementById("PageText").innerHTML = buttons_dict["Find"]["Title"];
document.getElementById("image").style.backgroundImage = buttons_dict["Find"]["Image"];
}
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
</script>
</head>
<body>
<div class="Container">
<div id="Navbar">
<div id="logo"></div>
<div class="navbutton">Learn</div>
<div class="navbutton">About</div>
</div>
<div id="Main">
<div id="Content">
<input id=search placeholder="Search..."></input>
<div id=search_button>?</div>
<div id=cont>
Did you know that most plastic waterbottles are only useful for 12 minutes? What if that were 12 years?
<br>
With Re, you can find out how to be a concious custodian of the goods you bring into your home, so that we can achieve a circular economy.
<br>
To get started, search for a good above, or navigate with the nav wheel on the right.
</div>
<div id=image>
</div>
</div>
<div id="Circle">
<div id="GreyCircle"></div>
<ul id="circWrapper">
<li>
<div id="HomeSpoke1" class="circ" onclick="homeSpoke()"></div>
</li>
<li>
<div id="RecycleSpoke1" class="circ" onclick="recycleSpoke()"></div>
</li>
<li>
<div id="RemakeSpoke1" class="circ" onclick="remakeSpoke()"></div>
</li>
<li>
<div id="RepairSpoke1" class="circ" onclick="repairSpoke()"></div>
</li>
<li>
<div id="FindSpoke1" class="circ" onclick="findSpoke()"></div>
</li>
<li>
<div id="HomeSpoke2" class="circ" onclick="homeSpoke()"></div>
</li>
<li>
<div id="RecycleSpoke2" class="circ" onclick="recycleSpoke()"></div>
</li>
<li>
<div id="RemakeSpoke2" class="circ" onclick="remakeSpoke()"></div>
</li>
<li>
<div id="RepairSpoke2" class="circ" onclick="repairSpoke()"></div>
</li>
<li>
<div id="FindSpoke2" class="circ" onclick="findSpoke()"></div>
</li>
</ul>
<div id="CenterCircle"></div>
<div id="PageText">
<h1>Home</h1>
</div>
</div>
</div>
</div>
</body>
</html>