forked from xvvvyz/tilde
-
Notifications
You must be signed in to change notification settings - Fork 0
/
newindex.html
796 lines (683 loc) · 28.7 KB
/
newindex.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
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
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
<!doctype html>
<meta charset="utf-8" />
<meta name="color-scheme" content="dark light" />
<meta name="robots" content="noindex" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<title>~</title>
<script>
document.addEventListener('DOMContentLoaded', function() {
function updateLinks(isLocal) {
COMMANDS.forEach((value, key) => {
try {
const url = new URL(value.url);
if (isLocal && url.hostname === 'ams') {
url.hostname = '192.168.1.9';
} else if (!isLocal && url.hostname === '192.168.1.9') {
url.hostname = 'ams';
}
value.url = url.toString();
console.log(`Updated command ${key}: ${value.url}`);
} catch (e) {
console.error(`Error updating URL for command ${key}:`, e);
}
});
}
function isLocalNetwork() {
fetch('https://api.ipify.org?format=json')
.then(response => response.json())
.then(data => {
const publicIP = data.ip;
console.log('Detected public IP:', publicIP);
// Resolve a.088899.xyz to get the current public IP
fetch('https://dns.google/resolve?name=a.088899.xyz&type=A')
.then(response => response.json())
.then(dnsData => {
const domainIP = dnsData.Answer[0].data;
console.log('Resolved domain IP:', domainIP);
const isLocal = publicIP === domainIP;
console.log('Is local network:', isLocal);
updateLinks(isLocal);
// Reinitialize the commands component to apply the updated URLs
document.querySelector('commands-component').initialize();
})
.catch(error => {
console.error('Error resolving domain IP:', error);
});
})
.catch(error => {
console.error('Error detecting public IP:', error);
});
}
isLocalNetwork();
});
class Commands extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
this.initialize();
}
initialize() {
const template = document.getElementById('commands-template');
const clone = template.content.cloneNode(true);
const commands = clone.querySelector('.commands');
const commandTemplate = document.getElementById('command-template');
for (const [key, { name, url }] of COMMANDS.entries()) {
if (!name || !url) continue;
const clone = commandTemplate.content.cloneNode(true);
const command = clone.querySelector('.command');
command.href = url;
if (CONFIG.openLinksInNewTab) command.target = '_blank';
clone.querySelector('.key').innerText = key;
clone.querySelector('.name').innerText = name;
commands.append(clone);
}
this.shadowRoot.innerHTML = ''; // Clear the shadow DOM before appending
this.shadowRoot.append(clone);
}
}
customElements.define('commands-component', Commands);
</script>
<style>
:root {
/* --border-radius: 20rem; */
--color-background: #000000;
/* 888 before */
--color-text-subtle: #ffffff;
--color-text: #b40000;
--font-family: -apple-system, Helvetica, sans-serif;
--font-size: clamp(16px, 1.6vw, 18px);
--font-weight-bold: 700;
--font-weight-normal: 400;
--space: .8rem;
--transition-speed: 200ms;
}
/* @media (prefers-color-scheme: light) {
:root {
--color-background: #383838;
--color-text-subtle: #ffffff;
--color-text: #ffffff;
}
} */
</style>
<script>
const CONFIG = {
commandPathDelimiter: '/',
commandSearchDelimiter: ' ',
defaultSearchTemplate: 'https://www.google.com/search?q={}',
openLinksInNewTab: false,
suggestionLimit: 4,
};
const COMMANDS = new Map([
['a', { name: 'Plex', url: 'https://app.plex.tv/desktop/' }],
['b', { name: 'Sonarr', url: 'https://sonarr.088899.xyz' }],
['c', { name: 'Radarr', url: 'https://radarr.088899.xyz' }],
['i', { name: 'Transmission', url: 'https://tr.088899.xyz' }],
['f', { name: 'Metube', url: 'https://mt.088899.xyz' }],
['g', { name: 'Jackett', url: 'https://jkt.088899.xyz' }],
['h', { name: 'DNS', url: 'http://ams:8000' }],
['d', { name: 'Twitch', url: 'https://twitch.tv' }],
['j', { name: 'Twitter', url: 'https://x.com' }],
['k', { name: 'Gmail', url: 'https://gmail.com/' }],
[
's',
{
name: 'YouTube',
searchTemplate: '/results?search_query={}',
url: 'https://youtube.com/',
},
],
[
'q',
{
name: 'Most used',
searchTemplate: ':{}',
suggestions: ['web.whatsapp.com', 'anilist.co', 'discord.com/app'],
url: 'http://localhost:3000',
},
],
]);
</script>
<template id="commands-template">
<style>
.commands {
border-radius: var(--border-radius);
column-gap: 0;
columns: 1;
list-style: none;
margin: 0 auto;
max-width: 10rem;
overflow: hidden;
padding: 0;
width: 100vw;
}
.command {
display: flex;
gap: var(--space);
outline: 0;
padding: var(--space);
position: relative;
text-decoration: none;
}
.command::after {
content: ' ';
inset: 1px;
opacity: 0.05;
position: absolute;
transition: opacity var(--transition-speed);
}
.command:where(:focus, :hover)::after {
opacity: 0.1;
}
.key {
color: var(--color-text);
display: inline-block;
text-align: center;
width: 3ch;
}
.name {
color: var(--color-text-subtle);
transition: color var(--transition-speed);
}
.command:where(:focus, :hover) .name {
color: var(--color-text);
}
@media (min-width: 500px) {
.commands {
columns: 2;
max-width: 25rem;
}
}
@media (min-width: 900px) {
.commands {
columns: 4;
max-width: 45rem;
}
}
</style>
<nav>
<menu class="commands"></menu>
</nav>
</template>
<template id="command-template">
<li>
<a class="command" rel="noopener noreferrer">
<span class="key"></span>
<span class="name"></span>
</a>
</li>
</template>
<script type="module">
class Commands extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
const template = document.getElementById('commands-template');
const clone = template.content.cloneNode(true);
const commands = clone.querySelector('.commands');
const commandTemplate = document.getElementById('command-template');
for (const [key, { name, url }] of COMMANDS.entries()) {
if (!name || !url) continue;
const clone = commandTemplate.content.cloneNode(true);
const command = clone.querySelector('.command');
command.href = url;
if (CONFIG.openLinksInNewTab) command.target = '_blank';
clone.querySelector('.key').innerText = key;
clone.querySelector('.name').innerText = name;
commands.append(clone);
}
this.shadowRoot.append(clone);
}
}
customElements.define('commands-component', Commands);
</script>
<template id="search-template">
<style>
input,
button {
-moz-appearance: none;
-webkit-appearance: none;
background: transparent;
border: 0;
display: block;
outline: 0;
}
.dialog {
align-items: center;
background: var(--color-background);
border: none;
display: none;
flex-direction: column;
height: 100%;
justify-content: center;
left: 0;
padding: 0;
top: 0;
width: 100%;
}
.dialog[open] {
display: flex;
}
.form {
width: 100%;
}
.input {
color: var(--color-text);
font-size: 3rem;
font-weight: var(--font-weight-bold);
padding: 0;
text-align: center;
width: 100%;
}
.suggestions {
align-items: center;
display: flex;
flex-direction: column;
flex-wrap: wrap;
justify-content: center;
list-style: none;
margin: var(--space) 0 0;
overflow: hidden;
padding: 0;
}
.suggestion {
color: var(--color-text);
cursor: pointer;
font-size: 1rem;
padding: var(--space);
position: relative;
transition: color var(--transition-speed);
white-space: nowrap;
z-index: 1;
}
.suggestion:where(:focus, :hover) {
color: var(--color-background);
}
.suggestion::before {
background-color: var(--color-text);
border-radius: calc(var(--border-radius) / 5);
content: ' ';
inset: calc(var(--space) / 1.5) calc(var(--space) / 3);
opacity: 0;
position: absolute;
transform: translateY(0.5em);
transition: all var(--transition-speed);
z-index: -1;
}
.suggestion:where(:focus, :hover)::before {
opacity: 1;
transform: translateY(0);
}
.match {
color: var(--color-text-subtle);
transition: color var(--transition-speed);
}
.suggestion:where(:focus, :hover) .match {
color: var(--color-background);
}
@media (min-width: 700px) {
.suggestions {
flex-direction: row;
}
}
</style>
<dialog class="dialog">
<form autocomplete="off" class="form" method="dialog" spellcheck="false">
<input class="input" title="search" type="text" />
<menu class="suggestions"></menu>
</form>
</dialog>
</template>
<template id="suggestion-template">
<li>
<button class="suggestion" type="button"></button>
</li>
</template>
<template id="match-template">
<span class="match"></span>
</template>
<script type="module">
class Search extends HTMLElement {
#dialog;
#form;
#input;
#suggestions;
constructor() {
super();
this.attachShadow({ mode: 'open' });
const template = document.getElementById('search-template');
const clone = template.content.cloneNode(true);
this.#dialog = clone.querySelector('.dialog');
this.#form = clone.querySelector('.form');
this.#input = clone.querySelector('.input');
this.#suggestions = clone.querySelector('.suggestions');
this.#form.addEventListener('submit', this.#onSubmit, false);
this.#input.addEventListener('input', this.#onInput);
this.#suggestions.addEventListener('click', this.#onSuggestionClick);
document.addEventListener('keydown', this.#onKeydown);
this.shadowRoot.append(clone);
}
static #attachSearchPrefix(array, { key, splitBy }) {
if (!splitBy) return array;
return array.map((search) => `${key}${splitBy}${search}`);
}
static #escapeRegexCharacters(s) {
return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
}
static #fetchDuckDuckGoSuggestions(search) {
return new Promise((resolve) => {
window.autocompleteCallback = (res) => {
const suggestions = [];
for (const item of res) {
if (item.phrase === search.toLowerCase()) continue;
suggestions.push(item.phrase);
}
resolve(suggestions);
};
const script = document.createElement('script');
document.querySelector('head').appendChild(script);
script.src = `https://duckduckgo.com/ac/?callback=autocompleteCallback&q=${search}`;
script.onload = script.remove;
});
}
static #formatSearchUrl(url, searchPath, search) {
if (!searchPath) return url;
const [baseUrl] = Search.#splitUrl(url);
const urlQuery = encodeURIComponent(search);
searchPath = searchPath.replace(/{}/g, urlQuery);
return baseUrl + searchPath;
}
static #hasProtocol(s) {
return /^[a-zA-Z]+:\/\//i.test(s);
}
static #isUrl(s) {
return /^((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?)$/i.test(s);
}
static #parseQuery = (raw) => {
const query = raw.trim();
if (this.#isUrl(query)) {
const url = this.#hasProtocol(query) ? query : `https://${query}`;
return { query, url };
}
if (COMMANDS.has(query)) {
const { command, key, url } = COMMANDS.get(query);
return command ? Search.#parseQuery(command) : { key, query, url };
}
let splitBy = CONFIG.commandSearchDelimiter;
const [searchKey, rawSearch] = query.split(new RegExp(`${splitBy}(.*)`));
if (COMMANDS.has(searchKey)) {
const { searchTemplate, url: base } = COMMANDS.get(searchKey);
const search = rawSearch.trim();
const url = Search.#formatSearchUrl(base, searchTemplate, search);
return { key: searchKey, query, search, splitBy, url };
}
splitBy = CONFIG.commandPathDelimiter;
const [pathKey, path] = query.split(new RegExp(`${splitBy}(.*)`));
if (COMMANDS.has(pathKey)) {
const { url: base } = COMMANDS.get(pathKey);
const [baseUrl] = Search.#splitUrl(base);
const url = `${baseUrl}/${path}`;
return { key: pathKey, path, query, splitBy, url };
}
const [baseUrl, rest] = Search.#splitUrl(CONFIG.defaultSearchTemplate);
const url = Search.#formatSearchUrl(baseUrl, rest, query);
return { query, search: query, url };
};
static #splitUrl(url) {
const parser = document.createElement('a');
parser.href = url;
const baseUrl = `${parser.protocol}//${parser.hostname}`;
const rest = `${parser.pathname}${parser.search}`;
return [baseUrl, rest];
}
#close() {
this.#input.value = '';
this.#input.blur();
this.#dialog.close();
this.#suggestions.innerHTML = '';
}
#execute(query) {
const { url } = Search.#parseQuery(query);
const target = CONFIG.openLinksInNewTab ? '_blank' : '_self';
window.open(url, target, 'noopener noreferrer');
this.#close();
}
#focusNextSuggestion(previous = false) {
const active = this.shadowRoot.activeElement;
let nextIndex;
if (active.dataset.index) {
const activeIndex = Number(active.dataset.index);
nextIndex = previous ? activeIndex - 1 : activeIndex + 1;
} else {
nextIndex = previous ? this.#suggestions.childElementCount - 1 : 0;
}
const next = this.#suggestions.children[nextIndex];
if (next) next.querySelector('.suggestion').focus();
else this.#input.focus();
}
#onInput = async () => {
const oq = Search.#parseQuery(this.#input.value);
if (!oq.query) {
this.#close();
return;
}
let suggestions = COMMANDS.get(oq.query)?.suggestions ?? [];
if (oq.search && suggestions.length < CONFIG.suggestionLimit) {
const res = await Search.#fetchDuckDuckGoSuggestions(oq.search);
const formatted = Search.#attachSearchPrefix(res, oq);
suggestions = suggestions.concat(formatted);
}
const nq = Search.#parseQuery(this.#input.value);
if (nq.query !== oq.query) return;
this.#renderSuggestions(suggestions, oq.query);
};
#onKeydown = (e) => {
if (!this.#dialog.open) {
this.#dialog.show();
this.#input.focus();
requestAnimationFrame(() => {
// close the search dialog before the next repaint if a character is
// not produced (e.g. if you type shift, control, alt etc.)
if (!this.#input.value) this.#close();
});
return;
}
if (e.key === 'Escape') {
this.#close();
return;
}
const alt = e.altKey ? 'alt-' : '';
const ctrl = e.ctrlKey ? 'ctrl-' : '';
const meta = e.metaKey ? 'meta-' : '';
const shift = e.shiftKey ? 'shift-' : '';
const modifierPrefixedKey = `${alt}${ctrl}${meta}${shift}${e.key}`;
if (/^(ArrowDown|Tab|ctrl-n)$/.test(modifierPrefixedKey)) {
e.preventDefault();
this.#focusNextSuggestion();
return;
}
if (/^(ArrowUp|ctrl-p|shift-Tab)$/.test(modifierPrefixedKey)) {
e.preventDefault();
this.#focusNextSuggestion(true);
}
};
#onSubmit = () => {
this.#execute(this.#input.value);
};
#onSuggestionClick = (e) => {
const ref = e.target.closest('.suggestion');
if (!ref) return;
this.#execute(ref.dataset.suggestion);
};
#renderSuggestions(suggestions, query) {
this.#suggestions.innerHTML = '';
const sliced = suggestions.slice(0, CONFIG.suggestionLimit);
const template = document.getElementById('suggestion-template');
for (const [index, suggestion] of sliced.entries()) {
const clone = template.content.cloneNode(true);
const ref = clone.querySelector('.suggestion');
ref.dataset.index = index;
ref.dataset.suggestion = suggestion;
const escapedQuery = Search.#escapeRegexCharacters(query);
const matched = suggestion.match(new RegExp(escapedQuery, 'i'));
if (matched) {
const template = document.getElementById('match-template');
const clone = template.content.cloneNode(true);
const matchRef = clone.querySelector('.match');
const pre = suggestion.slice(0, matched.index);
const post = suggestion.slice(matched.index + matched[0].length);
matchRef.innerText = matched[0];
matchRef.insertAdjacentHTML('beforebegin', pre);
matchRef.insertAdjacentHTML('afterend', post);
ref.append(clone);
} else {
ref.innerText = suggestion;
}
this.#suggestions.append(clone);
}
}
}
customElements.define('search-component', Search);
</script>
<!-- <script>
window.onload = function () {
// List of famous quotes and authors
var quotesAndAuthors = [
{quote: "The only way to do great work is to love what you do.", author: "Steve Jobs"},
{quote: "Your time is limited, don't waste it living someone else's life.", author: "Steve Jobs"},
{quote: "Stay hungry, stay foolish.", author: "Steve Jobs"},
{quote: "Innovation distinguishes between a leader and a follower.", author: "Steve Jobs"},
{quote: "The greatest glory in living lies not in never falling, but in rising every time we fall.", author: "Nelson Mandela"},
{quote: "Education is the most powerful weapon which you can use to change the world.", author: "Nelson Mandela"},
{quote: "The only source of knowledge is experience.", author: "Albert Einstein"},
{quote: "Imagination is more important than knowledge.", author: "Albert Einstein"},
{quote: "Strive not to be a success, but rather to be of value.", author: "Albert Einstein"},
{quote: "If you can't explain it simply, you don't understand it well enough.", author: "Albert Einstein"},
{quote: "Success is not final, failure is not fatal: It is the courage to continue that counts.", author: "Winston Churchill"},
{quote: "The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.", author: "Winston Churchill"},
{quote: "We make a living by what we get, but we make a life by what we give.", author: "Winston Churchill"},
{quote: "The only thing we have to fear is fear itself.", author: "Franklin D. Roosevelt"},
{quote: "In the end, it's not the years in your life that count. It's the life in your years.", author: "Abraham Lincoln"},
{quote: "I have a dream that one day this nation will rise up and live out the true meaning of its creed: 'We hold these truths to be self-evident, that all men are created equal.'", author: "Martin Luther King Jr."},
{quote: "Darkness cannot drive out darkness: only light can do that. Hate cannot drive out hate: only love can do that.", author: "Martin Luther King Jr."},
{quote: "Ask not what your country can do for you; ask what you can do for your country.", author: "John F. Kennedy"},
{quote: "Forgive your enemies, but never forget their names.", author: "John F. Kennedy"},
{quote: "The only true wisdom is in knowing you know nothing.", author: "Socrates"},
{quote: "I am the wisest man alive, for I know one thing, and that is that I know nothing.", author: "Socrates"},
{quote: "To be yourself in a world that is constantly trying to make you something else is the greatest accomplishment.", author: "Ralph Waldo Emerson"},
{quote: "Do not go where the path may lead, go instead where there is no path and leave a trail.", author: "Ralph Waldo Emerson"},
{quote: "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe.", author: "Albert Einstein"},
{quote: "The best way to predict the future is to invent it.", author: "Alan Kay"},
{quote: "The only limit to our realization of tomorrow will be our doubts of today.", author: "Franklin D. Roosevelt"},
{quote: "The future belongs to those who believe in the beauty of their dreams.", author: "Eleanor Roosevelt"},
{quote: "You miss 100% of the shots you don't take.", author: "Wayne Gretzky"},
{quote: "Life is what happens when you're busy making other plans.", author: "John Lennon"},
{quote: "The journey of a thousand miles begins with one step.", author: "Lao Tzu"},
{quote: "Happiness is not something ready made. It comes from your own actions.", author: "Dalai Lama"},
{quote: "The only impossible journey is the one you never begin.", author: "Tony Robbins"},
{quote: "You are never too old to set another goal or to dream a new dream.", author: "C.S. Lewis"},
{quote: "It does not matter how slowly you go as long as you do not stop.", author: "Confucius"},
{quote: "It always seems impossible until it's done.", author: "Nelson Mandela"},
{quote: "Don't watch the clock; do what it does. Keep going.", author: "Sam Levenson"},
{quote: "Good, better, best. Never let it rest. 'Til your good is better and your better is best.", author: "St. Jerome"},
{quote: "The only way to achieve the impossible is to believe it is possible.", author: "Charles Kingsleigh"},
{quote: "Success is not the key to happiness. Happiness is the key to success. If you love what you are doing, you will be successful.", author: "Albert Schweitzer"},
{quote: "The best revenge is massive success.", author: "Frank Sinatra"},
{quote: "The only limit to our realization of tomorrow will be our doubts of today.", author: "Franklin D. Roosevelt"},
{quote: "The future belongs to those who believe in the beauty of their dreams.", author: "Eleanor Roosevelt"},
{quote: "You miss 100% of the shots you don't take.", author: "Wayne Gretzky"},
{quote: "Life is what happens when you're busy making other plans.", author: "John Lennon"},
{quote: "The journey of a thousand miles begins with one step.", author: "Lao Tzu"},
{quote: "Happiness is not something ready made. It comes from your own actions.", author: "Dalai Lama"},
{quote: "The only impossible journey is the one you never begin.", author: "Tony Robbins"},
{quote: "You are never too old to set another goal or to dream a new dream.", author: "C.S. Lewis"},
{quote: "It does not matter how slowly you go as long as you do not stop.", author: "Confucius"},
{quote: "It always seems impossible until it's done.", author: "Nelson Mandela"},
{quote: "Don't watch the clock; do what it does. Keep going.", author: "Sam Levenson"},
{quote: "Good, better, best. Never let it rest. 'Til your good is better and your better is best.", author: "St. Jerome"},
{quote: "The only way to achieve the impossible is to believe it is possible.", author: "Charles Kingsleigh"},
// Add more quotes and authors as needed
];
// Select a random quote and author
var randomIndex = Math.floor(Math.random() * quotesAndAuthors.length);
var randomQuote = quotesAndAuthors[randomIndex].quote;
var randomAuthor = quotesAndAuthors[randomIndex].author;
// Insert the random quote and author into their respective tags
document.getElementById('quote').innerHTML = randomQuote;
document.getElementById('author').innerHTML = "-" + randomAuthor;
}
</script> -->
<style>
html {
background-color: var(--color-background);
font-family: var(--font-family);
font-size: var(--font-size);
line-height: 1.4;
}
body {
margin: 0;
}
main {
align-items: center;
box-sizing: border-box;
display: flex;
justify-content: center;
min-height: 100vh;
overflow: hidden;
padding: calc(var(--space) * 4) var(--space);
position: relative;
width: 100vw;
}
#quotes {
opacity: 0.4;
top: 7rem;
color: var(--color-text-subtle);
display: flex;
z-index: -1;
flex-direction: column;
height: 10rem;
width: 100vw;
overflow: hidden;
position: absolute;
justify-content: center;
box-sizing: border-box;
align-items: center;
}
quote {
height: 4vw;
width: 25vw;
display: flex;
align-items: center;
}
author {
display: flex;
width: 25vw;
justify-content: left;
}
body {
}
bgelement {
position: absolute;
/* background-image: url('./bg.gif'); */
background-repeat: no-repeat;
/* background-size: cover; */
background-position: center;
z-index: -100;
height: 100vh;
width: 100vw;
filter: blur(0px);
background-color: rgb(0, 0, 0);
}
</style>
<!-- <div id="quotes">
<quote id="quote">Quote test</quote>
<author id="author">Sutcaz</author>
</div> -->
<bgelement></bgelement>
<main>
<commands-component></commands-component>
<search-component></search-component>
</main>
<script type="module" src="background.js"></script>
</body>
</html>