-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
95 lines (84 loc) · 3.46 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
90
91
92
93
94
95
<!doctype html>
<html lang="en" class="h-full">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="assets/styles/styles.css" />
</head>
<body class="h-full bg-white dark:bg-gray-800">
<div class="flex h-full flex-col overflow-auto">
<div class="sticky top-0 bg-lime-600 py-3">
<div class="container">
<div class="flex items-center justify-between">
<div class="flex shrink-0 uppercase text-white">logo</div>
<ul class="flex gap-x-4">
<li>
<a class="text-white transition-colors duration-200 ease-in hover:text-black" href="javascript:;">
Home
</a>
</li>
<li>
<a class="text-white transition-colors duration-200 ease-in hover:text-black" href="javascript:;">
About
</a>
</li>
<li>
<a class="text-white transition-colors duration-200 ease-in hover:text-black" href="javascript:;">
Services
</a>
</li>
<li>
<a class="text-white transition-colors duration-200 ease-in hover:text-black" href="javascript:;">
Contact
</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<h1 class="mb-5 text-4xl text-black dark:text-white">Lorem ipsum dolor, sit amet.</h1>
<button class="app-c-btn app-c-btn--primary switch-theme">Switch theme</button>
<button class="app-c-btn app-c-btn--secondary">Button</button>
<div class="flex flex-col gap-x-8 md:flex-row">
<aside class="order-2 mt-5 w-1/4 flex-shrink-0 bg-yellow-300 md:order-1">Sidebar</aside>
<section class="order-1 mt-5 w-full bg-red-400 md:order-2">Content</section>
</div>
<div class="mt-5 grid gap-4 md:grid-cols-2 lg:grid-cols-3">
<div class="rounded-md bg-blue-400 p-3">1</div>
<div class="rounded-md bg-blue-400 p-3">2</div>
<div class="rounded-md bg-blue-400 p-3">3</div>
<div class="rounded-md bg-blue-400 p-3">4</div>
<div class="rounded-md bg-blue-400 p-3">5</div>
<div class="rounded-md bg-blue-400 p-3">6</div>
</div>
</div>
<div class="mt-auto">
<div class="bg-slate-500 py-3">
<div class="container">
<div class="flex items-center justify-between">
<div class="flex shrink-0 uppercase text-white">logo</div>
<p class="text-white">© 2023.</p>
</div>
</div>
</div>
</div>
</div>
<script>
const isDarkSet = localStorage.theme === "dark";
const isThemeStored = "theme" in localStorage;
const isDarkPrefered = window.matchMedia("(prefers-color-scheme: dark)").matches;
if (isDarkSet || (!isThemeStored && isDarkPrefered)) {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
const themeSwitch = document.querySelector(".switch-theme");
themeSwitch.addEventListener("click", () => {
document.documentElement.classList.toggle("dark");
localStorage.theme = localStorage.theme === "dark" ? "light" : "dark";
});
</script>
</body>
</html>