Etik94 commited on
Commit
4c7f1e8
Β·
verified Β·
1 Parent(s): 4f00d1d

creat a new htlm link that is working for Web, phone and tablet - Follow Up Deployment

Browse files
Files changed (3) hide show
  1. game.html +252 -0
  2. index.html +2 -2
  3. prompts.txt +2 -1
game.html ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
+ <title>Bubble Trouble Game</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ padding: 0;
11
+ overflow: hidden;
12
+ touch-action: manipulation;
13
+ background: linear-gradient(to bottom right, #4a00e0, #8e2de2);
14
+ height: 100vh;
15
+ display: flex;
16
+ flex-direction: column;
17
+ align-items: center;
18
+ justify-content: center;
19
+ font-family: Arial, sans-serif;
20
+ color: white;
21
+ }
22
+
23
+ #gameContainer {
24
+ width: 100%;
25
+ height: 100%;
26
+ position: relative;
27
+ }
28
+
29
+ .smiley {
30
+ position: absolute;
31
+ font-size: 40px;
32
+ cursor: pointer;
33
+ user-select: none;
34
+ -webkit-user-select: none;
35
+ animation: float 2s infinite ease-in-out;
36
+ text-shadow: 0 0 10px rgba(255,255,255,0.5);
37
+ transition: transform 0.2s;
38
+ }
39
+
40
+ .smiley:hover {
41
+ transform: scale(1.2);
42
+ }
43
+
44
+ #scoreDisplay {
45
+ position: absolute;
46
+ top: 20px;
47
+ left: 20px;
48
+ font-size: 24px;
49
+ background: rgba(0,0,0,0.5);
50
+ padding: 10px 20px;
51
+ border-radius: 20px;
52
+ z-index: 100;
53
+ }
54
+
55
+ #timerDisplay {
56
+ position: absolute;
57
+ top: 20px;
58
+ right: 20px;
59
+ font-size: 24px;
60
+ background: rgba(0,0,0,0.5);
61
+ padding: 10px 20px;
62
+ border-radius: 20px;
63
+ z-index: 100;
64
+ }
65
+
66
+ @keyframes float {
67
+ 0%, 100% { transform: translateY(0); }
68
+ 50% { transform: translateY(-20px); }
69
+ }
70
+
71
+ #gameOver {
72
+ position: absolute;
73
+ top: 0;
74
+ left: 0;
75
+ width: 100%;
76
+ height: 100%;
77
+ background: rgba(0,0,0,0.8);
78
+ display: none;
79
+ flex-direction: column;
80
+ align-items: center;
81
+ justify-content: center;
82
+ z-index: 200;
83
+ }
84
+
85
+ #gameOver h1 {
86
+ font-size: 48px;
87
+ color: #ffcc00;
88
+ margin-bottom: 20px;
89
+ text-align: center;
90
+ }
91
+
92
+ #finalScore {
93
+ font-size: 36px;
94
+ margin-bottom: 30px;
95
+ }
96
+
97
+ #restartButton {
98
+ padding: 15px 30px;
99
+ background: linear-gradient(to right, #ff416c, #ff4b2b);
100
+ border: none;
101
+ border-radius: 30px;
102
+ color: white;
103
+ font-size: 18px;
104
+ cursor: pointer;
105
+ transition: transform 0.3s;
106
+ }
107
+
108
+ #restartButton:hover {
109
+ transform: scale(1.1);
110
+ }
111
+ </style>
112
+ </head>
113
+ <body>
114
+ <div id="gameContainer">
115
+ <div id="scoreDisplay">Score: 0</div>
116
+ <div id="timerDisplay">Time: 30s</div>
117
+
118
+ <div id="gameOver">
119
+ <h1>πŸŽ‰ Congratulations! πŸŽ‰</h1>
120
+ <div id="finalScore">Your score: 0</div>
121
+ <button id="restartButton">Play Again</button>
122
+ </div>
123
+ </div>
124
+
125
+ <script>
126
+ // Game variables
127
+ let score = 0;
128
+ let timeLeft = 30;
129
+ let gameActive = false;
130
+ let gameInterval;
131
+ let timerInterval;
132
+ const smileys = ['πŸ˜€', '😊', '🀩', '😎', 'πŸ₯³', '😍', 'πŸ€ͺ', '😜', 'πŸ˜‚', 'πŸ˜‡'];
133
+
134
+ // DOM elements
135
+ const gameContainer = document.getElementById('gameContainer');
136
+ const scoreDisplay = document.getElementById('scoreDisplay');
137
+ const timerDisplay = document.getElementById('timerDisplay');
138
+ const gameOverScreen = document.getElementById('gameOver');
139
+ const finalScoreDisplay = document.getElementById('finalScore');
140
+ const restartButton = document.getElementById('restartButton');
141
+
142
+ // Start game
143
+ startGame();
144
+
145
+ function startGame() {
146
+ // Reset game state
147
+ score = 0;
148
+ timeLeft = 30;
149
+ gameActive = true;
150
+
151
+ // Clear any existing elements
152
+ gameContainer.querySelectorAll('.smiley').forEach(el => el.remove());
153
+
154
+ // Update displays
155
+ scoreDisplay.textContent = `Score: ${score}`;
156
+ timerDisplay.textContent = `Time: ${timeLeft}s`;
157
+
158
+ // Hide game over screen
159
+ gameOverScreen.style.display = 'none';
160
+
161
+ // Start game loop
162
+ gameInterval = setInterval(spawnSmiley, 500);
163
+
164
+ // Start timer
165
+ timerInterval = setInterval(updateTimer, 1000);
166
+ }
167
+
168
+ function spawnSmiley() {
169
+ if (!gameActive) return;
170
+
171
+ const smiley = document.createElement('div');
172
+ smiley.className = 'smiley';
173
+ smiley.textContent = smileys[Math.floor(Math.random() * smileys.length)];
174
+
175
+ // Random position (with margins)
176
+ const x = Math.random() * (window.innerWidth - 100) + 50;
177
+ const y = Math.random() * (window.innerHeight - 100) + 50;
178
+
179
+ smiley.style.left = `${x}px`;
180
+ smiley.style.top = `${y}px`;
181
+
182
+ // Random size
183
+ const size = Math.random() * 30 + 30;
184
+ smiley.style.fontSize = `${size}px`;
185
+
186
+ // Click handler
187
+ smiley.addEventListener('click', () => {
188
+ if (!gameActive) return;
189
+
190
+ score++;
191
+ scoreDisplay.textContent = `Score: ${score}`;
192
+
193
+ // Animation when clicked
194
+ smiley.style.transform = 'scale(1.5)';
195
+ smiley.style.opacity = '0';
196
+ setTimeout(() => smiley.remove(), 200);
197
+ });
198
+
199
+ // Auto-remove after 2 seconds if not clicked
200
+ setTimeout(() => {
201
+ if (smiley.parentNode) smiley.remove();
202
+ }, 2000);
203
+
204
+ gameContainer.appendChild(smiley);
205
+ }
206
+
207
+ function updateTimer() {
208
+ timeLeft--;
209
+ timerDisplay.textContent = `Time: ${timeLeft}s`;
210
+
211
+ if (timeLeft <= 0) {
212
+ endGame();
213
+ }
214
+ }
215
+
216
+ function endGame() {
217
+ gameActive = false;
218
+ clearInterval(gameInterval);
219
+ clearInterval(timerInterval);
220
+
221
+ // Show game over screen
222
+ finalScoreDisplay.textContent = `Your score: ${score}`;
223
+ gameOverScreen.style.display = 'flex';
224
+ }
225
+
226
+ // Restart button handler
227
+ restartButton.addEventListener('click', startGame);
228
+
229
+ // Handle window resize
230
+ window.addEventListener('resize', () => {
231
+ if (gameActive) {
232
+ // Reposition all smileys to stay visible
233
+ document.querySelectorAll('.smiley').forEach(smiley => {
234
+ const x = Math.random() * (window.innerWidth - 100) + 50;
235
+ const y = Math.random() * (window.innerHeight - 100) + 50;
236
+ smiley.style.left = `${x}px`;
237
+ smiley.style.top = `${y}px`;
238
+ });
239
+ }
240
+ });
241
+
242
+ // Prevent default touch behavior
243
+ document.addEventListener('touchstart', (e) => {
244
+ if (e.target === gameContainer) e.preventDefault();
245
+ }, { passive: false });
246
+
247
+ document.addEventListener('touchend', (e) => {
248
+ if (e.target === gameContainer) e.preventDefault();
249
+ }, { passive: false });
250
+ </script>
251
+ </body>
252
+ </html>
index.html CHANGED
@@ -74,8 +74,8 @@
74
  <a href="#play" class="bg-pink-600 hover:bg-pink-700 text-white font-bold py-3 px-6 rounded-full transition-all transform hover:scale-105 shadow-lg">
75
  Play Now
76
  </a>
77
- <a href="#features" class="bg-transparent border-2 border-white hover:bg-white hover:text-purple-900 font-bold py-3 px-6 rounded-full transition-all transform hover:scale-105">
78
- Learn More
79
  </a>
80
  </div>
81
  </div>
 
74
  <a href="#play" class="bg-pink-600 hover:bg-pink-700 text-white font-bold py-3 px-6 rounded-full transition-all transform hover:scale-105 shadow-lg">
75
  Play Now
76
  </a>
77
+ <a href="game.html" class="bg-transparent border-2 border-white hover:bg-white hover:text-purple-900 font-bold py-3 px-6 rounded-full transition-all transform hover:scale-105">
78
+ Full Screen Game
79
  </a>
80
  </div>
81
  </div>
prompts.txt CHANGED
@@ -14,4 +14,5 @@ Delite it
14
  delite it
15
  make the Congratulations Window more colorful
16
  it is not working in the Webside. Change it that it works
17
- delete it
 
 
14
  delite it
15
  make the Congratulations Window more colorful
16
  it is not working in the Webside. Change it that it works
17
+ delete it
18
+ creat a new htlm link that is working for Web, phone and tablet