Spaces:
Running
Running
Add 2 files
Browse files- index.html +99 -95
index.html
CHANGED
|
@@ -1,127 +1,131 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
<head>
|
| 4 |
-
<title>
|
| 5 |
-
<meta
|
| 6 |
-
<meta charset="utf-8">
|
| 7 |
<style>
|
| 8 |
body {
|
| 9 |
display: flex;
|
| 10 |
flex-direction: column;
|
| 11 |
-
justify-content: center;
|
| 12 |
align-items: center;
|
| 13 |
-
|
| 14 |
-
height:
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
background: #
|
| 18 |
-
position: relative;
|
| 19 |
-
transition: all 0.8s ease;
|
| 20 |
-
}
|
| 21 |
-
.arrow {
|
| 22 |
-
position: absolute;
|
| 23 |
-
bottom: 32px;
|
| 24 |
-
left: 0px;
|
| 25 |
-
width: 100px;
|
| 26 |
-
transform: rotate(30deg);
|
| 27 |
}
|
|
|
|
| 28 |
h1 {
|
| 29 |
-
font-size: 50px;
|
| 30 |
margin-bottom: 10px;
|
| 31 |
-
z-index: 2;
|
| 32 |
}
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 36 |
}
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
color: white;
|
| 44 |
-
border-radius: 8px;
|
| 45 |
cursor: pointer;
|
| 46 |
-
z-index: 2;
|
| 47 |
-
}
|
| 48 |
-
@keyframes floatDown {
|
| 49 |
-
0% { transform: translateY(-100px); opacity: 1; }
|
| 50 |
-
100% { transform: translateY(100px); opacity: 0; }
|
| 51 |
}
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
font-size: 40px;
|
| 57 |
-
animation: floatAstro 6s infinite linear;
|
| 58 |
-
z-index: 1;
|
| 59 |
}
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
|
|
|
|
|
|
| 64 |
}
|
| 65 |
</style>
|
| 66 |
</head>
|
| 67 |
<body>
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
</
|
| 72 |
-
<
|
| 73 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
|
| 75 |
<script>
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
|
|
|
|
|
|
|
|
|
| 86 |
|
| 87 |
-
function
|
| 88 |
-
const
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
el.style.top = Math.random() * 100 + "vh";
|
| 95 |
-
el.style.fontSize = "24px";
|
| 96 |
-
el.style.animation = `floatDown ${3 + Math.random() * 2}s ease-in-out forwards`;
|
| 97 |
-
document.body.appendChild(el);
|
| 98 |
-
}
|
| 99 |
}
|
| 100 |
|
| 101 |
-
function
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
}
|
| 112 |
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
|
|
|
|
|
|
|
|
|
| 117 |
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
mainText.textContent = response;
|
| 122 |
|
| 123 |
-
|
| 124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
</script>
|
|
|
|
| 126 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=rukundob451/readyletsgo" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 127 |
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
<head>
|
| 4 |
+
<title>Click the Box Game</title>
|
| 5 |
+
<meta charset="UTF-8" />
|
|
|
|
| 6 |
<style>
|
| 7 |
body {
|
| 8 |
display: flex;
|
| 9 |
flex-direction: column;
|
|
|
|
| 10 |
align-items: center;
|
| 11 |
+
justify-content: center;
|
| 12 |
+
height: 100vh;
|
| 13 |
+
margin: 0;
|
| 14 |
+
font-family: sans-serif;
|
| 15 |
+
background-color: #f0f0f0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
}
|
| 17 |
+
|
| 18 |
h1 {
|
|
|
|
| 19 |
margin-bottom: 10px;
|
|
|
|
| 20 |
}
|
| 21 |
+
|
| 22 |
+
#gameArea {
|
| 23 |
+
width: 300px;
|
| 24 |
+
height: 300px;
|
| 25 |
+
background-color: #fff;
|
| 26 |
+
border: 2px solid #333;
|
| 27 |
+
position: relative;
|
| 28 |
+
overflow: hidden;
|
| 29 |
}
|
| 30 |
+
|
| 31 |
+
#box {
|
| 32 |
+
width: 50px;
|
| 33 |
+
height: 50px;
|
| 34 |
+
background-color: #ff0066;
|
| 35 |
+
position: absolute;
|
|
|
|
|
|
|
| 36 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 37 |
}
|
| 38 |
+
|
| 39 |
+
#score, #timer, #level {
|
| 40 |
+
margin: 8px;
|
| 41 |
+
font-weight: bold;
|
|
|
|
|
|
|
|
|
|
| 42 |
}
|
| 43 |
+
|
| 44 |
+
#level-up-msg {
|
| 45 |
+
font-size: 24px;
|
| 46 |
+
color: green;
|
| 47 |
+
margin-top: 10px;
|
| 48 |
+
height: 30px;
|
| 49 |
}
|
| 50 |
</style>
|
| 51 |
</head>
|
| 52 |
<body>
|
| 53 |
+
|
| 54 |
+
<h1>🎯 Click the Box!</h1>
|
| 55 |
+
<div id="score">Score: 0</div>
|
| 56 |
+
<div id="level">Level: 1</div>
|
| 57 |
+
<div id="timer">Time: 30s</div>
|
| 58 |
+
<div id="level-up-msg"></div>
|
| 59 |
+
<div id="gameArea">
|
| 60 |
+
<div id="box"></div>
|
| 61 |
+
</div>
|
| 62 |
+
|
| 63 |
+
<!-- Sound effect -->
|
| 64 |
+
<audio id="click-sound" src="https://www.soundjay.com/buttons/sounds/button-16.mp3" preload="auto"></audio>
|
| 65 |
|
| 66 |
<script>
|
| 67 |
+
let score = 0;
|
| 68 |
+
let timeLeft = 30;
|
| 69 |
+
let level = 1;
|
| 70 |
+
let speed = 1000; // box movement interval in ms
|
| 71 |
+
let interval;
|
| 72 |
+
|
| 73 |
+
const scoreDisplay = document.getElementById("score");
|
| 74 |
+
const timerDisplay = document.getElementById("timer");
|
| 75 |
+
const levelDisplay = document.getElementById("level");
|
| 76 |
+
const box = document.getElementById("box");
|
| 77 |
+
const gameArea = document.getElementById("gameArea");
|
| 78 |
+
const levelUpMsg = document.getElementById("level-up-msg");
|
| 79 |
+
const clickSound = document.getElementById("click-sound");
|
| 80 |
|
| 81 |
+
function moveBox() {
|
| 82 |
+
const maxX = gameArea.clientWidth - box.clientWidth;
|
| 83 |
+
const maxY = gameArea.clientHeight - box.clientHeight;
|
| 84 |
+
const x = Math.floor(Math.random() * maxX);
|
| 85 |
+
const y = Math.floor(Math.random() * maxY);
|
| 86 |
+
box.style.left = x + "px";
|
| 87 |
+
box.style.top = y + "px";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
}
|
| 89 |
|
| 90 |
+
function updateLevel() {
|
| 91 |
+
if (score === 5 || score === 10 || score === 15) {
|
| 92 |
+
level++;
|
| 93 |
+
levelDisplay.textContent = "Level: " + level;
|
| 94 |
+
levelUpMsg.textContent = `🎉 Level Up! Welcome to Level ${level}!`;
|
| 95 |
+
setTimeout(() => (levelUpMsg.textContent = ""), 2000);
|
| 96 |
+
clearInterval(interval);
|
| 97 |
+
speed -= 200; // make it faster
|
| 98 |
+
interval = setInterval(moveBox, speed);
|
| 99 |
+
}
|
| 100 |
}
|
| 101 |
|
| 102 |
+
box.addEventListener("click", () => {
|
| 103 |
+
score++;
|
| 104 |
+
scoreDisplay.textContent = "Score: " + score;
|
| 105 |
+
clickSound.play();
|
| 106 |
+
moveBox();
|
| 107 |
+
updateLevel();
|
| 108 |
+
});
|
| 109 |
|
| 110 |
+
function startGame() {
|
| 111 |
+
moveBox();
|
| 112 |
+
interval = setInterval(moveBox, speed);
|
|
|
|
| 113 |
|
| 114 |
+
const timer = setInterval(() => {
|
| 115 |
+
timeLeft--;
|
| 116 |
+
timerDisplay.textContent = "Time: " + timeLeft + "s";
|
| 117 |
+
if (timeLeft === 0) {
|
| 118 |
+
clearInterval(timer);
|
| 119 |
+
clearInterval(interval);
|
| 120 |
+
box.style.display = "none";
|
| 121 |
+
timerDisplay.textContent = "⏰ Time's up!";
|
| 122 |
+
levelUpMsg.textContent = `🏁 Final Score: ${score} | Level: ${level}`;
|
| 123 |
+
}
|
| 124 |
+
}, 1000);
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
startGame();
|
| 128 |
</script>
|
| 129 |
+
|
| 130 |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=rukundob451/readyletsgo" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 131 |
</html>
|