-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
451 lines (381 loc) · 11.8 KB
/
index.html
File metadata and controls
451 lines (381 loc) · 11.8 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
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:type" content="website" />
<meta name="description" content="Code on the IndGeek playground" />
<meta name="keywords" content="code, code indgeek">
<meta name="author" content="IndGeek">
<meta property="og:image" content="/assets/logos/code.indgeek.com.jpg" />
<link rel="shortcut icon" type="image/png" href="/assets/logos/code.indgeek-favicon.png">
<title>HTML Editor online</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/css/bootstrap.min.css"
integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
</head>
<body>
<!-- JQuery -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.0/dist/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<!-- CSS Style -->
<style type="text/css">
* {
background-color: rgb(19, 23, 31);
}
br {
display: none;
}
textarea {
display: block;
width: 100%;
border: 1px solid #333;
font-family: monospace, Verdana, Geneva, Tahoma, sans-serif;
}
iframe {
display: block;
margin: 10px 0;
width: 100%;
resize: both;
overflow: auto;
border: 1px solid #333;
}
#code-here {
border: 1px solid grey;
border-left: 4px solid rgb(114, 190, 0);
padding: 10px;
color: white;
max-width: 97.6%;
height: 45vh;
}
#code-here:focus {
outline: none;
}
#compile {
color: rgb(235, 235, 235);
background-color: rgb(114, 190, 0);
border: none;
border-radius: 4px;
padding: 5px 10px;
cursor: pointer;
font-family: 'poppins', Verdana, Geneva, Tahoma, sans-serif
}
#compile:hover {
color: rgb(67, 67, 67);
}
#myframe {
border: 1px solid grey;
border-radius: 2px;
max-width: 99%;
height: 40vh;
}
.txt-area {
padding: 10px 0;
}
.navbar {
padding: 8px 15px;
}
.navbar-nav li a {
color: white;
font-family: 'poppins', Verdana, Geneva, Tahoma, sans-serif
}
.navbar-nav li a:hover {
color: rgb(114, 190, 0);
}
.main {
padding: 8px 15px;
}
.btn-web {
background-color: rgb(114, 190, 0);
border: none;
border-radius: 4px;
padding: 5px 20px;
color: white !important;
margin-left: 10px;
}
.btn-web:hover {
color: rgb(67, 67, 67) !important;
}
.justify-content-end {
position: absolute;
right: 4%;
}
.copy-code {
padding: 5px 0 0 5px;
cursor: pointer;
}
/* toast notification */
#cooltoast-container {
background-color: transparent;
color:white;
position: fixed;
bottom: 0;
right: 0;
width: auto;
/* font-family: 'Helvetica'; */
}
.cooltoast-toast {
position: relative;
padding: 8px 12px;
margin: 16px;
border-radius: 8px;
background: #F5F5F5;
cursor: pointer;
box-shadow: 0 1px 6px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.19);
animation-duration: .3s;
animation-name: cooltoast;
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
}
.cooltoast-fadeOut {
animation-name: cooltoastFadeOut;
animation-duration: .3s;
animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
animation-fill-mode: forwards;
}
#cooltoast-container p,
#cooltoast-container h4 {
margin: 3px 0!important;
}
.cooltoast-title {
background-color: #F5F5F5 !important;
color:#333;
font-weight: 700;
font-size: 15px;
margin-bottom: 10px;
}
.cooltoast-icon {
position: absolute;
top: 5px;
left: -40px;
width: 50px;
height: 50px;
border-radius: 100%;
background: #FFF;
}
.cooltoast-toast a, .cooltoast-toast a:hover {
color: #549EDB !important;
text-decoration: none !important;
}
/** toast types */
.cooltoast-success {
border-bottom: 2px solid #51C625;
}
@keyframes cooltoast {
from {
transform: translate3d(400px, 0, 0);;
opacity: 0;
}
to {
transform: translate3d(0, 0, 0);
opacity: 1;
}
}
@keyframes cooltoastFadeOut {
from {
transform: translate3d(0, 0, 0);
opacity: 1;
}
to {
transform: translate3d(400px, 0, 0);
opacity: 0;
}
}
@media screen and (max-width:992px) {
#copy-mob{
z-index: 9999;
position: fixed;
left:10px;
bottom:10px;
padding:5px;
border:2px solid green;
border-radius:50px;
}
}
@media screen and (min-width:992px) {
#copy-mob{
display: none;
}
}
</style>
<!-- JavaScript -->
<script type="text/javascript">
function updateIframe() {
var myFrame = $("#myframe").contents().find('body');
var textareaValue = $("textarea").val();
myFrame.html(textareaValue);
myFrame.css('color', 'white');
}
</script>
<!-- Copy the snippet -->
<script>
function showNotification(){
console.log('works')
toast.create({
title: 'Code Copied',
});
};
(function(root, factory) {
try {
// commonjs
if (typeof exports === 'object') {
module.exports = factory();
// global
} else {
root.toast = factory();
}
} catch(error) {
console.log('Isomorphic compatibility is not supported at this time for toast.')
}
})(this, function() {
// We need DOM to be ready
if (document.readyState === 'complete') {
init();
} else {
window.addEventListener('DOMContentLoaded', init);
}
// Create toast object
toast = {
// In case toast creation is attempted before dom has finished loading!
create: function() {
console.error([
'DOM has not finished loading.',
'\tInvoke create method when DOM\s readyState is complete'
].join('\n'))
}
};
var autoincrement = 0;
// Initialize library
function init() {
// Toast container
var container = document.createElement('div');
container.id = 'cooltoast-container';
document.body.appendChild(container);
// @Override
// Replace create method when DOM has finished loading
toast.create = function(options) {
var toast = document.createElement('div');
toast.id = ++autoincrement;
toast.id = 'toast-' + toast.id;
toast.className = 'cooltoast-toast';
// title
if (options.title) {
var h4 = document.createElement('h4');
h4.className = 'cooltoast-title';
h4.innerHTML = options.title;
toast.appendChild(h4);
}
// text
if (options.text) {
var p = document.createElement('p');
p.className = 'cooltoast-text';
p.innerHTML = options.text;
toast.appendChild(p);
}
// icon
if (options.icon) {
var img = document.createElement('img');
img.src = options.icon;
img.className = 'cooltoast-icon';
toast.appendChild(img);
}
// click callback
if (typeof options.callback === 'function') {
toast.addEventListener('click', options.callback);
}
// toast api
toast.hide = function() {
toast.className += ' cooltoast-fadeOut';
toast.addEventListener('animationend', removeToast, false);
};
// auto hide
if (options.timeout) {
setTimeout(toast.hide, options.timeout);
}
// else setTimeout(toast.hide, 2000);
if (options.type) {
toast.className += ' cooltoast-' + options.type;
}
toast.addEventListener('click', toast.hide);
function removeToast() {
document.getElementById('cooltoast-container').removeChild(toast);
}
document.getElementById('cooltoast-container').appendChild(toast);
return toast;
}
}
return toast;
});
function copyCode(){
console.log('okay func');
var toWrite = document.getElementById("code-here").select();
document.execCommand('copy');
showNotification()
document.getElementById("code-here").blur();
};
</script>
<div class="header">
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand" href="/">
<img src="./assets/logos/code.indgeek-logo.png" style="user-select: none; user-drag: none;
-webkit-user-drag: none;" height="30" alt="">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavDropdown"
aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
<ul class="navbar-nav">
<li class="nav-item active">
<a class="nav-link" href="https://indgeek.com" target="_blank">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://indgeek.com/?s=code" target="_blank">Tutorials</a>
</li>
<li class="nav-item">
<a class="nav-link" href="https://indgeek.com/forum/" target="_blank">Forum</a>
</li>
<li class="nav-item copy-code" id="copy" title="Copy this code" onclick="copyCode()">
<svg width="22" height="22" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path data-name="copy-Filled"
d="M11 19.5h5.7A3.978 3.978 0 0 1 13 22H6a4 4 0 0 1-4-4v-8a4.007 4.007 0 0 1 3.5-3.97V14a5.51 5.51 0 0 0 5.5 5.5Zm8.5-13.25h2.12a1.638 1.638 0 0 0-.21-.25L18 2.59a1.156 1.156 0 0 0-.25-.2V4.5a1.758 1.758 0 0 0 1.75 1.75Zm0 1.5a3.256 3.256 0 0 1-3.25-3.25V2H11a4 4 0 0 0-4 4v8a4 4 0 0 0 4 4h7a4 4 0 0 0 4-4V7.75Z"
style="fill:white" />
</svg>
</li>
<li class="nav-item justify-content-end">
<a class="nav-link btn-web" href="https://turbohosty.com/wordpress-service" target="_blank">Get your
website</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="main">
<span class="span-1">
<div class="txt-area">
<textarea id="code-here" rows="5" cols="50" placeholder="Type HTML Code Here" autofocus spellcheck=”false”>
<style>
h3, p{
color:rgb(143, 232, 0);
font-family: Verdana, Tahoma, sans-serif;
}
</style>
<h3>Edit HTML Content</h3>
<p>Welcome to IndGeek Coding Playground</p>
</textarea>
</div>
<button id="compile" style="border:1" type="button" onclick="updateIframe()">Run The
Code</button>
</span>
<span class="span-2">
<iframe id="myframe"></iframe>
</span>
</div>
<span class="copy-code-mob" id="copy-mob" title="Copy this code" onclick="copyCode()">
<svg width="22" height="22" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path data-name="copy-Filled"
d="M11 19.5h5.7A3.978 3.978 0 0 1 13 22H6a4 4 0 0 1-4-4v-8a4.007 4.007 0 0 1 3.5-3.97V14a5.51 5.51 0 0 0 5.5 5.5Zm8.5-13.25h2.12a1.638 1.638 0 0 0-.21-.25L18 2.59a1.156 1.156 0 0 0-.25-.2V4.5a1.758 1.758 0 0 0 1.75 1.75Zm0 1.5a3.256 3.256 0 0 1-3.25-3.25V2H11a4 4 0 0 0-4 4v8a4 4 0 0 0 4 4h7a4 4 0 0 0 4-4V7.75Z"
style="fill:white" />
</svg>
</span>
</body>
</html>