Update index.html
Browse files- index.html +66 -47
index.html
CHANGED
@@ -498,7 +498,7 @@
|
|
498 |
// Инициализация при загрузке страницы
|
499 |
window.addEventListener('load', init)
|
500 |
</script>
|
501 |
-
|
502 |
function installGame(gameId) {
|
503 |
const game = games.find(g => g.id === gameId);
|
504 |
if (!game) return;
|
@@ -523,72 +523,91 @@ function installGame(gameId) {
|
|
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.
|
543 |
-
modal.style.
|
544 |
-
|
545 |
-
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
|
|
|
|
|
|
|
|
554 |
const videoContainer = document.createElement('div');
|
555 |
-
videoContainer.style.
|
556 |
-
|
557 |
-
|
|
|
|
|
|
|
|
|
|
|
558 |
|
559 |
-
// Создаём iframe с видео
|
560 |
const iframe = document.createElement('iframe');
|
|
|
561 |
iframe.src = videoUrl;
|
562 |
-
iframe.
|
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.
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
586 |
videoContainer.appendChild(iframe);
|
587 |
videoContainer.appendChild(closeButton);
|
588 |
modal.appendChild(videoContainer);
|
589 |
document.body.appendChild(modal);
|
590 |
-
|
591 |
-
|
592 |
-
|
|
|
|
|
593 |
</body>
|
594 |
</html>
|
|
|
498 |
// Инициализация при загрузке страницы
|
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;
|
|
|
523 |
installButton.textContent = 'Установлено';
|
524 |
message.textContent = 'Игра успешно установлена!';
|
525 |
|
|
|
526 |
setTimeout(() => {
|
527 |
alert('Игра установлена! Теперь можно наслаждаться... чем-то интересным 😉');
|
528 |
+
showVideo('https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1'); // Автовоспроизведение
|
|
|
|
|
529 |
}, 1000);
|
530 |
}
|
531 |
}, 300);
|
532 |
}
|
533 |
}
|
534 |
|
|
|
535 |
function showVideo(videoUrl) {
|
536 |
+
// Проверка на существующее модальное окно
|
537 |
+
if(document.getElementById('video-modal')) return;
|
538 |
+
|
539 |
const modal = document.createElement('div');
|
540 |
+
modal.id = 'video-modal';
|
541 |
+
modal.style.cssText = `
|
542 |
+
position: fixed;
|
543 |
+
top: 0;
|
544 |
+
left: 0;
|
545 |
+
width: 100%;
|
546 |
+
height: 100%;
|
547 |
+
background: rgba(0,0,0,0.9);
|
548 |
+
display: flex;
|
549 |
+
justify-content: center;
|
550 |
+
align-items: center;
|
551 |
+
z-index: 1000;
|
552 |
+
opacity: 0;
|
553 |
+
transition: opacity 0.3s;
|
554 |
+
`;
|
555 |
+
|
556 |
const videoContainer = document.createElement('div');
|
557 |
+
videoContainer.style.cssText = `
|
558 |
+
width: 90%;
|
559 |
+
max-width: 800px;
|
560 |
+
position: relative;
|
561 |
+
background: #000;
|
562 |
+
border-radius: 10px;
|
563 |
+
overflow: hidden;
|
564 |
+
`;
|
565 |
|
|
|
566 |
const iframe = document.createElement('iframe');
|
567 |
+
iframe.style.cssText = 'width: 100%; height: 450px; border: none;';
|
568 |
iframe.src = videoUrl;
|
569 |
+
iframe.allow = 'autoplay; encrypted-media; fullscreen';
|
|
|
|
|
|
|
|
|
570 |
|
|
|
571 |
const closeButton = document.createElement('button');
|
572 |
closeButton.textContent = '×';
|
573 |
+
closeButton.style.cssText = `
|
574 |
+
position: absolute;
|
575 |
+
top: 15px;
|
576 |
+
right: 15px;
|
577 |
+
background: #ff4444;
|
578 |
+
color: #fff;
|
579 |
+
border: none;
|
580 |
+
border-radius: 50%;
|
581 |
+
width: 40px;
|
582 |
+
height: 40px;
|
583 |
+
font-size: 24px;
|
584 |
+
cursor: pointer;
|
585 |
+
z-index: 1001;
|
586 |
+
`;
|
587 |
+
|
588 |
+
closeButton.onclick = () => {
|
589 |
+
modal.style.opacity = '0';
|
590 |
+
setTimeout(() => modal.remove(), 300);
|
591 |
+
};
|
592 |
+
|
593 |
+
// Закрытие по клику на фон
|
594 |
+
modal.onclick = (e) => {
|
595 |
+
if(e.target === modal) closeButton.click();
|
596 |
+
};
|
597 |
+
|
598 |
+
// Закрытие по Esc
|
599 |
+
document.addEventListener('keydown', (e) => {
|
600 |
+
if(e.key === 'Escape') closeButton.click();
|
601 |
+
});
|
602 |
+
|
603 |
videoContainer.appendChild(iframe);
|
604 |
videoContainer.appendChild(closeButton);
|
605 |
modal.appendChild(videoContainer);
|
606 |
document.body.appendChild(modal);
|
607 |
+
|
608 |
+
// Анимация появления
|
609 |
+
setTimeout(() => modal.style.opacity = '1', 10);
|
610 |
+
}
|
611 |
+
</script>
|
612 |
</body>
|
613 |
</html>
|