-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.htm
538 lines (403 loc) · 17 KB
/
index.htm
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
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, user-scalable=yes">
<link rel="stylesheet" type="text/css" href="https://raw.githubusercontent.com/Dorson/LTS-flex-css-style-theme-generator/master/LTS-flex-theme.css">
<link rel="stylesheet" type="text/css" href="./LTS-flex-theme.css">
<script>
/*
-+++++ JavaScript CSS Class Switch function for websites and HTML apps. +++-
--- Original author :: Nik K. linkedin.com/in/nik--k---/ ( 4.Feb 2020).
--- Code adoption :: YourName (date).
--- License :: GNU General Public License v 3.0.
--- Latest version :: github.com/Dorson/CSS-Dark-Mode-and-color-switch
*/
window.onerror = null ;
/*
During load time, we remember the saved CSS classes from localStorage
Only works with HTML Tags that are already loaded before the script run !
Optimally the HTML tag. Works for the first Tag of it's type only !
*/
document.addEventListener( 'DOMContentLoaded' , function() {
RememberClasses() ;
});
function RememberClasses() {
const ClassMemory = [
["html" , "ColorMode"] ,
["html" , "TextSize"]
] ;
for ( let [ Tag , MemoryName ] of ClassMemory ) {
let TagNotAlive = !(document.querySelector( Tag )) ;
let MemoryValue = window.localStorage.getItem( MemoryName ) ;
/* On logic Errors we skip one loop. */
if ( !MemoryValue || TagNotAlive ) {
continue ;
}
/* Else we remember and set CSS classes. */
else {
document.querySelector( Tag ).classList.add( MemoryValue );
}
}
}
/* In the dark, IF ColorMode was NOT set, and the hour is between 20:00 and 7:00 */
document.addEventListener("DOMContentLoaded", AfterDark() , true ) ;
function AfterDark() {
let hour = new Date().getHours() ;
let ColorWasSet = localStorage.getItem( "ColorMode" ) ;
let DarkWasSet = document.querySelector("html").classList.contains("dark") ;
if ( ( hour >= 20 || hour < 7 ) && !( ColorWasSet || DarkWasSet ) )
{
document.querySelector("html").classList.add( "dark" ) ;
}
}
/* CSS class Toggle Switch. ON,OFF CSS class + remember in localStorage memory. */
function ClassSwitch( TagName, ClassName, MemoryName ) {
/* We use const variables to avoid logic errors, if their values change during process. */
const ClassWasActive = document.querySelector( TagName ).classList.contains( ClassName ) ;
const OldMemory = window.localStorage.getItem( MemoryName ) ;
/* If class is New and NOT-active. We remove possible OldMemory class.
Deep Clean memory cell. Activate and remember new CSS class in clean memory.
*/
if ( !ClassWasActive && ( OldMemory !== ClassName ) ) {
if ( OldMemory ) {
document.querySelector( TagName ).classList.remove( OldMemory ) ;
window.localStorage.removeItem( MemoryName ) ;
}
document.querySelector( TagName ).classList.add( ClassName ) ;
window.localStorage.setItem( MemoryName , ClassName ) ;
}
/* Else CSS class was already active OR the switch memory was not clean.
We toggle given class. Remove possible OldMemory class. Deep Clean memory cell.
*/
else {
document.querySelector( TagName ).classList.toggle( ClassName ) ;
if ( OldMemory ) {
document.querySelector( TagName ).classList.remove( OldMemory ) ;
window.localStorage.removeItem( MemoryName ) ;
}
}
return false ;
}
/*
Dual Flip CSS class Toggle Switch. Set THis OR the OTher CSS class.
Flips or changes CSS class between two given options.
If Class1 was NOT active: We switch it ON. Else: we flip switch Class2 ON.
Only one can exist at the same time ! Class1 will always be switched on first !
*/
function DualFlipClassSwitch( TagName , Class1 , Class2 , MemoryName ) {
const ClassWasActive = document.querySelector( TagName ).classList.contains( Class1 ) ;
if ( !ClassWasActive ) { ClassSwitch( TagName , Class1 , MemoryName ) ; }
else { ClassSwitch( TagName , Class2 , MemoryName ) ; }
return false ;
}
</script>
<title>The LTS FLex CSS Style Theme + CSS themplate generator.</title>
</head>
<body>
<div style="margin: 0rem 0px 5px 0px; width:99%; display:block;">
<b style="font: 3rem/3.5rem bold sans ;"> LOGO </b>
/ ☰ MENU / Top Links / Seach Box / Login.
</div>
<h1>The LTS FLex CSS Style Theme + CSS themplate generator.</h1>
<p>
This is the examle page of the universal LTS Flex CSS style theme.
Use this page as a test for how the theme looks on different screens.
</p>
<p>
Style examples will change, if the CSS settings are changed !
Play with the settings for fun and work.
</p>
<h3>The Rem Size units are used here.</h3>
<style>
.ruler-box {width:3.5rem;font:0.6rem/0.9rem Roboto, sans;
border:0px;border-collapse:collapse;white-space: normal;color:#222;text-align:right;background:#fee;float:left;}
.ruler-box div{margin:0px;padding:0px;height:1rem;border:0px;}
.ruler-box .alt{background:#E1EEF4; color:#888;}
</style>
<div class="ruler-box">
Ruler<br />Box<br />1 Cell<br />=<br />1rem<br />
<div class="alt">1</div><div>2</div><div class="alt">3</div><div>4</div><div class="alt">5</div><div>6</div><div class="alt">7</div><div>8</div><div class="alt">9</div><div>10</div>
</div>
<p>
1 rem = the size of font or text letter that was set in the root element.
The "rem" value = Root Element Value.
This size unit is global for all the HTML elements inside of the root element.
In the case of the HTML or the body element, the rem unit of size can be
considered a global variable for setting size of text or margin amounts.
It's a very useful size unit setting that can be used to make websites
to be more flexible on all possible screen sizes as long as we set the
font size in percentage of the default browser value !!!!
</p>
<p>
If 16px is the default text size in the browser setting.
Then for example: Font 115% of 16px = 17-20 px = 1rem.
Rem is a flexible size unit that respects the user screen settings.
It's not a fixed unit, but a browser calculated one, as long as we do
use percentage size for font size of the html or body root element.
</p>
<h3> Dark mode color switch. </h3>
<p>
The dark website colors are good for the people who see websites in dark rooms.
Or at night. Good for the sleep patterns of humans and their tired eyes at night.
</p>
<p>
The default white color of the backgorund is set at 99% white, insted of
100% white light. It is better for the eyes, instead of looking into
the white screen light like insects.
</p>
<p>
Dark Mode Theme:
<a title="Lights ON, OFF."
href="javascript:void(0);"
onclick="DualFlipClassSwitch('html' , 'dark' , 'snow-white' , 'ColorMode');"
>
🌓 ⇄ 💡
</a>
Or as a button:
<button title="Lights ON, OFF."
onclick="DualFlipClassSwitch('html' , 'dark' , 'snow-white' , 'ColorMode');"
>
Dark 🌓 ⇄ ☼ </button>
</p>
<p>
<b>We load large scripts and larger elements at the bottom </b> of the document,
so that title and text come first. The people visit pages for the content,
text, images, audio or video, not for the menue of the website :-)
</p>
<h2>Standard HTML Table for testing.</h2>
<style type="text/css">
.grid-table {
border: 2px dotted #218171 ;
display: flex ; justify-content: center ;
align-content: center ; border-collapse: separate;
border-spacing: 0.5rem ;
}
.grid-table td {border: 1px dotted #218171 ; }
</style>
<table class="grid-table">
<tr>
<th colspan="3">
<h1> Title Size h1 in Test Table Header.</h1>
Text outside paragraph = NO element p.
</th>
</tr>
<tr>
<td>
<h1> Title Size h1 in Table Header.</h1>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
<p>Text inside paragraph = WITH element p.</p>
<h1> Title Size h1 in Table Header.</h1>
<p>Text inside paragraph = WITH element p.</p>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
</td>
<td>
<h2> Title Size h2 in Table Header.</h2>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
<p>Text inside paragraph = WITH element p.</p>
<h2> Title Size h2 in Table Header.</h2>
<p>Text inside paragraph = WITH element p.</p>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
</td>
<td>
<h3> Title Size h3 in Table Header.</h3>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
<p>Text inside paragraph = WITH element p.</p>
<h3> Title Size h3 in Table Header.</h3>
<p>Text inside paragraph = WITH element p.</p>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
</td>
</tr>
<tr>
<td>
<h4> Title Size h4 in Table Header.</h4>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
<p>Text inside paragraph = WITH element p.</p>
<h4> Title Size h4 in Table Header.</h4>
<p>Text inside paragraph = WITH element p.</p>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
</td>
<td>
<h5> Title Size h5 in Table Header.</h5>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
<p>Text inside paragraph = WITH element p.</p>
<h5> Title Size h5 in Table Header.</h5>
<p>Text inside paragraph = WITH element p.</p>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
</td>
<td>
<h6> Title Size h6 in Table Header.</h6>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
<p>Text inside paragraph = WITH element p.</p>
<h6> Title Size h6 in Table Header.</h6>
<p>Text inside paragraph = WITH element p.</p>
Text outside paragraph = NO element p.
Text outside paragraph = NO element p.
</td>
</tr>
</table>
<h3>Standard HTML submit form test.</h3>
<form action="javascript:alert(
'It works. You selected: '
+document.getElementById('input_str_1').value + ' '
+document.getElementById('input_str_2').value + ' is '
+document.getElementById('selector_1').value + ' who said : '
+document.getElementById('text_1').value
)
;">
<h2>Title h2 inside form test.</h2>
<label for="input_str_1">Name</label>
<input type="text" id="input_str_1" name="firstname" placeholder="Your name..">
<label for="input_str_2">Family Name</label>
<input type="text" id="input_str_2" name="lastname" placeholder="Your family name..">
<fieldset >
<legend> Age </legend>
<label> Baby </label>
<input type="checkbox">
<label> Child </label>
<input type="checkbox">
<label> Retired </label>
<input type="checkbox">
<label> Color of pants </label>
<input type="color" value="#96ee36">
<label> Can cook ? </label>
<input type="radio">
<label> Speed level </label>
<input type="range">
</fieldset>
<label for="selector_1">Drop down List</label>
<select id="selector_1" name="selector_1">
<option value="Human">Human</option>
<option value="Animal Pet">Animal Pet</option>
<option value="Galactic visitor">Galactic visitor</option>
</select>
<textarea rows="10" cols="40" id="text_1">
Sample text area for testing. Type some text in here...
</textarea>
<input type="submit" value="Button Test">
</form>
<style>
.search-box {
background-color: #f1f1f1 ; color: #111 ; opacity: 0.7 ; overflow: hidden ;
padding: 0.1rem 0.5rem ; margin: 1px ; text-align: right ;
position: fixed ; top: 1px ; right: 2.5rem ; width : 10rem ; height: 1.9rem ;
z-index: 10 ;
font: bold 1rem/1.1rem sans ; border-radius: 1rem ; border: 0px ;
}
.search-box:hover , .search-box:active {
background: #edf5f7 ; color: #111 ; opacity: 1 ;
padding: 0.7rem ; margin: 1px ; text-align: right ;
position: fixed ; top: 1px ; right: 2.5rem ; width : 70% ; height: auto ;
z-index: 10 ;
font: bold 1rem/1.1rem sans ; border-radius: 1rem ; border: 0px ;
box-shadow:9px 9px 20px #bbb;z-index:250; overflow: visible ;
}
.search-box:hover .invisible-on-hover , .search-box:active .invisible-on-hover { display: none ; }
.search-box .visible-on-hover { visibility: hidden ; }
.search-box:hover .visible-on-hover, .search-box:active .visible-on-hover { visibility: visible ; }
</style>
<div title=" Top Search Box " class="search-box" >
<div title=" fake input box " class="invisible-on-hover"
style=" background: #efefef ; color: #111 ;
padding: 0.1rem 0.5rem ; margin: 1px ; text-align: left ;
position: inline ; width : 5rem ; height : 1.4rem ; float : left ;
font: bold 0.9rem/1rem sans ; border-radius: 0.7rem ; border: 0.111rem solid #00B4CC; "
>
...
</div>
<div alt="search icon " class="invisible-on-hover"
style=" background: #34b8e5 ; color: #000 ; opacity: 1 ;
padding: 0.111rem ; margin: 1px ; text-align: center ; text-shadow: 1px 1px 0.3rem #fff;
position: inline ; width : 3rem ; height : 1.5rem ; white-space: nowrap; float : right ;
font: bold 1rem/1.3rem sans ; border-radius: 0.6rem ; border: 0px; "
>
🔍
</div>
<div class="visible-on-hover" >
<input type="text" placeholder="Search..." title=" fake input box "
style=" background: #efefef ; color: #111 ;
padding: 0.1rem 0.5rem ; margin: 1px ; text-align: left ;
position: inline ; width : 60% ; height : 2rem ; clear : none ; float : right ;
font: bold 0.9rem/1rem sans ; border-radius: 0.7rem ; border: 0.111rem solid #00B4CC; "
>
<div type="submit" alt="fake search icon "
style=" background: #34b8e5 ; color: #000 ; opacity: 1 ;
padding: 0.111rem ; margin: 1px ; text-align: center ; text-shadow: 1px 1px 0.3rem #fff;
position: inline ; width : 4rem ; height : 2rem ; clear: none ; float : right ;
font: bold 1.5rem/1.9rem sans ; border-radius: 0.8rem ; border: 0px; "
>
🔍
</div>
</div>
</div>
<div class="docker">
<div alt="docker icon bar"
style=" background: #f1f1f1 ; opacity:0.7 ; color: #222 ;
padding: 0.1rem 0.6rem ; margin: 1px ;
position: sticky ; top: 1px ; left: 1px ;
font: bold 1.7rem/3rem sans ; border-radius: 0.3rem ; border: 0px ; " >
<b> ☰ ♡ ☼ ⚙ ⇡ </b>
</div>
<br />
<b> ⏻ On / Off Color : </b> <br />
<button onclick="DualFlipClassSwitch('html' , 'snow-white' , 'dark' , 'ColorMode');" >
<b style="font-size:1.2rem; background-color: #ddd ; color:#fff;"> ❅ </b>
</button>
<button onclick="DualFlipClassSwitch('html' , 'dark' , 'snow-white' , 'ColorMode');" >
<b style="font-size:1.2rem; background-color: #1a1414 ; color:#d1d1d1;"> 🌓 </b>
</button>
<button onclick="ClassSwitch('html' , 'purple' , 'ColorMode');" >
<b style="font-size:1.2rem; background-color: #120b24 ; color: #724fc9 ;"> 💜 </b>
</button>
<button onclick="ClassSwitch('html' , 'green' , 'ColorMode');" >
<b style="font-size:1.2rem; background-color: #072813 ; color: #26d968 ;"> 🍏 </b>
</button>
<button onclick="ClassSwitch('html' , 'blue' , 'ColorMode');" >
<b style="font-size:1.2rem; background-color: #001830 ; color: #0080ff ;"> 🌊 </b>
</button>
<p> Be happy. Talk with people.</p>
<a href="" onclick="window.open('https://twitter.com/share?url='+encodeURIComponent(location.href),'_blank','toolbar=0,location=0,status=0,width=600,height=500,left=50,top=40');return false;"> <b>🐦 </b> Share on Twitter </a>
<p>
<a href="" onclick="window.open('https://www.linkedin.com/shareArticle?mini=true&url='+encodeURIComponent(location.href),'_blank','toolbar=0,location=0,status=0,width=600,height=500,left=50,top=40');return false;"> <b> ㏑</b> Share on Linked-in</a>
</p>
<a href="" onclick="window.open('https://www.facebook.com/share.php?u='+encodeURIComponent(location.href),'_blank','toolbar=0,location=0,status=0,width=600,height=500,left=50,top=40');return false;"> <b> FB </b> Share on Facebook </a>
<p><b> Thank you for sharing !</b></p>
</div>
<div title=" Top-right Night-Mode dual Flip Switch. "
style=" background: rgba(229, 229, 229, 0.5) ; color: #111 ;
padding: 1px ; margin: 1px ; width : 1.5rem ;
position: fixed ; top: 6rem ; right: 0.45rem ;
z-index: 15 ; text-align: center ; word-wrap: break-word ;
font: bold 1rem/1.1rem sans ; border-radius: 1rem ; border: 0px ; "
>
<a title=" Lights ON, OFF. "
href="javascript:void(0);" onclick="DualFlipClassSwitch('html' , 'dark' , 'snow-white' , 'ColorMode');"
style=" color: #111 ; padding: 0.4em 0.1em ; margin: 1px ; text-decoration: none ; float: right ; "
>
🌓<br />
⇄<br />
💡
</a>
</div>
<!--
-++ LTS Flex CSS Theme websites and HTML apps. +++-
--- Original author :: Nik K. linkedin.com/in/nik--k---/ ( 4.Feb 2020).
--- Code adoption :: YourName (date).
--- License :: GNU General Public License v 3.0.
--- Latest version :: github.com/Dorson/LTS-flex-css-style-theme-generator
-->
<!-- final div and dot to force clean short pages -->
<div style="clear:both;">.</div>
</body>
</html>