Skip to content

Commit 5b8e902

Browse files
committed
Ad styles and keyframes
1 parent eb4e711 commit 5b8e902

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

Source-Code/JumpGame/style.css

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
* {
2+
padding: 0;
3+
margin: 0;
4+
overflow: hidden;
5+
text-align: center;
6+
background-color: blue;
7+
}
8+
9+
.game {
10+
top: 40px;
11+
width: 500px;
12+
height: 200px;
13+
border: 1px solid black;
14+
margin: 10% auto;
15+
background-color: aqua;
16+
}
17+
18+
h2 {
19+
text-align: center;
20+
font-family: Arial, Helvetica, sans-serif;
21+
color: rgb(0, 247, 255);
22+
text-shadow: 3px 2px rgb(128, 0, 0);
23+
font-size: 5em;
24+
}
25+
26+
p {
27+
color: white;
28+
font-size: 20px;
29+
}
30+
31+
#character {
32+
width: 30px;
33+
height: 50px;
34+
background-color: red;
35+
position: relative;
36+
top: 150px;
37+
border-radius: 70%;
38+
}
39+
40+
.animate {
41+
animation: jump 0.3s linear;
42+
}
43+
44+
@keyframes jump {
45+
0% {
46+
top: 150px;
47+
}
48+
30% {
49+
top: 100px;
50+
}
51+
70% {
52+
top: 100px;
53+
}
54+
100% {
55+
top: 150px;
56+
}
57+
}
58+
59+
#block {
60+
background-color: blue;
61+
width: 20px;
62+
height: 20px;
63+
position: relative;
64+
top: 130px;
65+
left: 500px;
66+
animation: block 1s infinite linear;
67+
}
68+
69+
#block2 {
70+
background-color: orange;
71+
width: 20px;
72+
height: 20px;
73+
position: relative;
74+
top: 30px;
75+
left: 500px;
76+
}
77+
78+
.animate1 {
79+
animation: blocke 1.5s infinite linear;
80+
}
81+
82+
@keyframes blocke {
83+
0% {
84+
left: 500px;
85+
}
86+
100% {
87+
left: -20px;
88+
}
89+
}
90+
91+
@keyframes block {
92+
0% {
93+
left: 500px;
94+
}
95+
100% {
96+
left: -20px;
97+
}
98+
}
99+
p {
100+
text-align: center;
101+
}
102+
#co {
103+
margin-bottom: 10px;
104+
font-weight: bold;
105+
}
106+
.animate2 {
107+
animation: pa 1s ease-in-out;
108+
}
109+
.show {
110+
opacity: 0;
111+
}

0 commit comments

Comments
 (0)