-
Notifications
You must be signed in to change notification settings - Fork 155
/
Copy pathstyle.css
59 lines (51 loc) · 967 Bytes
/
style.css
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
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: linear-gradient(dimgray, black);
}
.court {
width: 20em;
height: 20em;
border: 1em solid silver;
background-color: black;
border-radius: 1em;
position: relative;
}
.paddle {
width: 1em;
height: 9em;
background-color: white;
border-radius: 0.5em;
position: absolute;
top: 1em;
}
.paddle.left {left: 1em;}
.paddle.right {right: 1em;}
.ball {
width: 1em;
height: 1em;
background-color: red;
border-radius: 50%;
position: absolute;
left: 2em;
top: 8.5em;
}
.paddle,
.ball {
animation: 1s linear infinite alternate;
}
.paddle {animation-name: moving;}
.ball {animation-name: bounce;}
.paddle.right {animation-delay: -1s;}
@keyframes moving {
to {
transform: translateY(9em);
}
}
@keyframes bounce {
to {
transform: translateX(15em);
}
}