-
Notifications
You must be signed in to change notification settings - Fork 0
/
newton pendolumn.html
121 lines (118 loc) · 2.03 KB
/
newton pendolumn.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
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!DOCTYPE html>
<html>
<head>
<title>Newto Pendulom</title>
<style type="text/css">
*{
margin: 0;
padding: 0;
box-sizing: border-box;
}
html{
font-size: 62.5%;
}
.main_div{
width: 100vw;
height: 100vh;
background-color: skyblue;
display: grid;
place-items: center;
}
.center_div{
width: 60%;
height: 60%;
border: 0.5rem double gold;
border-bottom: 5rem solid blue;
display: flex;
justify-content: center;
animation: bg 5s linear infinite;
border-radius: 1rem;
}
.center_div::before{
content: 'Newton Cradle Made By Naik_G';
color: #fff;
font-size: 2rem;
letter-spacing: .5rem;
top: 75%;
position: absolute;
}
.center_div span{
width: 0.5rem;
height: 70%;
background-color: brown;
display: block;
margin: 0 2.75rem;
position: relative;
border-radius: 30%;
transform-origin: top;
}
span::before{
content: '';
width: 6rem;
height: 6rem;
border-radius: 50%;
background-color: black;
position: absolute;
bottom: -10%;
transform: translateX(-50%);
}
span:first-child{
animation: ball 2s linear infinite;
}
@keyframes ball{
0%{
transform: rotate(0deg);
}
20%{
transform: rotate(50deg);
}
50%{
transform: rotate(0deg);
}
100%{
transform: rotate(0deg);
}
}
span:last-child{
animation: yball 2s linear 1s infinite;
}
@keyframes yball{
0%{
transform: rotate(0deg);
}
20%{
transform: rotate(-50deg);
}
50%{
transform: rotate(0deg);
}
100%{
transform: rotate(0deg);
}
}
@keyframes bg{
0%{
background-color: orange;
}
50%{
background-color: white;
}
100%{
background-color: green;
}
}
</style>
</head>
<body>
<div class="main_div">
<div class="center_div">
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
<span></span>
</div>
</div>
</body>
</html>