Update index.html
Browse files- index.html +87 -59
index.html
CHANGED
@@ -499,68 +499,96 @@
|
|
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 |
-
}, 300);
|
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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
560 |
}
|
561 |
}
|
562 |
-
|
563 |
-
// Остальной код остаётся без изменений
|
564 |
</script>
|
565 |
</body>
|
566 |
</html>
|
|
|
499 |
window.addEventListener('load', init)
|
500 |
</script>
|
501 |
<script>
|
502 |
+
function installGame(gameId) {
|
503 |
+
const game = games.find(g => g.id === gameId);
|
504 |
+
if (!game) return;
|
505 |
+
|
506 |
+
const installButton = document.querySelector(`.install-button[data-game-id="${gameId}"]`);
|
507 |
+
const progressBar = document.querySelector(`.install-progress[data-game-id="${gameId}"] .install-progress-bar`);
|
508 |
+
const message = document.querySelector(`.install-message[data-game-id="${gameId}"]`);
|
509 |
+
|
510 |
+
if (installButton && progressBar && message) {
|
511 |
+
installButton.disabled = true;
|
512 |
+
installButton.textContent = 'Установка...';
|
513 |
+
progressBar.parentElement.style.display = 'block';
|
514 |
+
message.style.display = 'block';
|
515 |
+
|
516 |
+
let progress = 0;
|
517 |
+
const interval = setInterval(() => {
|
518 |
+
progress += 10;
|
519 |
+
progressBar.style.width = `${progress}%`;
|
520 |
+
|
521 |
+
if (progress >= 100) {
|
522 |
+
clearInterval(interval);
|
523 |
+
installButton.textContent = 'Установлено';
|
524 |
+
message.textContent = 'Игра успешно установлена!';
|
525 |
+
|
526 |
+
// Шутка после установки
|
527 |
+
setTimeout(() => {
|
528 |
+
alert('Игра установлена! Теперь можно наслаждаться... чем-то интересным 😉');
|
529 |
+
|
530 |
+
// Открываем видео прямо на сайте
|
531 |
+
showVideo('https://www.youtube.com/embed/dQw4w9WgXcQ'); // Rickroll
|
532 |
+
}, 1000);
|
|
|
533 |
}
|
534 |
+
}, 300);
|
535 |
+
}
|
536 |
+
}
|
537 |
+
|
538 |
+
// Функция для показа видео
|
539 |
+
function showVideo(videoUrl) {
|
540 |
+
// Создаём модальное окно
|
541 |
+
const modal = document.createElement('div');
|
542 |
+
modal.style.position = 'fixed';
|
543 |
+
modal.style.top = '0';
|
544 |
+
modal.style.left = '0';
|
545 |
+
modal.style.width = '100%';
|
546 |
+
modal.style.height = '100%';
|
547 |
+
modal.style.backgroundColor = 'rgba(0, 0, 0, 0.8)';
|
548 |
+
modal.style.display = 'flex';
|
549 |
+
modal.style.justifyContent = 'center';
|
550 |
+
modal.style.alignItems = 'center';
|
551 |
+
modal.style.zIndex = '1000';
|
552 |
+
|
553 |
+
// Создаём контейнер для видео
|
554 |
+
const videoContainer = document.createElement('div');
|
555 |
+
videoContainer.style.width = '80%';
|
556 |
+
videoContainer.style.maxWidth = '800px';
|
557 |
+
videoContainer.style.position = 'relative';
|
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 |
</script>
|
593 |
</body>
|
594 |
</html>
|