- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8">
- <title>Пати с монстрами</title>
- <meta name="description" content=" игра для компании">
- </head>
- <body>
- <style>
- body {
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- height: 100vh;
- background: #f2f2f2
- }
- </style>
- <h1>Пати гейм</h1>
- <p>Играй с друзьями в большой компании.</p>
- <button onclick="showRandomImage()">👾 👹 ПОВСТРЕЧАТЬ МОНСТРА 👹 👾
- </button>
- <img id="random-image">
- <script>
- var images = ["zvermelody.jpg","zmot.JPG","gorila.JPG","zlo.JPG","love.JPG","glukoza.JPG","danc.JPG","noga.JPG","milo.JPG","zmeiava.JPG","pink.JPG","voda.JPG","IMG_7115.JPG","IMG_7118.JPG","IMG_7120.JPG","IMG_7122.JPG","IMG_7123.JPG","IMG_7125.JPG","IMG_7126.JPG","IMG_7128.JPG","IMG_7129.JPG","IMG_7130.JPG","IMG_7131.JPG","IMG_7132.JPG","IMG_7133.JPG","IMG_7134.JPG","IMG_7135.JPG","IMG_7136.JPG","IMG_7137.JPG","IMG_7138.JPG","IMG_7139.JPG",]; // массив с путями к 10 картинкам
- var usedIndexes = []; // массив, в котором будут храниться уже использованные индексы
- function showRandomImage() {
- var randomIndex = getRandomIndex();
- var image = document.getElementById("random-image");
- image.src = images[randomIndex];
- }
- function getRandomIndex() {
- var index = Math.floor(Math.random() * 31); // генерируем случайный индекс от 0 до 11
- if (usedIndexes.length === 31) { // если использовали все индексы, начинаем заново
- alert ("Вау! Вы победили всех монстров! ️Но повезло не всем, игрок ☠️ у которого меньше всего жизней всё же не дошел до конца ⚰️");usedIndexes = [];
- }
- while (usedIndexes.includes(index)) { // проверяем, использовали ли мы уже этот индекс
- index = Math.floor(Math.random() * 31);
- }
- usedIndexes.push(index); // добавляем использованный индекс в массив
- return index;
- }
- // заполним массив с путями к картинкам
- for (var i = 1; i <= 31; i++) {
- images.push("path/to/image" + i + ".jpg");
- }
- </script>
- </body>
- </html>
[text] Monsterpg
Viewer
*** This page was generated with the meta tag "noindex, nofollow". This happened because you selected this option before saving or the system detected it as spam. This means that this page will never get into the search engines and the search bot will not crawl it. There is nothing to worry about, you can still share it with anyone.
Editor
You can edit this paste and save as new: