Update index.html
Browse files- index.html +58 -88
index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6 |
<style>
|
7 |
/* Глобальные стили */
|
8 |
body {
|
9 |
-
background: linear-gradient(#1b2838, #0e1a27);
|
10 |
color: #c6d4df;
|
11 |
font-family: 'Arial', sans-serif;
|
12 |
margin: 0;
|
@@ -499,94 +499,64 @@
|
|
499 |
window.addEventListener('load', init)
|
500 |
</script>
|
501 |
<script>
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
|
|
533 |
}
|
534 |
-
}
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
// Создаём iframe с видео
|
560 |
-
const iframe = document.createElement('iframe');
|
561 |
-
iframe.src = videoUrl;
|
562 |
-
iframe.width = '100%';
|
563 |
-
iframe.height = '450';
|
564 |
-
iframe.frameBorder = '0';
|
565 |
-
iframe.allow = 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture';
|
566 |
-
iframe.allowFullscreen = true;
|
567 |
-
|
568 |
-
// Кнопка закрытия
|
569 |
-
const closeButton = document.createElement('button');
|
570 |
-
closeButton.textContent = '×';
|
571 |
-
closeButton.style.position = 'absolute';
|
572 |
-
closeButton.style.top = '-30px';
|
573 |
-
closeButton.style.right = '-30px';
|
574 |
-
closeButton.style.backgroundColor = '#ff4444';
|
575 |
-
closeButton.style.color = '#fff';
|
576 |
-
closeButton.style.border = 'none';
|
577 |
-
closeButton.style.borderRadius = '50%';
|
578 |
-
closeButton.style.width = '40px';
|
579 |
-
closeButton.style.height = '40px';
|
580 |
-
closeButton.style.fontSize = '24px';
|
581 |
-
closeButton.style.cursor = 'pointer';
|
582 |
-
closeButton.style.boxShadow = '0 4px 15px rgba(0, 0, 0, 0.3)';
|
583 |
-
closeButton.onclick = () => document.body.removeChild(modal);
|
584 |
-
|
585 |
-
// Добавляем элементы в DOM
|
586 |
-
videoContainer.appendChild(iframe);
|
587 |
-
videoContainer.appendChild(closeButton);
|
588 |
-
modal.appendChild(videoContainer);
|
589 |
-
document.body.appendChild(modal);
|
590 |
}
|
591 |
}
|
592 |
|
|
|
6 |
<style>
|
7 |
/* Глобальные стили */
|
8 |
body {
|
9 |
+
background: linear-gradient(135deg, #1b2838, #0e1a27);
|
10 |
color: #c6d4df;
|
11 |
font-family: 'Arial', sans-serif;
|
12 |
margin: 0;
|
|
|
499 |
window.addEventListener('load', init)
|
500 |
</script>
|
501 |
<script>
|
502 |
+
// Функция для "установки" игры
|
503 |
+
function installGame(gameId) {
|
504 |
+
const game = games.find(g => g.id === gameId);
|
505 |
+
if (!game) return;
|
506 |
+
|
507 |
+
const installButton = document.querySelector(`.install-button[data-game-id="${gameId}"]`);
|
508 |
+
const progressBar = document.querySelector(`.install-progress[data-game-id="${gameId}"] .install-progress-bar`);
|
509 |
+
const message = document.querySelector(`.install-message[data-game-id="${gameId}"]`);
|
510 |
+
|
511 |
+
if (installButton && progressBar && message) {
|
512 |
+
installButton.disabled = true;
|
513 |
+
installButton.textContent = 'Установка...';
|
514 |
+
progressBar.parentElement.style.display = 'block';
|
515 |
+
message.style.display = 'block';
|
516 |
+
|
517 |
+
let progress = 0;
|
518 |
+
const interval = setInterval(() => {
|
519 |
+
progress += 10;
|
520 |
+
progressBar.style.width = `${progress}%`;
|
521 |
+
|
522 |
+
if (progress >= 100) {
|
523 |
+
clearInterval(interval);
|
524 |
+
installButton.textContent = 'Установлено';
|
525 |
+
message.textContent = 'Игра успешно установлена!';
|
526 |
+
|
527 |
+
// Шутка после установки
|
528 |
+
setTimeout(() => {
|
529 |
+
window.location.href = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
|
530 |
+
// Здесь можно добавить ссылку или что-то ещё
|
531 |
+
}, 1000);
|
532 |
+
}
|
533 |
+
}, 300);
|
534 |
}
|
535 |
+
}
|
536 |
+
|
537 |
+
// Отрисовка библиотеки с кнопкой установки
|
538 |
+
function renderLibrary() {
|
539 |
+
const library = document.getElementById('userGames');
|
540 |
+
if (library) {
|
541 |
+
library.innerHTML = account.library.length ?
|
542 |
+
account.library.map(game => `
|
543 |
+
<div class="game-card">
|
544 |
+
<img src="${game.image}" class="game-image">
|
545 |
+
<div style="padding: 15px">
|
546 |
+
<h3>${game.title}</h3>
|
547 |
+
<button class="steam-button install-button" data-game-id="${game.id}" onclick="installGame(${game.id})">
|
548 |
+
Установить
|
549 |
+
</button>
|
550 |
+
<div class="install-progress" data-game-id="${game.id}">
|
551 |
+
<div class="install-progress-bar"></div>
|
552 |
+
</div>
|
553 |
+
<div class="install-message" data-game-id="${game.id}">
|
554 |
+
Установка...
|
555 |
+
</div>
|
556 |
+
</div>
|
557 |
+
</div>
|
558 |
+
`).join('') :
|
559 |
+
'<p>Ваша библиотека пуста. Купите игры в магазине!</p>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
560 |
}
|
561 |
}
|
562 |
|