forked from you-dont-need/You-Dont-Need-JavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbulb.html
60 lines (54 loc) · 1.17 KB
/
bulb.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Light Bulb Animation</title>
<style>
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: #000;
margin: 0;
}
.box {
position: relative;
width: 100px;
height: 100px;
background: #ffeb3b;
border-radius: 50%;
box-shadow: 0 0 50px #ffeb3b;
transition: box-shadow 0.5s, background 0.5s;
}
.box span {
position: absolute;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
background: #000;
border-radius: 50%;
transform: translate(-50%, -50%);
}
input[type="checkbox"] {
display: none;
}
input[type="checkbox"]:checked + .box {
background: #555;
box-shadow: 0 0 10px #555;
}
</style>
</head>
<body>
<label>
<input type="checkbox">
<div class="box">
<span></span>
</div>
</label>
</body>
</html>