-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
167 lines (150 loc) · 4.57 KB
/
index.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="en">
<!--Adding a comment to commit a change-->
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="style.css">
<style>
/* Add custom styles for improved aesthetics */
* {
box-sizing: border-box;
margin: 0;
padding: 0;
color: black;
}
body {
margin: 0;
padding: 0;
font-family: 'Press Start 2P', sans-serif;
background-color: #000;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
/* Add retro-style font */
@import url('https://fonts.googleapis.com/css?family=Press+Start+2P&display=swap');
.game-container {
position: relative;
width: 400px;
height: 400px;
background-color: #000;
border: 2px solid #fff;
box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
background-image: linear-gradient(45deg, #444 25%, transparent 25%, transparent 50%, #444 50%, #444 75%, transparent 75%, transparent);
background-size: 20px 20px;
}
/* Style for the paddle */
.paddle {
position: absolute;
bottom: 10px;
width: 100px;
height: 10px;
background-color: #fff;
border-radius: 5px;
}
/* Style for the ball */
.ball {
position: absolute;
width: 20px;
height: 20px;
background-color: #fff;
border-radius: 50%;
box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}
/* Style for the bricks */
.brick {
position: absolute;
width: 70px;
height: 20px;
background-color: #ff6600;
border-radius: 5px;
}
/* Retro-style title */
.title-container {
text-align: center;
margin-bottom: 20px;
border-color: teal;
border-style: solid;
border-width: 1.5px;
padding-left: 20px;
padding-top: 20px;
padding-bottom: 20px;
padding-right: 20px;
box-shadow: 0 0 25px -.15px teal;
}
.title {
font-size: 2rem;
color: #ff6600;
text-transform: uppercase;
}
/* Retro-style start button */
.start-button {
margin-top: 1.5rem;
padding: 10px 20px;
font-size: 1rem;
background-color: #ff6600;
color: #fff;
border: none;
cursor: pointer;
transition: background-color 0.3s;
border-radius: 50px;
transition: all .35s ease;
}
.start-button:hover {
background-color: #cc5500;
transform: translateY(-3px);
box-shadow: 0px 0px 25px -0.3px rgb(164, 163, 163);
color: white;
}
/* Score display */
.score {
text-align: center;
font-size: 1.5rem;
margin-top: 20px;
margin-left: 20px;
}
/* You Lose screen */
.lose-screen {
display: none;
flex-direction: column;
align-items: center;
text-align: center;
}
.lose-screen h1 {
font-size: 2rem;
color: #ff6600;
text-transform: uppercase;
}
.lose-screen p {
font-size: 1rem;
color: #fff;
margin-top: 10px;
}
#finalScore {
font-size: 1rem;
color: #fff;
margin-top: 10px;
}
</style>
<title>Brick Breaker Game</title>
</head>
<body>
<div class="title-container" id="titleScreen">
<h1 class="title">Brick Breaker Game</h1>
<button class="start-button" id="startButton">Start Game</button>
</div>
<div class="game-container" id="gameContainer" style="display: none;">
<canvas id="gameCanvas" width="400" height="400"></canvas>
</div>
<div class="score" id="score">Score: 0</div>
<div class="lose-screen" id="loseScreen">
<h1 class="title">You Lose!</h1>
<p>Your final score: <span id="finalScore">0</span></p>
<button class="start-button" id="restartButton">Restart</button>
</div>
<script src="script.js"></script>
</body>
</html>