File size: 1,997 Bytes
aa8ea94
fcc0ba1
 
 
aa8ea94
fcc0ba1
 
 
 
 
 
 
 
 
 
 
 
aa8ea94
 
fcc0ba1
aa8ea94
 
fcc0ba1
aa8ea94
 
 
fcc0ba1
 
 
 
aa8ea94
 
fcc0ba1
aa8ea94
fcc0ba1
aa8ea94
fcc0ba1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aa8ea94
 
fcc0ba1
 
 
 
 
 
 
 
 
aa8ea94
 
fcc0ba1
 
 
 
 
aa8ea94
 
 
fcc0ba1
 
 
 
 
aa8ea94
fcc0ba1
 
 
 
 
 
aa8ea94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fcc0ba1
aa8ea94
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fcc0ba1
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
122
123
124
125
126
/* General Styles */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: linear-gradient(to bottom, #1a1a1a, #333);
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
  overflow: hidden;
}

#game-container {
  text-align: center;
}

#play-button {
  padding: 12px 25px;
  font-size: 18px;
  cursor: pointer;
  background: #00aaff;
  color: white;
  border: none;
  border-radius: 8px;
  box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.3);
  margin-bottom: 15px;
}

#game-area {
  position: relative;
  width: 900px;
  height: 600px;
  background: #1e1e1e;
  border: 3px solid #fff;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

/* Squares */
.square {
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 5px;
}

.yellow { background-color: yellow; }
.blue { background-color: blue; }
.red { background-color: red; }
.green { background-color: green; }

/* Finish Line */
#finish-line {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 30px;
  background: #00ff00;
  border-top: 3px solid #fff;
}

/* Obstacles */
.obstacle {
  position: absolute;
  background: #ff5555;
  border-radius: 8px;
}

#obstacle-1 {
  width: 150px;
  height: 20px;
  top: 120px;
  left: 150px;
  transform: rotate(15deg);
}

#obstacle-2 {
  width: 200px;
  height: 20px;
  top: 250px;
  left: 400px;
}

#obstacle-3 {
  width: 100px;
  height: 20px;
  top: 50px;
  left: 600px;
  transform: rotate(-45deg);
}

#obstacle-4 {
  width: 100px;
  height: 20px;
  top: 400px;
  left: 300px;
  animation: move-horizontal 3s infinite alternate;
}

#obstacle-5 {
  width: 150px;
  height: 20px;
  top: 100px;
  left: 700px;
  animation: move-vertical 4s infinite alternate;
}

/* Animations */
@keyframes move-horizontal {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(150px);
  }
}

@keyframes move-vertical {
  from {
    transform: translateY(0);
  }
  to {
    transform: translateY(150px);
  }
}