Skip to content

Commit 8c8a83d

Browse files
authored
Update bulb.html
1 parent 89f2e7c commit 8c8a83d

File tree

1 file changed

+47
-5
lines changed

1 file changed

+47
-5
lines changed

Light Bulb Animation/bulb.html

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
<!DOCTYPE html>
32
<html lang="en">
43
<head>
@@ -7,12 +6,55 @@
76
<link rel="stylesheet" href="style.css">
87
<meta name="viewport" content="width=device-width, initial-scale=1.0">
98
<title>Light Bulb Animation</title>
9+
<style>
10+
body {
11+
display: flex;
12+
justify-content: center;
13+
align-items: center;
14+
height: 100vh;
15+
background-color: #000;
16+
margin: 0;
17+
}
18+
19+
.box {
20+
position: relative;
21+
width: 100px;
22+
height: 100px;
23+
background: #ffeb3b;
24+
border-radius: 50%;
25+
box-shadow: 0 0 50px #ffeb3b;
26+
transition: box-shadow 0.5s, background 0.5s;
27+
}
28+
29+
.box span {
30+
position: absolute;
31+
top: 50%;
32+
left: 50%;
33+
width: 20px;
34+
height: 20px;
35+
background: #000;
36+
border-radius: 50%;
37+
transform: translate(-50%, -50%);
38+
}
39+
40+
input[type="checkbox"] {
41+
display: none;
42+
}
43+
44+
input[type="checkbox"]:checked + .box {
45+
background: #555;
46+
box-shadow: 0 0 10px #555;
47+
}
48+
</style>
1049
</head>
1150

1251
<body>
13-
<div class="box">
14-
<span></span>
15-
</div>
52+
<label>
53+
<input type="checkbox">
54+
<div class="box">
55+
<span></span>
56+
</div>
57+
</label>
1658
</body>
1759

18-
</html>
60+
</html>

0 commit comments

Comments
 (0)