-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstyle.css
More file actions
113 lines (102 loc) · 2.59 KB
/
style.css
File metadata and controls
113 lines (102 loc) · 2.59 KB
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
/* General Body Styles */
body {
margin: 0;
background-color: black;
overflow: hidden; /* Hide scrollbars */
font-family: 'Arial', sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh; /* Full viewport height */
}
/* Container for the Game Canvas and UI */
#gameContainer {
position: relative; /* For absolute positioning of UI */
border: 2px solid white;
width: 404px; /* Canvas width + 2 * border width */
height: 454px; /* Canvas height + 2 * border width */
}
/* Canvas Styles */
canvas {
background-color: black;
display: block; /* Remove any extra spacing below canvas */
}
/* UI Element Styles */
#ui {
position: absolute;
top: 10px;
left: 10px;
color: white;
font-size: 16px;
display: flex;
flex-direction: column; /* Stack score, lives, message vertically */
}
#score,
#lives,
#message {
margin-bottom: 5px;
text-shadow: 1px 1px 2px black; /* Add a subtle shadow for readability */
}
/* Start Menu Styles */
#startMenu {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%); /* Center the menu */
background-color: rgba(0, 0, 0, 0.8); /* Semi-transparent background */
color: white;
padding: 20px;
border: 2px solid white;
text-align: center;
z-index: 10; /* Ensure it's on top */
border-radius: 5px; /* Rounded corners */
box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Subtle shadow */
}
#startMenu h1 {
margin-top: 0;
text-shadow: 2px 2px 4px black;
}
#startMenu button {
background-color: white;
color: black;
border: none;
padding: 10px 20px;
font-size: 18px;
cursor: pointer;
margin-top: 15px;
border-radius: 5px;
transition: background-color 0.3s ease; /* Smooth transition on hover */
}
#startMenu button:hover {
background-color: #ddd; /* Lighter background on hover */
}
/* Game Over Message (Example - customize as needed) */
#message button {
background-color: #f44336;
color: white;
border: none;
padding: 10px 20px;
font-size: 16px;
cursor: pointer;
margin-top: 10px;
border-radius: 5px;
transition: background-color 0.3s ease;
}
#message button:hover {
background-color: #da190b;
}
/* Optional: Media Query for Smaller Screens (Basic Responsiveness) */
@media (max-width: 600px) {
#gameContainer {
width: 95%; /* Take up more width on smaller screens */
max-width: 404px; /* But don't exceed original size */
height: auto; /* Adjust height automatically */
}
canvas {
width: 100%; /* Canvas fills the gameContainer */
height: auto;
}
#ui {
font-size: 14px; /* Smaller font for UI on smaller screens */
}
}