-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
299 lines (294 loc) · 10.9 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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>Earth Alliance</title>
<script src="https://telegram.org/js/telegram-web-app.js"></script>
<link rel="apple-touch-icon" sizes="57x57" href="/images/favicon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/images/favicon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/images/favicon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/images/favicon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/images/favicon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/images/favicon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/images/favicon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/images/favicon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/images/favicon-180x180.png">
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">
<link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="96x96" href="/images/favicon-96x96.png">
<link rel="icon" type="image/png" sizes="192x192" href="/images/favicon-192x192.png">
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="msapplication-TileImage" content="/images/favicon-144x144.png">
<meta name="msapplication-config" content="/browserconfig.xml">
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#ffffff">
<style>
body, html {
margin: 0;
padding: 0;
height: 100%;
font-family: Arial, sans-serif;
background-color: #000;
color: #fff;
overflow: hidden;
}
#startScreen {
position: relative;
width: 100%;
height: 100%;
background: url('images/space-background.jpg') no-repeat center center fixed;
background-size: cover;
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
}
.slide {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0;
transition: opacity 0.5s ease-in-out;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.slide.active {
opacity: 1;
}
.slide-content {
width: 90%;
max-width: 800px;
display: flex;
flex-direction: column;
align-items: center;
}
.slide-content img {
width: 100%;
max-height: 60vh; /* Уменьшено с 70vh */
object-fit: contain;
border-radius: 10px;
}
.slide-caption {
margin-top: 10px; /* Уменьшено с 20px */
font-size: 16px; /* Немного уменьшен размер шрифта */
text-align: center;
background-color: rgba(0, 0, 0, 0.7);
padding: 8px;
border-radius: 5px;
max-width: 80%;
}
#gameStartButton {
position: absolute;
bottom: 40px; /* Увеличено с 30px */
padding: 12px 25px; /* Немного уменьшены отступы */
font-size: 18px; /* Немного уменьшен размер шрифта */
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
z-index: 10;
}
#gameStartButton:hover {
background-color: #45a049;
}
#gameCanvas {
display: none;
z-index: 1000; /* Убедитесь, что это значение больше, чем у GIF */
}
.game-container {
position: relative;
width: 100%;
height: 100%;
}
#gameOverGif {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: none;
z-index: 999; /* Убедимся, что это значение меньше, чем у canvas */
}
.game-title {
font-size: 28px;
font-weight: bold;
text-align: center;
margin-top: 40px; /* Увелим это значение, чтобы опустить надпись */
padding-top: 20px; /* Отступ сверху */
text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
padding: 0 10px;
}
#settingsMenu {
display: none;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: rgba(0, 0, 0, 0.8);
padding: 20px;
border-radius: 10px;
z-index: 1001; /* Убедитесь, что это значение больше, чем у GIF */
}
.setting-group {
margin-bottom: 15px;
}
.setting-group label {
display: block;
margin-bottom: 5px;
color: white;
}
.setting-group select, .setting-group input {
width: 100%;
padding: 5px;
border-radius: 5px;
border: none;
}
#closeSettings {
display: block;
margin-top: 15px;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
#openSettings {
position: absolute;
top: 10px;
right: 10px;
padding: 10px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
z-index: 1001; /* Убедитесь, что это значение больше, чем у GIF */
}
#gameOverGif {
pointer-events: none;
}
@media (max-height: 600px) {
.game-title {
font-size: 24px;
margin-top: 10px;
}
.slide-content img {
max-height: 50vh;
}
.slide-caption {
font-size: 14px;
}
#gameStartButton {
bottom: 20px;
padding: 10px 20px;
font-size: 16px;
}
}
</style>
</head>
<body>
<div id="startScreen">
<div class="game-title">EARTH ALLIANCE</div>
<div class="slide active">
<div class="slide-content">
<img src="images/slide1.png" alt="Человечество в космосе">
<div class="slide-caption">2184 год. Человечество покорило звезды.</div>
</div>
</div>
<div class="slide">
<div class="slide-content">
<img src="images/slide2.png" alt="Угроза Зоргонов">
<div class="slide-caption">Древняя раса Зоргонов угрожает уничтожить Землю.</div>
</div>
</div>
<div class="slide">
<div class="slide-content">
<img src="images/slide3.png" alt="Элитный пилот">
<div class="slide-caption">Ты - элитный пилот. Твоя миссия - спасти человечество.</div>
</div>
</div>
<button id="gameStartButton">Начать игру</button>
</div>
<div class="game-container">
<canvas id="gameCanvas"></canvas>
<img id="gameOverGif" src="images/game-over-game.gif" alt="Game Over">
</div>
<audio id="introMusic" loop>
<source src="sounds/intromelody.mp3" type="audio/mpeg">
</audio>
<audio id="gameOverMusic">
<source src="sounds/gameovermelody.mp3" type="audio/mpeg">
</audio>
<audio id="shotSound">
<source src="sounds/shotsound.mp3" type="audio/mpeg">
</audio>
<audio id="fightSound">
<source src="sounds/fight.mp3" type="audio/mpeg">
</audio>
<audio id="holyShitSound">
<source src="sounds/holyshit.mp3" type="audio/mpeg">
</audio>
<audio id="humiliationSound">
<source src="sounds/humiliation.mp3" type="audio/mpeg">
</audio>
<audio id="invisibilitySound">
<source src="sounds/invisibility.mp3" type="audio/mpeg">
</audio>
<div id="settingsMenu">
<div class="setting-group">
<label for="shipSelect">Выберите корабль:</label>
<select id="shipSelect">
<option value="ship1">Корабль 1</option>
<option value="ship2">Корабль 2</option>
<option value="ship3">Корабль 3</option>
</select>
</div>
<div class="setting-group">
<label for="musicToggle">Музыка:</label>
<input type="checkbox" id="musicToggle" checked>
<label for="musicToggle">Включить/Выключить</label>
</div>
<button id="closeSettings">Закрыть настройки</button>
</div>
<button id="openSettings">Настройки</button>
<script>
let currentSlide = 0;
const slides = document.querySelectorAll('.slide');
const gameStartButton = document.getElementById('gameStartButton');
function showSlide(index) {
slides[currentSlide].classList.remove('active');
slides[index].classList.add('active');
currentSlide = index;
}
function nextSlide() {
if (currentSlide < slides.length - 1) {
showSlide(currentSlide + 1);
} else {
showSlide(0);
}
}
setInterval(nextSlide, 5000);
function initializeGame() {
document.getElementById('startScreen').style.display = 'none';
document.getElementById('gameCanvas').style.display = 'block';
if (typeof startGame === 'function') {
startGame();
} else {
console.error('Функция startGame не найдена');
}
}
gameStartButton.addEventListener('click', initializeGame);
</script>
<script src="game.js"></script>
</body>
</html>