-
Notifications
You must be signed in to change notification settings - Fork 0
/
practice_js.html
213 lines (165 loc) · 5.65 KB
/
practice_js.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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Just For Fun</title>
<link rel="stylesheet" type="text/css" href="color.css">
<link href="https://fonts.googleapis.com/css?family=Space+Mono:400,700|Titillium+Web:200,400" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script src="color.js">
</script>
</head>
<body>
<div class="header">
<a href="#"><h5>Javascript Practice</h5></a>
<div class="menu">
<i class="fa fa-bars"></i>
<div class="dropdown">
<a href="#">Your Fav Color</a>
<a href="#sweet_hsl">Generate Random Color</a>
<a href="#dmv">DMV Practice Test</a>
<a href="#animation">Colorful Star</a>
</div>
</div>
</div>
<br>
<div class="container">
<!--<div class="welCome">
<p class="hello"><span id="good"> Good Morning,</span>
<span id="day"></span></p>
<span id="wish">Wish you a nice day!</span>
</div><br><br>-->
<div id="image">
<a href="practice_js.html">
<img src="https://i.pinimg.com/736x/c4/dd/c6/c4ddc6a915c55bed3049c6179ec8dddb.jpg" id="img" ></a>
<br></div>
<div class="ques">
<p id="qu">What Is Your Favourite Color ?</p>
<p class="choices">
<input type="radio" name="color" value="theblue" onclick="theBlue()" >blue<br>
<input type="radio" name="color" value="pink" onclick="thePink()" >pink<br>
<input type="radio" name="color" value="purple" onclick="thePurple()" >purple<br>
<input type="radio" name="color" value="red" onclick="theRed()">red<br>
<input type="radio" name="color" value="orange" onclick="theOrange()" >orange<br>
<input type="radio" name="color" value="green" onclick="theGreen()" >green
</p>
</div>
</div><br>
<!---<div class="date">
<center><br>
<br>
<button type="button" onclick="theDate()">Click here </button>
<p id="demo" onclick="nextLine()"></p>
<p id="welcome"></p>
</center>
</div>-->
<br><hr id="sweet_hsl"><br>
<div class="generate_color">
<a href="#sweet_hsl"><h1>Gerenrate Sweet Color</h1></a>
<div class="col-1">
<p id="pastel_color"></p>
</div>
<div class="col-2">
<h2 id="header">HSL Value</h2>
Hue: <span id="hue">#</span>, <span id="hue2">#</span><br>
Saturation: 43%<br>
Lightness: 95%<br>
<a href="https://en.wikipedia.org/wiki/HSL_and_HSV" target="_blank"><font id="link">What is HSL?</font></a>
</div><div class="button">
<button onclick="randomColor()" id="gcolor">Click Me</button>
</div>
</div>
<br><hr><center>
<input type="number" id="choosenum" max="7" min="1"><br>
<br>
<button onclick="heartColor()" id="change-color">Click Me</button><br>
<div id="heart">♥</div>
<p id="valid"> </p></center><br>
<!--###DMV Test###-->
<hr id="dmv">
<br>
<div class="prepare-test">
<h1>2018 DMV Practice Test</h1>
<div class="number-an">
<div id="an-1">1</div>
<div id="an-2">2</div>
<div id="an-3">3</div>
<div id="an-4">4</div>
<div id="an-5">5</div>
<div id="an-6">6</div>
</div>
<div class="practice_test">
<div class="form">
<b>You can help keep the driver behind you at a safe distance by:</b> <br>
<input type="radio" name="dmv" id="answer" onclick="checkIt(this)" value="wrong">
Driving 3-5 mph faster than the car behind<br>
<input type="radio" name="dmv" id="answer" onclick="checkIt(this)" value="wrong">
Driving 3-5 mph slower than the car behind<br>
<input type="radio" name="dmv" id="answer" onclick="checkIt(this)" value="correct">
Keeping a steady speed<br>
<div id="checking"></div>
</div>
<div class="form">
<b style="text-align: center;">What type of sign is this?</b><br>
<img src="sign.svg" id="sign">
<div class="sign_choose">
<input type="radio" name="dmv2" id="stop" onclick="checkIt(this)" value="wrong-2">
<label for="stop">Stop</label>
<br>
<input type="radio" name="dmv2" id="yield" onclick="checkIt(this)" value="correct-2">
<label for="yield">Yield</label>
<br>
<input type="radio" name="dmv2" id="hama" onclick="checkIt(this)" value="wrong-2">
<label for="hama">Hazardous materials</label>
<br>
<div id="checking-2"></div>
</div>
</div>
</div>
</div>
<br>
<hr id="animation">
<div class="frame">
<i class="fa fa-star" id="star"></i>
</div>
<br>
<hr id="class_function">
<div id="practice_canvas">
<p id="string"></p>
<p id="new_code"></p>
<p id="numstring"></p>
<p id="map"></p>
</div>
<!--Contact Info-->
<hr class="contact_info">
<footer>
<!--github-->
<a href="https://github.com/chloeqino" target="_blank"><i class="fa fa-github" id="icon"></i> chloeqino</a>
<!--insta-->
<a href="https://www.instagram.com/bertha.cfish/" target="_blank"><i class="fa fa-instagram" id="icon"></i> bertha.cfish</a>
<!--facebook-->
<a href="https://www.facebook.com/bertha.cino" target="_blank"><i class="fa fa-facebook-square" id="icon"></i> Qinyu Chen</a>
</footer>
<script>
colorStar(",79%,89%)");
accountInfo();
var num=document.getElementById('numstring');
num.innerHTML=padZeros(21,4);
myMap();
var header = document.getElementsByTagName('h5');
var h5=header[0].innerText;
//console.log(h5[1]);
var h5text=h5;
header[0].innerHTML="";
console.log(h5text);
for (var i = 0; i < h5text.length; i++) {
var fontElem = document.createElement('font');
var hsl="hsl(" + (15 * i + 279) + ",58%,82%)";
//console.log(hsl);
fontElem.style.color=hsl;
fontElem.innerHTML=h5text[i];
//header[0].innerHTML="";
header[0].appendChild(fontElem);
}
</script>
</body>
</html>