-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdarmode.html
More file actions
42 lines (39 loc) · 1.1 KB
/
darmode.html
File metadata and controls
42 lines (39 loc) · 1.1 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<style>
body{
background-color: #ffffff;
color: #000000;
font-family: arial, sans-serif;
margin: 0;
padding: 20px;
transition: background-color 0.3s ease, color 0.3 ease;
}
button{
padding: 10px 20px;
cursor: pointer;
margin-bottom: 20px;
}
body.dark-mode{
background-color: #2c2c2c;
color: #f5f5f5;
}
button.dark-mode{
background-color: #444444;
color: #ffffff;
border: none;
}
</style>
</head>
<body>
<button id="mode-toggle">Toggle Dark Mode</button>
<h1>Welcome to the Light and Dark Mode Switcher</h1>
<p>This is a simple example demonstrating how to use localStroge to remember user prefences.</p>
<script src="./darmode.js"></script>
</body>
</html>