-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
196 lines (188 loc) · 7.45 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
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="style.css" />
<title>XYZ App</title>
<style>
body {
margin: 0;
overflow: hidden;
align-items: center;
align-content: center;
}
canvas {
display: block;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
const toggleControlsButton = document.getElementById("toggleControls");
const controlsContainer = document.getElementById("controls");
const toggleExerciseButton = document.getElementById("toggleExcercise");
const exerciseContainer = document.getElementById("quiz");
const toggleAdvancedButton = document.getElementById("toggleAdvanced");
const modeButtonsContainer = document.querySelector(".controls");
const taskContainer = document.getElementById("task");
toggleControlsButton.addEventListener("click", function() {
if (controlsContainer.style.display === "none") {
controlsContainer.style.display = "block";
hideModeButtons();
} else {
controlsContainer.style.display = "none";
}
});
const secondRgbCheckbox = document.getElementById("btn-2rgb");
const secondRgbControls = document.getElementById("2rgb");
secondRgbCheckbox.addEventListener("change", function() {
if (this.checked) {
secondRgbControls.style.display = "block";
} else {
secondRgbControls.style.display = "none";
}
});
toggleExerciseButton.addEventListener("click", function() {
if (exerciseContainer.style.display === "none") {
exerciseContainer.style.display = "block";
taskContainer.style.display = "block";
hideModeButtons();
} else {
exerciseContainer.style.display = "none";
taskContainer.style.display = "none";
}
});
toggleAdvancedButton.addEventListener("click", function() {
if (controlsContainer.style.display === "none" && exerciseContainer.style.display === "none") {
controlsContainer.style.display = "block";
exerciseContainer.style.display = "block";
taskContainer.style.display = "block";
hideModeButtons();
} else {
controlsContainer.style.display = "none";
exerciseContainer.style.display = "none";
taskContainer.style.display = "none";
}
});
function hideModeButtons() {
modeButtonsContainer.style.display = "none";
}
});
</script>
</head>
<body>
<script src="p5.js"></script>
<script src="script.js" defer></script>
<div class="header"><span class="gradient-text">CIE XYZ</span><p style="font-size: 24px;">Learn about CIE Color Space!</p></div>
<div class="controls">
<button class="btn" id="toggleControls">Teaching Mode</button>
<button class="btn" id="toggleExcercise">Excercise Mode</button>
<button class="btn" id="toggleAdvanced">Advanced Mode</button>
</div>
<div class="row">
<div class="col" id="controls" style="display: none;">
<div class="controls">
<input class="chk" type="checkbox" id="btn-axis" checked> XYZ Axis </input>
<input class="chk" type="checkbox" id="btn-xyz"> X=Y=Z </input>
<input class="chk" type="checkbox" id="btn-triangle"> Triangle </input>
<input class="chk" type="checkbox" id="btn-sides" > Sides </input>
<input class="chk" type="checkbox" id="btn-bottom" > Bottom </input>
<input class="chk" type="checkbox" id="btn-front" > CIE </input>
<input class="chk" type="checkbox" id="btn-rgb" > RGB Cube </input>
<input class="chk" type="checkbox" id="btn-2rgb" > Second RGB Cube </input>
</div>
<div class="rgb">
<label class="red">R</label>
<label>x:</label>
<input class="font" type="number" id="rx" step="0.01">
<label>y:</label>
<input class="font" type="number" id="ry" step="0.01">
<label>z:</label>
<input class="font" type="number" id="rz" step="0.01">
</div>
<div class="rgb">
<label class="green">G</label>
<label>x:</label>
<input class="font" type="number" id="gx" step="0.01">
<label>y:</label>
<input class="font" type="number" id="gy" step="0.01">
<label>z:</label>
<input class="font" type="number" id="gz" step="0.01">
</div>
<div class="rgb">
<label class="blue">B</label>
<label>x:</label>
<input class="font" type="number" id="bx" step="0.01">
<label>y:</label>
<input class="font" type="number" id="by" step="0.01">
<label>z:</label>
<input class="font" type="number" id="bz" step="0.01">
</div>
<div class="rgb">
<label style="margin-right: 2%; font-size: 30px;">K</label>
<label>x:</label>
<input class="font" type="number" id="kx" step="0.01">
<label>y:</label>
<input class="font" type="number" id="ky" step="0.01">
<label>z:</label>
<input class="font" type="number" id="kz" step="0.01">
</div>
<div class="rgb">
<button class="btn" id="updateRGB">Update RGB</button>
<button class="btn" id="resetRGB">Reset RGB</button>
</div>
<div id="2rgb" style="display: none;">
<div class="rgb">
<label class="red">R</label>
<label>x:</label>
<input class="font" type="number" id="rx2" step="0.01">
<label>y:</label>
<input class="font" type="number" id="ry2" step="0.01">
<label>z:</label>
<input class="font" type="number" id="rz2" step="0.01">
</div>
<div class="rgb">
<label class="green">G</label>
<label>x:</label>
<input class="font" type="number" id="gx2" step="0.01">
<label>y:</label>
<input class="font" type="number" id="gy2" step="0.01">
<label>z:</label>
<input class="font" type="number" id="gz2" step="0.01">
</div>
<div class="rgb">
<label class="blue">B</label>
<label>x:</label>
<input class="font" type="number" id="bx2" step="0.01">
<label>y:</label>
<input class="font" type="number" id="by2" step="0.01">
<label>z:</label>
<input class="font" type="number" id="bz2" step="0.01">
</div>
<div class="rgb">
<label style="margin-right: 2%; font-size: 30px;">K</label>
<label>x:</label>
<input class="font" type="number" id="kx2" step="0.01">
<label>y:</label>
<input class="font" type="number" id="ky2" step="0.01">
<label>z:</label>
<input class="font" type="number" id="kz2" step="0.01">
</div>
<div class="rgb">
<button class="btn" id="updateRGB2">Update RGB</button>
<button class="btn" id="resetRGB2">Reset RGB</button>
</div>
</div>
</div>
<div id="quiz" class="col" style="display: none;">
<script src="quiz.js"></script>
</div>
</div>
<div class="row">
<div id="task" class="col" style="display: none;">
<h3>Excercise/ Tasks:</h3>
<script src="tasks.js"></script>
</div>
</div>
</body>
</html>