Add 2 files
Browse files- README.md +7 -5
- index.html +347 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: wonders-of-the-world
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: blue
|
5 |
+
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,347 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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">
|
6 |
+
<title>Wonders of the World Hunt</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
.map-container {
|
11 |
+
position: relative;
|
12 |
+
width: 100%;
|
13 |
+
max-width: 800px;
|
14 |
+
margin: 0 auto;
|
15 |
+
}
|
16 |
+
|
17 |
+
.world-map {
|
18 |
+
width: 100%;
|
19 |
+
height: auto;
|
20 |
+
cursor: pointer;
|
21 |
+
}
|
22 |
+
|
23 |
+
.target-area {
|
24 |
+
position: absolute;
|
25 |
+
background-color: rgba(255, 255, 0, 0.3);
|
26 |
+
border-radius: 50%;
|
27 |
+
transform: translate(-50%, -50%);
|
28 |
+
pointer-events: none;
|
29 |
+
display: none;
|
30 |
+
}
|
31 |
+
|
32 |
+
.pulse {
|
33 |
+
animation: pulse 1.5s infinite;
|
34 |
+
}
|
35 |
+
|
36 |
+
@keyframes pulse {
|
37 |
+
0% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
|
38 |
+
70% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.3; }
|
39 |
+
100% { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
|
40 |
+
}
|
41 |
+
|
42 |
+
.celebration {
|
43 |
+
position: fixed;
|
44 |
+
top: 0;
|
45 |
+
left: 0;
|
46 |
+
width: 100%;
|
47 |
+
height: 100%;
|
48 |
+
display: flex;
|
49 |
+
justify-content: center;
|
50 |
+
align-items: center;
|
51 |
+
background-color: rgba(0,0,0,0.7);
|
52 |
+
z-index: 1000;
|
53 |
+
animation: fadeIn 0.5s;
|
54 |
+
}
|
55 |
+
|
56 |
+
@keyframes fadeIn {
|
57 |
+
from { opacity: 0; }
|
58 |
+
to { opacity: 1; }
|
59 |
+
}
|
60 |
+
|
61 |
+
.confetti {
|
62 |
+
position: absolute;
|
63 |
+
width: 10px;
|
64 |
+
height: 10px;
|
65 |
+
background-color: #f00;
|
66 |
+
opacity: 0;
|
67 |
+
}
|
68 |
+
</style>
|
69 |
+
</head>
|
70 |
+
<body class="bg-blue-50 min-h-screen">
|
71 |
+
<div class="container mx-auto px-4 py-8">
|
72 |
+
<header class="text-center mb-8">
|
73 |
+
<h1 class="text-4xl font-bold text-blue-800 mb-2">Wonders of the World Hunt</h1>
|
74 |
+
<p class="text-xl text-blue-600">Can you find all the amazing wonders?</p>
|
75 |
+
</header>
|
76 |
+
|
77 |
+
<div class="bg-white rounded-xl shadow-lg p-6 mb-8 max-w-4xl mx-auto">
|
78 |
+
<div class="flex justify-between items-center mb-6">
|
79 |
+
<div class="bg-yellow-100 border-l-4 border-yellow-500 p-4">
|
80 |
+
<h2 id="current-wonder" class="text-2xl font-bold text-blue-800">Find the Great Wall of China</h2>
|
81 |
+
<p id="level-info" class="text-blue-600">Level 1 of 7</p>
|
82 |
+
</div>
|
83 |
+
<div class="bg-green-100 rounded-full px-6 py-3 text-center">
|
84 |
+
<p class="text-sm text-green-700">Score</p>
|
85 |
+
<p id="score" class="text-2xl font-bold text-green-800">0</p>
|
86 |
+
</div>
|
87 |
+
</div>
|
88 |
+
|
89 |
+
<div id="feedback" class="hidden mb-6 p-4 rounded-lg"></div>
|
90 |
+
|
91 |
+
<div class="map-container">
|
92 |
+
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/8/80/World_map_-_low_resolution.svg/1200px-World_map_-_low_resolution.svg.png"
|
93 |
+
alt="World Map" class="world-map" id="world-map">
|
94 |
+
<div class="target-area pulse" id="target-area"></div>
|
95 |
+
</div>
|
96 |
+
|
97 |
+
<div class="mt-6 flex justify-between">
|
98 |
+
<button id="hint-btn" class="bg-purple-500 hover:bg-purple-600 text-white font-bold py-3 px-6 rounded-lg flex items-center">
|
99 |
+
<i class="fas fa-lightbulb mr-2"></i> Get a Hint
|
100 |
+
</button>
|
101 |
+
<button id="next-btn" class="hidden bg-blue-500 hover:bg-blue-600 text-white font-bold py-3 px-6 rounded-lg flex items-center">
|
102 |
+
Next Wonder <i class="fas fa-arrow-right ml-2"></i>
|
103 |
+
</button>
|
104 |
+
</div>
|
105 |
+
</div>
|
106 |
+
|
107 |
+
<div class="text-center">
|
108 |
+
<p class="text-blue-600">Click on the map where you think the wonder is located!</p>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
|
112 |
+
<div id="celebration" class="celebration hidden">
|
113 |
+
<div class="bg-white p-8 rounded-xl text-center max-w-md">
|
114 |
+
<h2 class="text-3xl font-bold text-blue-800 mb-4">Congratulations!</h2>
|
115 |
+
<p class="text-xl mb-6">You've found all the wonders of the world!</p>
|
116 |
+
<button id="play-again" class="bg-green-500 hover:bg-green-600 text-white font-bold py-3 px-6 rounded-lg">
|
117 |
+
Play Again
|
118 |
+
</button>
|
119 |
+
</div>
|
120 |
+
</div>
|
121 |
+
|
122 |
+
<script>
|
123 |
+
// Game data
|
124 |
+
const wonders = [
|
125 |
+
{
|
126 |
+
name: "Great Wall of China",
|
127 |
+
hint: "This wonder is in Asia, in a country with a red flag with yellow stars.",
|
128 |
+
fact: "The Great Wall is over 13,000 miles long - that's longer than the distance from New York to Sydney!",
|
129 |
+
coordinates: { x: 78, y: 42 },
|
130 |
+
radius: 8
|
131 |
+
},
|
132 |
+
{
|
133 |
+
name: "Pyramids of Giza",
|
134 |
+
hint: "Look in Africa, near the northeast corner.",
|
135 |
+
fact: "The Great Pyramid was the tallest man-made structure for over 3,800 years!",
|
136 |
+
coordinates: { x: 55, y: 42 },
|
137 |
+
radius: 8
|
138 |
+
},
|
139 |
+
{
|
140 |
+
name: "Taj Mahal",
|
141 |
+
hint: "Find the country in South Asia that looks like a triangle pointing down.",
|
142 |
+
fact: "The Taj Mahal changes color depending on the time of day - pinkish in morning, white in day, golden at night!",
|
143 |
+
coordinates: { x: 70, y: 45 },
|
144 |
+
radius: 8
|
145 |
+
},
|
146 |
+
{
|
147 |
+
name: "Christ the Redeemer",
|
148 |
+
hint: "This statue is in South America, in a country that speaks Portuguese.",
|
149 |
+
fact: "The statue's arms stretch 92 feet wide - that's as long as a blue whale!",
|
150 |
+
coordinates: { x: 33, y: 65 },
|
151 |
+
radius: 10
|
152 |
+
},
|
153 |
+
{
|
154 |
+
name: "Machu Picchu",
|
155 |
+
hint: "Look in the Andes mountains of South America.",
|
156 |
+
fact: "Machu Picchu was built without any mortar - the stones fit together perfectly!",
|
157 |
+
coordinates: { x: 28, y: 65 },
|
158 |
+
radius: 10
|
159 |
+
},
|
160 |
+
{
|
161 |
+
name: "Colosseum",
|
162 |
+
hint: "Find the boot-shaped country in Europe.",
|
163 |
+
fact: "The Colosseum could hold 50,000 people and had a retractable roof!",
|
164 |
+
coordinates: { x: 52, y: 38 },
|
165 |
+
radius: 8
|
166 |
+
},
|
167 |
+
{
|
168 |
+
name: "Chichen Itza",
|
169 |
+
hint: "This Mayan pyramid is in North America, south of the United States.",
|
170 |
+
fact: "During spring and fall equinox, shadows create a snake-like shape on the pyramid!",
|
171 |
+
coordinates: { x: 20, y: 48 },
|
172 |
+
radius: 10
|
173 |
+
}
|
174 |
+
];
|
175 |
+
|
176 |
+
// Game state
|
177 |
+
let currentLevel = 0;
|
178 |
+
let score = 0;
|
179 |
+
let attempts = 0;
|
180 |
+
let mapWidth, mapHeight;
|
181 |
+
|
182 |
+
// DOM elements
|
183 |
+
const worldMap = document.getElementById('world-map');
|
184 |
+
const targetArea = document.getElementById('target-area');
|
185 |
+
const currentWonder = document.getElementById('current-wonder');
|
186 |
+
const levelInfo = document.getElementById('level-info');
|
187 |
+
const feedback = document.getElementById('feedback');
|
188 |
+
const hintBtn = document.getElementById('hint-btn');
|
189 |
+
const nextBtn = document.getElementById('next-btn');
|
190 |
+
const scoreDisplay = document.getElementById('score');
|
191 |
+
const celebration = document.getElementById('celebration');
|
192 |
+
const playAgainBtn = document.getElementById('play-again');
|
193 |
+
|
194 |
+
// Initialize game
|
195 |
+
function initGame() {
|
196 |
+
// Wait for map to load to get dimensions
|
197 |
+
worldMap.onload = function() {
|
198 |
+
mapWidth = worldMap.offsetWidth;
|
199 |
+
mapHeight = worldMap.offsetHeight;
|
200 |
+
loadLevel(currentLevel);
|
201 |
+
};
|
202 |
+
|
203 |
+
// Set up event listeners
|
204 |
+
worldMap.addEventListener('click', handleMapClick);
|
205 |
+
hintBtn.addEventListener('click', giveHint);
|
206 |
+
nextBtn.addEventListener('click', nextLevel);
|
207 |
+
playAgainBtn.addEventListener('click', resetGame);
|
208 |
+
}
|
209 |
+
|
210 |
+
// Load a level
|
211 |
+
function loadLevel(level) {
|
212 |
+
if (level >= wonders.length) {
|
213 |
+
showCelebration();
|
214 |
+
return;
|
215 |
+
}
|
216 |
+
|
217 |
+
const wonder = wonders[level];
|
218 |
+
currentWonder.textContent = `Find the ${wonder.name}`;
|
219 |
+
levelInfo.textContent = `Level ${level + 1} of ${wonders.length}`;
|
220 |
+
feedback.classList.add('hidden');
|
221 |
+
nextBtn.classList.add('hidden');
|
222 |
+
attempts = 0;
|
223 |
+
|
224 |
+
// Position target area (for correct answer)
|
225 |
+
const x = (wonder.coordinates.x / 100) * mapWidth;
|
226 |
+
const y = (wonder.coordinates.y / 100) * mapHeight;
|
227 |
+
const radius = (wonder.radius / 100) * mapWidth;
|
228 |
+
|
229 |
+
targetArea.style.width = `${radius * 2}px`;
|
230 |
+
targetArea.style.height = `${radius * 2}px`;
|
231 |
+
targetArea.style.left = `${x}px`;
|
232 |
+
targetArea.style.top = `${y}px`;
|
233 |
+
}
|
234 |
+
|
235 |
+
// Handle map click
|
236 |
+
function handleMapClick(e) {
|
237 |
+
if (nextBtn.classList.contains('hidden') === false) return;
|
238 |
+
|
239 |
+
const rect = worldMap.getBoundingClientRect();
|
240 |
+
const x = ((e.clientX - rect.left) / rect.width) * 100;
|
241 |
+
const y = ((e.clientY - rect.top) / rect.height) * 100;
|
242 |
+
|
243 |
+
const wonder = wonders[currentLevel];
|
244 |
+
const distance = Math.sqrt(
|
245 |
+
Math.pow(x - wonder.coordinates.x, 2) +
|
246 |
+
Math.pow(y - wonder.coordinates.y, 2)
|
247 |
+
);
|
248 |
+
|
249 |
+
attempts++;
|
250 |
+
|
251 |
+
if (distance <= wonder.radius) {
|
252 |
+
// Correct answer
|
253 |
+
score += Math.max(10 - attempts, 1);
|
254 |
+
scoreDisplay.textContent = score;
|
255 |
+
|
256 |
+
feedback.classList.remove('hidden');
|
257 |
+
feedback.className = 'bg-green-100 border-l-4 border-green-500 text-green-700 p-4 mb-6';
|
258 |
+
feedback.innerHTML = `
|
259 |
+
<h3 class="font-bold text-xl mb-2">Correct! The ${wonder.name} is located here.</h3>
|
260 |
+
<p class="mb-2">${wonder.fact}</p>
|
261 |
+
<p class="text-sm">You earned ${Math.max(10 - attempts, 1)} points!</p>
|
262 |
+
`;
|
263 |
+
|
264 |
+
// Show target area
|
265 |
+
targetArea.style.display = 'block';
|
266 |
+
targetArea.style.backgroundColor = 'rgba(0, 255, 0, 0.3)';
|
267 |
+
|
268 |
+
nextBtn.classList.remove('hidden');
|
269 |
+
} else {
|
270 |
+
// Wrong answer
|
271 |
+
feedback.classList.remove('hidden');
|
272 |
+
feedback.className = 'bg-red-100 border-l-4 border-red-500 text-red-700 p-4 mb-6';
|
273 |
+
feedback.innerHTML = `
|
274 |
+
<h3 class="font-bold text-xl mb-2">Not quite right!</h3>
|
275 |
+
<p>Try again. Here's a hint: ${wonder.hint}</p>
|
276 |
+
`;
|
277 |
+
}
|
278 |
+
}
|
279 |
+
|
280 |
+
// Give hint
|
281 |
+
function giveHint() {
|
282 |
+
if (feedback.classList.contains('hidden') || feedback.classList.contains('bg-red-100')) {
|
283 |
+
const wonder = wonders[currentLevel];
|
284 |
+
feedback.classList.remove('hidden');
|
285 |
+
feedback.className = 'bg-yellow-100 border-l-4 border-yellow-500 text-yellow-700 p-4 mb-6';
|
286 |
+
feedback.innerHTML = `
|
287 |
+
<h3 class="font-bold text-xl mb-2">Hint:</h3>
|
288 |
+
<p>${wonder.hint}</p>
|
289 |
+
`;
|
290 |
+
}
|
291 |
+
}
|
292 |
+
|
293 |
+
// Go to next level
|
294 |
+
function nextLevel() {
|
295 |
+
currentLevel++;
|
296 |
+
targetArea.style.display = 'none';
|
297 |
+
loadLevel(currentLevel);
|
298 |
+
}
|
299 |
+
|
300 |
+
// Show celebration
|
301 |
+
function showCelebration() {
|
302 |
+
celebration.classList.remove('hidden');
|
303 |
+
createConfetti();
|
304 |
+
}
|
305 |
+
|
306 |
+
// Create confetti effect
|
307 |
+
function createConfetti() {
|
308 |
+
const colors = ['#f00', '#0f0', '#00f', '#ff0', '#f0f', '#0ff'];
|
309 |
+
|
310 |
+
for (let i = 0; i < 100; i++) {
|
311 |
+
const confetti = document.createElement('div');
|
312 |
+
confetti.className = 'confetti';
|
313 |
+
confetti.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
|
314 |
+
confetti.style.left = Math.random() * 100 + 'vw';
|
315 |
+
confetti.style.top = -10 + 'px';
|
316 |
+
confetti.style.transform = `rotate(${Math.random() * 360}deg)`;
|
317 |
+
|
318 |
+
document.body.appendChild(confetti);
|
319 |
+
|
320 |
+
// Animate
|
321 |
+
const animation = confetti.animate([
|
322 |
+
{ top: '-10px', opacity: 0, transform: `rotate(0deg) scale(0.5)` },
|
323 |
+
{ top: '10%', opacity: 1, transform: `rotate(${Math.random() * 360}deg) scale(1)` },
|
324 |
+
{ top: '100vh', opacity: 0, transform: `rotate(${Math.random() * 360}deg) scale(0.5)` }
|
325 |
+
], {
|
326 |
+
duration: 2000 + Math.random() * 3000,
|
327 |
+
delay: Math.random() * 2000
|
328 |
+
});
|
329 |
+
|
330 |
+
animation.onfinish = () => confetti.remove();
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
// Reset game
|
335 |
+
function resetGame() {
|
336 |
+
currentLevel = 0;
|
337 |
+
score = 0;
|
338 |
+
scoreDisplay.textContent = '0';
|
339 |
+
celebration.classList.add('hidden');
|
340 |
+
loadLevel(currentLevel);
|
341 |
+
}
|
342 |
+
|
343 |
+
// Start the game
|
344 |
+
initGame();
|
345 |
+
</script>
|
346 |
+
<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=pp/wonders-of-the-world" style="color: #fff;text-decoration: underline;" target="_blank" >🧬 Remix</a></p></body>
|
347 |
+
</html>
|