-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
240 lines (211 loc) · 9.53 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
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
<!--
FICTOAN
An intuitive, minimalist responsive HTML+CSS setup
for designers just starting to code — just like me.
by Sujan Sundareswaran
Current version: 1.7.2
https://github.com/sujan-s/fictoan/
http://sujansundareswaran.com/
-->
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" href="images/favicon.png" type="image/png" />
<!--A nice, sober serif typeface-->
<link href="https://fonts.googleapis.com/css?family=Cormorant+Garamond:500,500i,700,700i" rel="stylesheet">
<!--And a clean, simple sans typeface-->
<link href="https://fonts.googleapis.com/css?family=Work+Sans:400,700" rel="stylesheet">
<!-- Also a classy monospace typeface for all you nerds -->
<link href="https://fonts.googleapis.com/css?family=Fira+Mono:400,700" rel="stylesheet">
<link rel="stylesheet" href="css/normalize.css" type="text/css" >
<link rel="stylesheet" href="css/layout.css" type="text/css" >
<link rel="stylesheet" href="css/styles-default.css" type="text/css" />
<!-- Put your page name here -->
<title>Code Checker</title>
<style>
textarea{
width: 100%;
}
select{
width: 100%;
height: 30px;
background: white;
}
</style>
</head>
<body>
<!-- For those fancy full bleed background images
Add the filename in styles-default.css line 76 -->
<div class="fullsize-bg"></div>
<!-- This is the parent wrapper -->
<div class="all-content">
<header>
<h3 class="text-sans text-red">Think you may have unclosed tags?</h3>
</header>
<hr>
<!-- == 2 COLUMN HALVES =============================================== -->
<div class="row">
<div class="portion half">
<h4 class="text-sans margin-bottom-1x">Paste your code in here</h4>
<textarea name="code" id="code" cols="30" rows="10" class="text-mono text-tiny bg-dark text-teal padding-top-1x padding-right-1x padding-bottom-1x padding-left-1x"></textarea>
<h4 class="text-sans margin-bottom-1x">Which tags are we checking?</h4>
<form>
<select name="all-tags" id="all-tags">
<optgroup label="Popular tags">
<option value="a"><a></option>
<option value="article"><article></option>
<option value="button"><button></option>
<option value="div"><div></option>
<option value="em"><em></option>
<option value="footer"><footer></option>
<option value="form"><form></option>
<option value="h1"><h1></option>
<option value="h2"><h2></option>
<option value="h3"><h3></option>
<option value="label"><label></option>
<option value="li"><li></option>
<option value="nav"><nav></option>
<option value="p"><p></option>
<option value="span"><span></option>
<option value="script"><script></option>
<option value="section"><section></option>
<option value="strong"><strong></option>
<option value="ul"><ul></option>
</optgroup>
<optgroup label="Reclusive tags">
<option value="a"><a></option>
<option value="abbr"><abbr></option>
<option value="article"><article></option>
<option value="address"><address></option>
<option value="aside"><aside></option>
<option value="audio"><audio></option>
<option value="b"><b></option>
<option value="bdi"><bdi></option>
<option value="bdo"><bdo></option>
<option value="blockquote"><blockquote></option>
<option value="body"><body></option>
<option value="button"><button></option>
<option value="canvas"><canvas></option>
<option value="caption"><caption></option>
<option value="cite"><cite></option>
<option value="code"><code></option>
<option value="datalist"><datalist></option>
<option value="dd"><dd></option>
<option value="del"><del></option>
<option value="details"><details></option>
<option value="dfn"><dfn></option>
<option value="dialog"><dialog></option>
<option value="div"><div></option>
<option value="dl"><dl></option>
<option value="dt"><dt></option>
<option value="em"><em></option>
<option value="fieldset"><fieldset></option>
<option value="figcaption"><figcaption></option>
<option value="figure"><figure></option>
<option value="footer"><footer></option>
<option value="form"><form></option>
<option value="h1"><h1></option>
<option value="h2"><h2></option>
<option value="head"><head></option>
<option value="header"><header></option>
<option value="html"><html></option>
<option value="i"><i></option>
<option value="iframe"><iframe></option>
<option value="ins"><ins></option>
<option value="kbd"><kbd></option>
<option value="label"><label></option>
<option value="legend"><legend></option>
<option value="map"><map></option>
<option value="mark"><mark></option>
<option value="menu"><menu></option>
<option value="menuItem"><menuItem></option>
<option value="meter"><meter></option>
<option value="nav"><nav></option>
<option value="noscript"><noscript></option>
<option value="object"><object></option>
<option value="ol"><ol></option>
<option value="optgroup"><optgroup></option>
<option value="option"><option></option>
<option value="output"><output></option>
<option value="p"><p></option>
<option value="picture"><picture></option>
<option value="pre"><pre></option>
<option value="progress"><progress></option>
<option value="q"><q></option>
<option value="s"><s></option>
<option value="samp"><samp></option>
<option value="script"><script></option>
<option value="section"><section></option>
<option value="select"><select></option>
<option value="small"><small></option>
<option value="strong"><strong></option>
<option value="style"><style></option>
<option value="sub"><sub></option>
<option value="table"><table></option>
<option value="tbody"><tbody></option>
<option value="td"><td></option>
<option value="textarea"><textarea></option>
<option value="tfoot"><tfoot></option>
<option value="th"><th></option>
<option value="thead"><thead></option>
<option value="time"><time></option>
<option value="tr"><tr></option>
<option value="u"><u></option>
<option value="ul"><ul></option>
<option value="var"><var></option>
<option value="video"><video></option>
</optgroup>
</select>
</form>
<p class="text-center">
<a href="#" class="check-code-button button bg-blue shape-rounded">Check your code</a>
</p>
</div>
<div class="portion half">
<h4 class="text-sans margin-bottom-1x">Here's what we found</h4>
<p class="open-tags-count">Opening <strong class="tag-type"></strong> tags: <strong class="tag-count"></strong></p>
<p class="close-tags-count">Closing <strong class="tag-type"></strong> tags: <strong class="tag-count"></strong></p>
</ul>
<div class="success-message bg-green shape-rounded" style="display: none;">
<p class="padding-top-2x padding-bottom-2x padding-left-2x padding-right-2x text-white text-sans">Woo hoo, you have no unclosed <strong class="tag-type"></strong> tags</p>
</div>
<div class="error-message bg-red shape-rounded" style="display: none;">
<p class="padding-top-2x padding-bottom-2x padding-left-2x padding-right-2x text-white text-sans">Uh oh, looks like you have unclosed <strong class="tag-type"></strong> tags</p>
</div>
</div>
</div>
<hr>
<!-- == FOOTER ======================================================== -->
<footer>
<div class="row">
<p class="text-center text-tiny margin-top-3x">
I hope this little app, helped ease your day of troublesome developing.
</p>
</div>
</footer>
</div> <!-- all-content div ends here -->
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<script>
$('.check-code-button').on('click', function(){
var code = $('#code').val();
var tag = $('#all-tags').val();
var openTags = code.split('<' + tag).length-1;
var closeTags = code.split('</' + tag).length-1;
$('.tag-type').text('<' + tag + '>');
$('.open-tags-count .tag-count').text(openTags);
$('.close-tags-count .tag-count').text(closeTags);
if (openTags === closeTags) {
$('.success-message').show();
$('.error-message').hide();
} else{
$('.success-message').hide();
$('.error-message').show();
}
});
</script>
</body>