-
Notifications
You must be signed in to change notification settings - Fork 0
/
reading.html
68 lines (62 loc) · 2.07 KB
/
reading.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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<title>reading</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="style.css">
<header>
<div class="settings-list">
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
</div>
</div>
<nav>
<ul>
<li><a href="index.html">home</a></li>
<li><a href="images.html">articles</a></li>
</ul>
</nav>
</header>
</head>
<body>
<hr style="width: 50%;">
<h3 id="date"></h3>
<div class="primary-container">
<div class="article-container">
<h3>A journal of sorts</h3>
<p style="text-align: left;">█</p>
<h3>Talking to myself</h3>
<!--START OF DETAILS.-->
<details>
<summary>Twitter 09-04-22</summary>
<p>So lately, I got a twitter, and I'm not sure it's good for my mental health</p>
</details>
</div>
</div>
<script type="text/javascript" src=time.js></script>
<script>
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
const currentTheme = localStorage.getItem('theme');
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'dark') {
toggleSwitch.checked = true;
}
}
function switchTheme(e) {
if (e.target.checked) {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark');
}
else { document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light');
}
}
toggleSwitch.addEventListener('change', switchTheme, false);
</script>
</body>
</html>