-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathindex.html
More file actions
93 lines (93 loc) · 2.32 KB
/
Copy pathindex.html
File metadata and controls
93 lines (93 loc) · 2.32 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<html lang="en">
<head>
<meta charset="UTF-8">
<title>East dark mode</title>
<style>
body{
margin: 0;
padding: 0;
font-family: sans-serif;
}
main{
margin: 5vh 15%;
}
h1{
font-size: 40px;
font-weight: 400;
text-align: center;
}
img{
width:50%;
height:auto;
}
p{
text-align: justify;
font-size: 18px;
}
label{
position: absolute;
width: 45px;
height: 22px;
right: 20px;
top: 20px;
border: 2px solid;
border-radius: 20px;
}
label:before{
position: absolute;
content: '';
width:20px;
height: 20px;
left: 1px;
top: 1px;
border-radius: 50%;
background: #000;
cursor: pointer;
transition: 0.4s;
}
label.active:before{
left: 24px;
background: #fff;
}
body.night{
background: #000;
color: #fff;
}
@media screen and (min-width:900px) {
.respon{
display: flex;
}
img{
height:50%;
width:auto;
padding-top: 3vh;
padding-right: 5%;
}
p{
max-width: 80%;
line-height: 30px;
}
}
</style>
</head>
<body>
<header>
<label id="dark-change"></label>
</header>
<main>
<h1>Easy dark mode</h1>
<div class="respon">
<img src="darkmode.jpg">
<p>Light-on-dark color scheme, also called dark mode, dark theme or night mode, is a color scheme that uses light-colored text, icons, and graphical user interface elements on a dark background and is often discussed in terms of computer user interface design and web design.</p>
</div>
</main>
<script>
var content = document.getElementsByTagName('body')[0];
var darkMode = document.getElementById('dark-change');
darkMode.addEventListener('click', function(){
darkMode.classList.toggle('active');
content.classList.toggle('night');
})
</script>
</body>
</html>