-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
72 lines (66 loc) · 2.15 KB
/
test.html
File metadata and controls
72 lines (66 loc) · 2.15 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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tool Name | tools.eliana.lol</title>
<link rel="stylesheet" href="global.css" />
<link rel="icon" type="image/x-icon" href="favicon.svg" />
</head>
<body>
<nav>
<div class="left">
<a href="index.html">home</a> | <a href="extra.html">extra</a> |
<a href="credits.html">credits</a> |
<a href="changelog.html">logs</a>
</div>
<div class="right">
<button id="theme-toggle">[theme]</button> |
<a href="https://eliana.lol">site</a>
</div>
</nav>
<main>
<h1>Tool Name</h1>
<p class="puny">Replace this description with what your tool does.</p>
<div id="tool-content">
<textarea id="input" rows="10" placeholder="Input..."></textarea>
<button id="run-btn">Run Tool</button>
<textarea
id="output"
rows="10"
readonly
placeholder="Output..."
></textarea>
</div>
</main>
<script>
const html = document.documentElement;
const toggle = document.getElementById('theme-toggle');
// Set initial theme
const saved =
localStorage.getItem('theme') ||
(window.matchMedia('(prefers-color-scheme: dark)').matches
? 'dark'
: 'light');
html.setAttribute('data-theme', saved);
if (toggle) toggle.innerText = saved === 'dark' ? '[light]' : '[dark]';
// Toggle function
if (toggle) {
toggle.onclick = () => {
const now = html.getAttribute('data-theme');
const next = now === 'dark' ? 'light' : 'dark';
html.setAttribute('data-theme', next);
localStorage.setItem('theme', next);
toggle.innerText = next === 'dark' ? '[light]' : '[dark]';
};
}
</script>
<script>
// Example logic:
document.getElementById('run-btn').onclick = () => {
const val = document.getElementById('input').value;
document.getElementById('output').value = val.trim();
};
</script>
</body>
</html>