-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
89 lines (89 loc) · 2.56 KB
/
index.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
<!DOCTYPE html>
<html lang="en" class="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Qemcs's Home Page</title>
<link rel="icon" href="data:;base64,=">
<style>
html {
height: 100%;
background: #f4f4f4;
}
body {
max-width: 800px;
margin: 0 auto;
min-height: 100%;
padding: 0 2em;
background: white;
}
.light-btn, .dark-btn {
text-decoration: underline;
cursor: pointer;
color: blue;
}
html.light {
background: #f4f4f4;
}
html.light body {
background: white;
}
html.dark {
background: #242525;
color: #bab6af;
}
html.dark body {
background: #2B2C2C;
}
html.dark a {
color: #3b76bb;
}
</style>
<script>
let $ = function() {
return document.querySelector(...arguments)
}
let config = localStorage.getItem('config')
try {
config = JSON.parse(config) || {}
} catch (e) {
config = {}
}
window.onload = () => {
if (config && config.theme) {
if (config.theme === 'dark') {
$('html').className = 'dark'
}
}
$('.light-btn').addEventListener('click', () => {
$('html').className = config.theme = 'light'
localStorage.setItem('config', JSON.stringify(config))
})
$('.dark-btn').addEventListener('click', () => {
$('html').className = config.theme = 'dark'
localStorage.setItem('config', JSON.stringify(config))
})
}
</script>
</head>
<body>
<div>
[<a class="light-btn">Light</a>] [<a class="dark-btn">Dark</a>]
<div style="float: right;">
<a href="https://qemcs.com">https://qemcs.com</a>
</div>
</div>
<h2>News</h2>
<p>I will update my profile once i have some achievement.</p>
<h2>About</h2>
<p>
<a href="https://github.com/zhylmzr">Github:</a>
there has some my source code.
</p>
<hr>
<p>If you have any questions or suggestions, write to Gmail of <em>zhylmzr</em>.</p>
<hr>
<div class="time" style="font-size: 10px;">last update: May 29, 2020</div>
</body>
</html>