rukundob451 commited on
Commit
b3b859c
Β·
verified Β·
1 Parent(s): 35b3151

Add 2 files

Browse files
Files changed (1) hide show
  1. index.html +99 -95
index.html CHANGED
@@ -1,127 +1,131 @@
1
  <!DOCTYPE html>
2
  <html>
3
  <head>
4
- <title>Fun App</title>
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
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
- overflow: hidden;
14
- height: 100dvh;
15
- font-family: "Arial", sans-serif;
16
- text-align: center;
17
- background: #ffffff;
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
- h1 span {
34
- color: #acacac;
35
- font-size: 32px;
 
 
 
 
 
36
  }
37
- button {
38
- margin-top: 20px;
39
- padding: 10px 20px;
40
- font-size: 16px;
41
- border: none;
42
- background-color: #111;
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
- .floating-astro {
53
- position: absolute;
54
- top: 10%;
55
- left: 90%;
56
- font-size: 40px;
57
- animation: floatAstro 6s infinite linear;
58
- z-index: 1;
59
  }
60
- @keyframes floatAstro {
61
- 0% { transform: translateY(0); }
62
- 50% { transform: translateY(20px) rotate(10deg); }
63
- 100% { transform: translateY(0); }
 
 
64
  }
65
  </style>
66
  </head>
67
  <body>
68
- <h1>
69
- <span>What is the date today?</span><br />
70
- Ask me anything.
71
- </h1>
72
- <button onclick="activateSpaceMode()">πŸͺ Space Mode</button>
73
- <img src="https://enzostvs-deepsite.hf.space/arrow.svg" class="arrow" />
 
 
 
 
 
 
74
 
75
  <script>
76
- const funResponses = [
77
- "According to my calculations... it's snack time!",
78
- "Time is a social construct.",
79
- "Today? Feels like a Monday, but it's not.",
80
- "Ask again after coffee β˜•",
81
- "404: Date not found!",
82
- "It's... just another day in the simulation.",
83
- "Every day is a good day to nap 😴",
84
- "One step closer to the weekend!"
85
- ];
 
 
 
86
 
87
- function dropConfetti() {
88
- const emojis = ["πŸŽ‰", "🎈", "✨", "πŸ’₯", "🎊", "πŸ’ƒ", "πŸ•Ί"];
89
- for (let i = 0; i < 30; i++) {
90
- const el = document.createElement("div");
91
- el.textContent = emojis[Math.floor(Math.random() * emojis.length)];
92
- el.style.position = "absolute";
93
- el.style.left = Math.random() * 100 + "vw";
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 activateSpaceMode() {
102
- document.body.style.background = "radial-gradient(ellipse at bottom, #1b2735 0%, #090a0f 100%)";
103
- document.body.style.color = "#fff";
104
- document.querySelector("button").style.backgroundColor = "#fff";
105
- document.querySelector("button").style.color = "#000";
106
-
107
- const astro = document.createElement("div");
108
- astro.className = "floating-astro";
109
- astro.textContent = "πŸ‘¨β€πŸš€";
110
- document.body.appendChild(astro);
111
  }
112
 
113
- document.addEventListener("DOMContentLoaded", function () {
114
- const question = document.querySelector("h1");
115
- const span = question.querySelector("span");
116
- const mainText = question.childNodes[2];
 
 
 
117
 
118
- const today = new Date().toDateString();
119
- span.textContent = `Today's date is: ${today}`;
120
- const response = funResponses[Math.floor(Math.random() * funResponses.length)];
121
- mainText.textContent = response;
122
 
123
- dropConfetti();
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>