VSPAN commited on
Commit
0916e12
·
verified ·
1 Parent(s): 0b55d10

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +63 -110
index.html CHANGED
@@ -498,116 +498,69 @@
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;
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
- 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>
 
498
  // Инициализация при загрузке страницы
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
+
563
+ // Остальной код остаётся без изменений
564
+ </script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
565
  </body>
566
  </html>