-
Notifications
You must be signed in to change notification settings - Fork 0
/
FinalProduct.html
298 lines (270 loc) · 9.59 KB
/
FinalProduct.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
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
291
292
293
294
295
296
297
298
<!-- Rohan Skariah -->
<!-- Tangia Sun-->
<!-- Ryan Teoh -->
<!-- Justin Wong -->
<!DOCTYPE html>
<head>
<html>
<body style= "
margin-top: 50px;">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
canvas {background: transparent}
.numinputbox{
color: rgb(0, 0, 0);
}
.gridtitle {
color: #001f3f;
margin: 20px 10px 1px;
font-size: 20px;
font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif
}
.slider {
-webkit-appearance: none;
width: 25%;
height: 15px;
background: #d3d3d3;
outline: none;
opacity: 0.7;
-webkit-transition: .2s;
transition: opacity .2s;
margin: 20px
}
.slider:hover {
opacity: 1;
}
.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 15px;
height: 25px;
background: #4CAF50;
cursor: pointer;
}
.slider::-moz-range-thumb {
width: 25px;
height: 25px;
background: #4CAF50;
cursor: pointer;
}
.button {
display: inline-block;
border-radius: 2px;
background-color: #f4511e;
border: none;
border-radius: 10px;
color: #FFFFFF;
text-align: center;
font-size: 15px;
padding: 10px;
width: 120px;
transition: all 0.5s;
cursor: pointer;
margin: 25px;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 25px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
.selectbutton {
display: inline-block;
padding: 15px 50px;
font-size: 20px;
cursor: pointer;
text-align: center;
text-decoration: none;
outline: none;
margin: 4px 10px;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 20px;
box-shadow: 0 9px #999;
}
.selectbutton:hover {background-color: #3e8e41}
.selectbutton:active {
background-color: #3e8e41;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
.smallsbutton {
display: inline-block;
padding: 10px 40px;
font-size: 15px;
cursor: pointer;
text-align: center;
text-decoration: none;
outline: none;
margin: 4px 10px 15px;
color: #fff;
background-color: #4CAF50;
border: none;
border-radius: 20px;
box-shadow: 0 9px #999;
}
.smallsbutton:hover {background-color: #3e8e41}
.smallsbutton:active {
background-color: #3e8e41;
box-shadow: 0 5px #666;
transform: translateY(4px);
}
.block {
background-color: #0074D9;
border: 3px rgb(0,0,0);
color: white;
padding: 16px 40px;
text-align: center;
font-size: 16px;
margin: 4px 30px;
opacity: 2.0;
transition: 0.3s;
display: inline-block;
text-decoration: none;
cursor: pointer;
}
.title {
color: #001f3f;
font-size: 60px;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.subtitle {
color: #001f3f;
margin: 30px 10px 20px;
font-size: 30px;
font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif
}
.subsubtitle {
color: #001f3f;
margin: 30px 10px 20px;
font-size: 20px;
font-family:'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif
}
.block:hover {
opacity: 0.8;
}
</style>
<link rel="stylesheet" type="text/css" href="Styles.css">
</head>
</body>
<h1 class = "title">Draw-A-Figure </h1>
<div class="slidecontainer">
</div>
<button class = "selectbutton" onclick="tributton()">Triangle</button>
<button class = "selectbutton" onclick="quadbutton()">Quadrilateral</button>
<button class = "selectbutton" onclick="conicButton()">Conic</button>
<div id= "triinterface", class ="hidden">
<h1 class = "subtitle">What Triangle?</h1>
<button class ="smallsbutton" onclick="displayInputEqualTri()">Equilateral Triangle </button>
<button class ="smallsbutton" onclick="displayInputScaleneTri()">Scalene Triangle </button>
<div id = "scalenetriinterface", class = "hidden">
<h1 class = "subsubtitle">Enter Side Lengths and Angle</h1>
<input class = "numinputbox" type = "number" id = "triLeg1" value= "triLeg1" step="10" placeholder = "Enter Length of Side 1">
<br>
<input class = "numinputbox" type = "number" id = "triLeg2" value= "triLeg2" step="10" placeholder = "Enter Length of Side 2">
<br>
<input class = "numinputbox" type = "number" id = "angle" value= "angle" list="commonangles" step="10" placeholder = "Enter Angle between Them">
<span class ="validity"></span>
<p class = "gridtitle"> Grid Size - Each Square is 5 units</p>
<input type="range" min="1" max="11" value="6" class="slider" onchange="changeGridFactor(value)" id="myRange">
<br>
<datalist id="commonangles">
<option value="30">
<option value="45"></option>
<option value="60"></option>
<option value="90"></option>
<option value="120"></option>
<option value="135"></option>
<option value="150"></option>
</datalist>
<br>
<button class = "button" type = "submit" onclick = "drawTriangle(document.getElementById('triLeg1').value, document.getElementById('triLeg2').value,document.getElementById('angle').value)" id = "btnscalenetri"><span>Draw!</span></button>
</div>
<div id = "equaltriinterface", class = "hidden">
<h1 class = "subsubtitle">Enter Side Length</h1>
<input type = "number" id = "triside" value = "triside" step ="10" placeholder = "Enter Length of the Side">
<br>
<p class = "gridtitle"> Grid Size - Each Square is 5 units</p>
<input type="range" min="1" max="11" value="6" class="slider" onchange="changeGridFactor(value)" id="myRange">
<br>
<button class = "button" type = "submit" onclick="drawTriangle(document.getElementById('triside').value, document.getElementById('triside').value, 60, true)" id = "btnequaltri"><span>Draw!</span> </button>
</div>
</div>
<div id= "quadinterface", class="hidden">
<h1 class = "subtitle">What Quadrilateral?</h1>
<!--quadrilateral (display square or rectangle buttons)-->
<button class="smallsbutton" onclick="displayInputSquare()">Square </button>
<button class="smallsbutton" onclick="displayInputRectangle()">Rectangle</button>
<div id= "sqinterface", class="hidden">
<h1 class = "subsubtitle">Enter Side Length</h1>
<p id="demo"></p>
<!--square-->
<input type = "number" id="side1s" value = "sideLength" step = "10" placeholder="Enter Length">
<br>
<p class = "gridtitle"> Grid Size - Each Square is 5 units</p>
<input type="range" min="1" max="11" value="6" class="slider" onchange="changeGridFactor(value)" id="myRange">
<br>
<button class="button" type = "submit" onclick="drawRect(document.getElementById('side1s').value, document.getElementById('side1s').value)" id = "squarebtn"> <span>Draw!</span> </button>
</div>
<div id= "rectinterface", class="hidden">
<!--rectangle-->
<h1 class = "subsubtitle">Enter Width and Height</h1>
<input type = "number" id = "rectWidth" value= "rectWidth" step = "10" placeholder = "Enter Width for Rectangle">
<br>
<input type = "number" id = "rectHeight" value= "rectHeight" Step = "10" placeholder = "Enter Height for Rectangle">
<br>
<p class = "gridtitle"> Grid Size - Each Square is 5 units</p>
<input type="range" min="1" max="11" value="6" class="slider" onchange="changeGridFactor(value)" id="myRange">
<br>
<button class = "button" type = "submit" onclick="drawRect(document.getElementById('rectWidth').value, document.getElementById('rectHeight').value)" id = "btnRect"> <span>Draw!</span> </button>
</div>
</div>
<div id= "conicinterface", class="hidden">
<h1 class = "subtitle">What Conic?</h1>
<button class="smallsbutton" onclick="displayInputCircle()">Circle</button>
<button class="smallsbutton" onclick="displayInputEllipse()">Ellipse</button>
<div id= "circinterface", class="hidden">
<!--circle-->
<h1 class = "subsubtitle">Enter Radius</h1>
<input type = "number" id = "radius" value= "radius" step = "2" placeholder = "Enter the Radius">
<br>
<p class = "gridtitle"> Grid Size - Each Square is 5 units</p>
<input type="range" min="1" max="11" value="6" class="slider" onchange="changeGridFactor(value)" id="myRange">
<br>
<button class = "button" type = submit onclick="drawCircle(document.getElementById('radius').value)" id = "btn1"> <span>Draw!</span> </button>
</div>
<div id= "ellipseinterface", class="hidden">
<!--ellipse-->
<h1 class = "subsubtitle">Enter Radii</h1>
<input type = "number" id = "majorRadius" value= "majorRadius" step = "2" placeholder = "Enter the Major-Axis Radius">
<br>
<input type = "number" id = "minorRadius" value= "minorRadius" step = "2" placeholder = "Enter the Minor-Axis Radius">
<br>
<p class = "gridtitle"> Grid Size - Each Square is 5 units</p>
<input type="range" min="1" max="11" value="6" class="slider" onchange="changeGridFactor(value)" id="myRange">
<br>
<button class = "button" type = submit onclick="drawEllipse(document.getElementById('majorRadius').value, document.getElementById('minorRadius').value)" id = "ellipsebtn"> <span>Draw!</span> </button>
</div>
</div>
<br>
<canvas></canvas>
<script src="DrawFigures.js"></script>
<script src="Interface_buttons.js"></script>
</body>
</html>