File tree Expand file tree Collapse file tree 1 file changed +47
-5
lines changed Expand file tree Collapse file tree 1 file changed +47
-5
lines changed Original file line number Diff line number Diff line change 1
-
2
1
<!DOCTYPE html>
3
2
< html lang ="en ">
4
3
< head >
7
6
< link rel ="stylesheet " href ="style.css ">
8
7
< meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
9
8
< 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 >
10
49
</ head >
11
50
12
51
< 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 >
16
58
</ body >
17
59
18
- </ html >
60
+ </ html >
You can’t perform that action at this time.
0 commit comments