scottobear commited on
Commit
2f49420
·
verified ·
1 Parent(s): 99eb211

Add 3 files

Browse files
Files changed (3) hide show
  1. README.md +7 -5
  2. index.html +719 -19
  3. prompts.txt +1 -0
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Test Builds For Scottobear
3
- emoji: 👁
4
- colorFrom: green
5
- colorTo: gray
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: test-builds-for-scottobear
3
+ emoji: 🐳
4
+ colorFrom: gray
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,719 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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>GeoQuest Adventure</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
+ @keyframes pulse {
11
+ 0% { transform: scale(1); }
12
+ 50% { transform: scale(1.05); }
13
+ 100% { transform: scale(1); }
14
+ }
15
+ .pulse {
16
+ animation: pulse 2s infinite;
17
+ }
18
+ .weather-icon {
19
+ font-size: 3rem;
20
+ margin-bottom: 1rem;
21
+ }
22
+ .fade-in {
23
+ animation: fadeIn 1s;
24
+ }
25
+ @keyframes fadeIn {
26
+ from { opacity: 0; }
27
+ to { opacity: 1; }
28
+ }
29
+ .adventure-card {
30
+ background: rgba(255, 255, 255, 0.1);
31
+ backdrop-filter: blur(10px);
32
+ border-radius: 20px;
33
+ box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
34
+ }
35
+ .progress-bar {
36
+ height: 10px;
37
+ border-radius: 5px;
38
+ transition: width 0.5s ease;
39
+ }
40
+ </style>
41
+ </head>
42
+ <body class="bg-gradient-to-br from-blue-900 to-purple-900 min-h-screen text-white font-sans">
43
+ <div class="container mx-auto px-4 py-8 max-w-md">
44
+ <header class="text-center mb-8 fade-in">
45
+ <h1 class="text-4xl font-bold mb-2">GeoQuest</h1>
46
+ <p class="text-lg opacity-80">A location-based adventure</p>
47
+ </header>
48
+
49
+ <div id="loading" class="text-center py-12 fade-in">
50
+ <div class="spinner mb-4">
51
+ <i class="fas fa-compass fa-spin text-4xl"></i>
52
+ </div>
53
+ <p class="mb-4">Loading your adventure...</p>
54
+ <p class="text-sm opacity-70">Please allow location access when prompted</p>
55
+ </div>
56
+
57
+ <div id="game-container" class="hidden">
58
+ <div class="flex justify-between items-center mb-6">
59
+ <div class="flex items-center">
60
+ <i class="fas fa-user mr-2"></i>
61
+ <span id="player-name" class="font-medium">Adventurer</span>
62
+ </div>
63
+ <div class="flex items-center">
64
+ <i class="fas fa-bolt mr-2"></i>
65
+ <span id="energy">100</span>%
66
+ </div>
67
+ </div>
68
+
69
+ <div class="progress-bar bg-yellow-400 mb-6 w-full" id="energy-bar"></div>
70
+
71
+ <div class="adventure-card p-6 mb-6 fade-in">
72
+ <div class="flex justify-between items-center mb-4">
73
+ <div>
74
+ <h2 id="location-name" class="text-xl font-bold">Current Location</h2>
75
+ <p id="location-coords" class="text-sm opacity-70">Loading coordinates...</p>
76
+ </div>
77
+ <div id="weather" class="text-center">
78
+ <i id="weather-icon" class="fas fa-sun weather-icon"></i>
79
+ <p id="weather-temp" class="text-lg">--°C</p>
80
+ </div>
81
+ </div>
82
+
83
+ <div id="time-display" class="flex justify-center items-center mb-6">
84
+ <i class="far fa-clock mr-2"></i>
85
+ <span id="current-time">Loading time...</span>
86
+ </div>
87
+
88
+ <div id="location-description" class="mb-6 text-center">
89
+ <p>Discovering your surroundings...</p>
90
+ </div>
91
+
92
+ <div id="quest-display" class="mb-6">
93
+ <h3 class="font-bold mb-2 text-center">Current Quest</h3>
94
+ <p id="quest-text" class="text-center italic">Finding your starting point...</p>
95
+ <div class="flex justify-between text-xs mt-2">
96
+ <span>Progress</span>
97
+ <span id="quest-progress">0%</span>
98
+ </div>
99
+ <div class="progress-bar bg-green-400 w-0 h-2 mt-1" id="quest-bar"></div>
100
+ </div>
101
+ </div>
102
+
103
+ <div id="action-buttons" class="grid grid-cols-2 gap-4 mb-6">
104
+ <button id="explore-btn" class="bg-blue-600 hover:bg-blue-700 rounded-lg py-3 px-4 flex items-center justify-center disabled:opacity-50" disabled>
105
+ <i class="fas fa-binoculars mr-2"></i> Explore
106
+ </button>
107
+ <button id="rest-btn" class="bg-purple-600 hover:bg-purple-700 rounded-lg py-3 px-4 flex items-center justify-center disabled:opacity-50" disabled>
108
+ <i class="fas fa-moon mr-2"></i> Rest
109
+ </button>
110
+ <button id="move-btn" class="bg-green-600 hover:bg-green-700 rounded-lg py-3 px-4 flex items-center justify-center disabled:opacity-50" disabled>
111
+ <i class="fas fa-walking mr-2"></i> Move
112
+ </button>
113
+ <button id="collect-btn" class="bg-yellow-600 hover:bg-yellow-700 rounded-lg py-3 px-4 flex items-center justify-center disabled:opacity-50" disabled>
114
+ <i class="fas fa-leaf mr-2"></i> Collect
115
+ </button>
116
+ </div>
117
+
118
+ <div id="event-log" class="bg-black bg-opacity-30 rounded-lg p-4 h-40 overflow-y-auto text-sm mb-6">
119
+ <p class="text-center opacity-70">Adventure log will appear here</p>
120
+ </div>
121
+
122
+ <div class="text-center">
123
+ <button id="new-game-btn" class="bg-red-600 hover:bg-red-700 rounded-lg py-2 px-6">
124
+ <i class="fas fa-redo mr-2"></i> New Game
125
+ </button>
126
+ </div>
127
+ </div>
128
+
129
+ <div id="start-screen" class="hidden text-center py-12 fade-in">
130
+ <h2 class="text-3xl font-bold mb-6">Begin Your Adventure</h2>
131
+ <div class="mb-6">
132
+ <label for="name-input" class="block mb-2">Your Adventurer Name:</label>
133
+ <input type="text" id="name-input" class="bg-gray-800 text-white rounded-lg px-4 py-2 w-full max-w-xs mx-auto" placeholder="Enter your name">
134
+ </div>
135
+ <button id="start-game-btn" class="bg-green-600 hover:bg-green-700 rounded-lg py-3 px-8 text-lg">
136
+ <i class="fas fa-play mr-2"></i> Start Journey
137
+ </button>
138
+ </div>
139
+ </div>
140
+
141
+ <script>
142
+ // Game state
143
+ const gameState = {
144
+ playerName: "Adventurer",
145
+ energy: 100,
146
+ location: null,
147
+ weather: null,
148
+ time: null,
149
+ quests: [
150
+ { name: "Find the ancient artifact", progress: 0, target: 5 },
151
+ { name: "Discover hidden landmarks", progress: 0, target: 3 },
152
+ { name: "Collect rare items", progress: 0, target: 10 }
153
+ ],
154
+ currentQuestIndex: 0,
155
+ inventory: [],
156
+ discoveredLocations: [],
157
+ gameStarted: false
158
+ };
159
+
160
+ // DOM elements
161
+ const loadingElement = document.getElementById('loading');
162
+ const gameContainer = document.getElementById('game-container');
163
+ const startScreen = document.getElementById('start-screen');
164
+ const playerNameElement = document.getElementById('player-name');
165
+ const energyElement = document.getElementById('energy');
166
+ const energyBar = document.getElementById('energy-bar');
167
+ const locationName = document.getElementById('location-name');
168
+ const locationCoords = document.getElementById('location-coords');
169
+ const weatherIcon = document.getElementById('weather-icon');
170
+ const weatherTemp = document.getElementById('weather-temp');
171
+ const currentTime = document.getElementById('current-time');
172
+ const locationDescription = document.getElementById('location-description');
173
+ const questText = document.getElementById('quest-text');
174
+ const questProgress = document.getElementById('quest-progress');
175
+ const questBar = document.getElementById('quest-bar');
176
+ const eventLog = document.getElementById('event-log');
177
+ const exploreBtn = document.getElementById('explore-btn');
178
+ const restBtn = document.getElementById('rest-btn');
179
+ const moveBtn = document.getElementById('move-btn');
180
+ const collectBtn = document.getElementById('collect-btn');
181
+ const newGameBtn = document.getElementById('new-game-btn');
182
+ const startGameBtn = document.getElementById('start-game-btn');
183
+ const nameInput = document.getElementById('name-input');
184
+
185
+ // Location types and descriptions
186
+ const locationTypes = {
187
+ urban: ["city center", "downtown district", "urban plaza", "shopping area"],
188
+ park: ["city park", "green space", "botanical garden", "nature reserve"],
189
+ water: ["lakefront", "riverbank", "harbor area", "beach"],
190
+ residential: ["neighborhood", "suburban area", "housing district"],
191
+ commercial: ["business district", "office park", "shopping center"]
192
+ };
193
+
194
+ const locationFeatures = {
195
+ day: ["sunny", "bright", "clear", "peaceful"],
196
+ night: ["moonlit", "quiet", "starlit", "serene"],
197
+ rain: ["wet", "damp", "misty", "rain-soaked"],
198
+ sunny: ["sun-drenched", "warm", "sunny", "bright"],
199
+ cloudy: ["overcast", "gray", "cloud-covered", "cool"],
200
+ cold: ["chilly", "crisp", "cold", "frosty"]
201
+ };
202
+
203
+ // Initialize game
204
+ function initGame() {
205
+ // Show start screen
206
+ loadingElement.classList.add('hidden');
207
+ startScreen.classList.remove('hidden');
208
+
209
+ // Set up event listeners
210
+ startGameBtn.addEventListener('click', startGame);
211
+ newGameBtn.addEventListener('click', resetGame);
212
+ exploreBtn.addEventListener('click', exploreLocation);
213
+ restBtn.addEventListener('click', rest);
214
+ moveBtn.addEventListener('click', moveLocation);
215
+ collectBtn.addEventListener('click', collectItem);
216
+
217
+ // Enable buttons when game starts
218
+ exploreBtn.disabled = false;
219
+ restBtn.disabled = false;
220
+ moveBtn.disabled = false;
221
+ collectBtn.disabled = false;
222
+ }
223
+
224
+ // Start game
225
+ function startGame() {
226
+ const name = nameInput.value.trim() || "Adventurer";
227
+ gameState.playerName = name;
228
+ playerNameElement.textContent = name;
229
+
230
+ startScreen.classList.add('hidden');
231
+ gameContainer.classList.remove('hidden');
232
+
233
+ gameState.gameStarted = true;
234
+
235
+ // Start location tracking
236
+ getLocation();
237
+ updateTime();
238
+
239
+ // Start periodic updates
240
+ setInterval(updateTime, 60000); // Update time every minute
241
+ setInterval(updateEnergy, 300000); // Update energy every 5 minutes
242
+
243
+ // Initial log entry
244
+ addToLog(`Welcome, ${name}! Your adventure begins now.`);
245
+ }
246
+
247
+ // Reset game
248
+ function resetGame() {
249
+ gameState.energy = 100;
250
+ gameState.location = null;
251
+ gameState.weather = null;
252
+ gameState.time = null;
253
+ gameState.currentQuestIndex = 0;
254
+ gameState.inventory = [];
255
+ gameState.discoveredLocations = [];
256
+
257
+ gameContainer.classList.add('hidden');
258
+ startScreen.classList.remove('hidden');
259
+
260
+ eventLog.innerHTML = '<p class="text-center opacity-70">Adventure log will appear here</p>';
261
+
262
+ // Reset UI
263
+ energyElement.textContent = '100';
264
+ energyBar.style.width = '100%';
265
+ questText.textContent = 'Finding your starting point...';
266
+ questProgress.textContent = '0%';
267
+ questBar.style.width = '0%';
268
+ }
269
+
270
+ // Get location
271
+ function getLocation() {
272
+ if (navigator.geolocation) {
273
+ navigator.geolocation.getCurrentPosition(
274
+ position => {
275
+ const lat = position.coords.latitude;
276
+ const lon = position.coords.longitude;
277
+ gameState.location = { lat, lon };
278
+
279
+ // Update location display
280
+ locationCoords.textContent = `${lat.toFixed(4)}, ${lon.toFixed(4)}`;
281
+
282
+ // Get location name (simplified for this demo)
283
+ getLocationName(lat, lon);
284
+
285
+ // Get weather
286
+ getWeather(lat, lon);
287
+
288
+ // Generate location description
289
+ generateLocationDescription();
290
+
291
+ // Update quest display
292
+ updateQuestDisplay();
293
+ },
294
+ error => {
295
+ console.error("Error getting location:", error);
296
+ addToLog("Could not determine your location. Using default location.");
297
+
298
+ // Fallback to default location (New York)
299
+ gameState.location = { lat: 40.7128, lon: -74.0060 };
300
+ locationCoords.textContent = "40.7128, -74.0060";
301
+ locationName.textContent = "New York City";
302
+
303
+ // Get weather for default location
304
+ getWeather(40.7128, -74.0060);
305
+
306
+ // Generate location description
307
+ generateLocationDescription();
308
+ }
309
+ );
310
+ } else {
311
+ addToLog("Geolocation is not supported by your browser. Using default location.");
312
+
313
+ // Fallback to default location (New York)
314
+ gameState.location = { lat: 40.7128, lon: -74.0060 };
315
+ locationCoords.textContent = "40.7128, -74.0060";
316
+ locationName.textContent = "New York City";
317
+
318
+ // Get weather for default location
319
+ getWeather(40.7128, -74.0060);
320
+
321
+ // Generate location description
322
+ generateLocationDescription();
323
+ }
324
+ }
325
+
326
+ // Get location name (simplified for demo)
327
+ function getLocationName(lat, lon) {
328
+ // In a real app, you would use a geocoding API here
329
+ // For demo purposes, we'll just show coordinates
330
+ locationName.textContent = `Area at ${lat.toFixed(2)}, ${lon.toFixed(2)}`;
331
+ }
332
+
333
+ // Get weather (simplified for demo)
334
+ function getWeather(lat, lon) {
335
+ // In a real app, you would use a weather API here
336
+ // For demo, we'll simulate weather based on time and location
337
+
338
+ const now = new Date();
339
+ const hour = now.getHours();
340
+ const month = now.getMonth();
341
+
342
+ // Simulate weather patterns
343
+ let weatherType, temp;
344
+
345
+ // Summer months (June-August)
346
+ if (month >= 5 && month <= 7) {
347
+ if (hour >= 6 && hour < 18) {
348
+ // Daytime in summer
349
+ weatherType = Math.random() > 0.7 ? "rain" : "sunny";
350
+ temp = Math.floor(Math.random() * 15) + 20; // 20-35°C
351
+ } else {
352
+ // Nighttime in summer
353
+ weatherType = Math.random() > 0.8 ? "rain" : "clear";
354
+ temp = Math.floor(Math.random() * 10) + 15; // 15-25°C
355
+ }
356
+ }
357
+ // Winter months (December-February)
358
+ else if (month === 11 || month <= 1) {
359
+ if (hour >= 6 && hour < 18) {
360
+ // Daytime in winter
361
+ weatherType = Math.random() > 0.6 ? "cloudy" : "sunny";
362
+ temp = Math.floor(Math.random() * 10) + 0; // 0-10°C
363
+ } else {
364
+ // Nighttime in winter
365
+ weatherType = Math.random() > 0.7 ? "snow" : "clear";
366
+ temp = Math.floor(Math.random() * 5) - 5; // -5 to 0°C
367
+ }
368
+ }
369
+ // Spring/Fall
370
+ else {
371
+ if (hour >= 6 && hour < 18) {
372
+ // Daytime
373
+ weatherType = Math.random() > 0.5 ? "cloudy" : "sunny";
374
+ temp = Math.floor(Math.random() * 15) + 10; // 10-25°C
375
+ } else {
376
+ // Nighttime
377
+ weatherType = Math.random() > 0.6 ? "cloudy" : "clear";
378
+ temp = Math.floor(Math.random() * 10) + 5; // 5-15°C
379
+ }
380
+ }
381
+
382
+ gameState.weather = {
383
+ type: weatherType,
384
+ temperature: temp
385
+ };
386
+
387
+ // Update weather display
388
+ updateWeatherDisplay();
389
+ }
390
+
391
+ // Update weather display
392
+ function updateWeatherDisplay() {
393
+ if (!gameState.weather) return;
394
+
395
+ const weather = gameState.weather;
396
+ let icon, description;
397
+
398
+ switch (weather.type) {
399
+ case "sunny":
400
+ icon = "fa-sun";
401
+ description = "Sunny";
402
+ break;
403
+ case "rain":
404
+ icon = "fa-cloud-rain";
405
+ description = "Rainy";
406
+ break;
407
+ case "cloudy":
408
+ icon = "fa-cloud";
409
+ description = "Cloudy";
410
+ break;
411
+ case "clear":
412
+ icon = "fa-moon";
413
+ description = "Clear";
414
+ break;
415
+ case "snow":
416
+ icon = "fa-snowflake";
417
+ description = "Snowy";
418
+ break;
419
+ default:
420
+ icon = "fa-cloud-sun";
421
+ description = "Fair";
422
+ }
423
+
424
+ weatherIcon.className = `fas ${icon} weather-icon`;
425
+ weatherTemp.textContent = `${weather.temperature}°C`;
426
+ }
427
+
428
+ // Update time
429
+ function updateTime() {
430
+ const now = new Date();
431
+ gameState.time = now;
432
+
433
+ const hours = now.getHours();
434
+ const minutes = now.getMinutes().toString().padStart(2, '0');
435
+ const ampm = hours >= 12 ? 'PM' : 'AM';
436
+ const displayHours = hours % 12 || 12;
437
+
438
+ currentTime.textContent = `${displayHours}:${minutes} ${ampm}`;
439
+
440
+ // Update time-based elements
441
+ if (gameState.location) {
442
+ generateLocationDescription();
443
+ }
444
+ }
445
+
446
+ // Generate location description
447
+ function generateLocationDescription() {
448
+ if (!gameState.location || !gameState.weather || !gameState.time) return;
449
+
450
+ const hour = gameState.time.getHours();
451
+ const weather = gameState.weather.type;
452
+
453
+ // Determine time of day
454
+ let timeOfDay;
455
+ if (hour >= 5 && hour < 12) timeOfDay = "morning";
456
+ else if (hour >= 12 && hour < 17) timeOfDay = "afternoon";
457
+ else if (hour >= 17 && hour < 21) timeOfDay = "evening";
458
+ else timeOfDay = "night";
459
+
460
+ // Determine location type (simplified)
461
+ const locationTypesArray = Object.keys(locationTypes);
462
+ const randomType = locationTypesArray[Math.floor(Math.random() * locationTypesArray.length)];
463
+ const typeFeatures = locationTypes[randomType];
464
+ const randomFeature = typeFeatures[Math.floor(Math.random() * typeFeatures.length)];
465
+
466
+ // Get weather features
467
+ const weatherFeatures = locationFeatures[weather] || locationFeatures.sunny;
468
+ const randomWeatherFeature = weatherFeatures[Math.floor(Math.random() * weatherFeatures.length)];
469
+
470
+ // Get time features
471
+ const timeFeatures = locationFeatures[timeOfDay] || locationFeatures.day;
472
+ const randomTimeFeature = timeFeatures[Math.floor(Math.random() * timeFeatures.length)];
473
+
474
+ // Construct description
475
+ const description = `You're in a ${randomWeatherFeature}, ${randomTimeFeature} ${randomFeature}.`;
476
+
477
+ locationDescription.innerHTML = `<p class="text-center">${description}</p>`;
478
+
479
+ // Add to discovered locations if not already there
480
+ const locationKey = `${gameState.location.lat.toFixed(2)},${gameState.location.lon.toFixed(2)}`;
481
+ if (!gameState.discoveredLocations.includes(locationKey)) {
482
+ gameState.discoveredLocations.push(locationKey);
483
+ addToLog(`Discovered new location: ${randomFeature}`);
484
+ }
485
+ }
486
+
487
+ // Update quest display
488
+ function updateQuestDisplay() {
489
+ if (gameState.quests.length === 0) return;
490
+
491
+ const currentQuest = gameState.quests[gameState.currentQuestIndex];
492
+ questText.textContent = currentQuest.name;
493
+
494
+ const progressPercent = (currentQuest.progress / currentQuest.target) * 100;
495
+ questProgress.textContent = `${Math.min(100, Math.round(progressPercent))}%`;
496
+ questBar.style.width = `${Math.min(100, progressPercent)}%`;
497
+ }
498
+
499
+ // Update energy
500
+ function updateEnergy() {
501
+ if (!gameState.gameStarted) return;
502
+
503
+ // Energy decreases over time
504
+ gameState.energy = Math.max(0, gameState.energy - 5);
505
+ energyElement.textContent = gameState.energy;
506
+ energyBar.style.width = `${gameState.energy}%`;
507
+
508
+ // Change color based on energy level
509
+ if (gameState.energy < 20) {
510
+ energyBar.className = "progress-bar bg-red-500 mb-6";
511
+ addToLog("Warning: Your energy is critically low!");
512
+ } else if (gameState.energy < 50) {
513
+ energyBar.className = "progress-bar bg-yellow-500 mb-6";
514
+ } else {
515
+ energyBar.className = "progress-bar bg-green-500 mb-6";
516
+ }
517
+
518
+ // Disable actions if energy is too low
519
+ exploreBtn.disabled = gameState.energy < 10;
520
+ moveBtn.disabled = gameState.energy < 15;
521
+ collectBtn.disabled = gameState.energy < 5;
522
+ }
523
+
524
+ // Explore location
525
+ function exploreLocation() {
526
+ if (gameState.energy < 10) {
527
+ addToLog("Not enough energy to explore!");
528
+ return;
529
+ }
530
+
531
+ gameState.energy = Math.max(0, gameState.energy - 10);
532
+ energyElement.textContent = gameState.energy;
533
+ energyBar.style.width = `${gameState.energy}%`;
534
+
535
+ // Random chance to find something
536
+ const foundSomething = Math.random() > 0.4;
537
+
538
+ if (foundSomething) {
539
+ const discoveries = [
540
+ "ancient artifact fragment",
541
+ "hidden path",
542
+ "rare flower",
543
+ "mysterious inscription",
544
+ "abandoned item"
545
+ ];
546
+ const discovery = discoveries[Math.floor(Math.random() * discoveries.length)];
547
+
548
+ // Progress on collection quest
549
+ if (discovery === "rare flower" || discovery === "ancient artifact fragment") {
550
+ progressQuest(2);
551
+ }
552
+
553
+ addToLog(`You found ${discovery}!`);
554
+
555
+ // Small chance to increase energy from discovery
556
+ if (Math.random() > 0.8) {
557
+ gameState.energy = Math.min(100, gameState.energy + 5);
558
+ energyElement.textContent = gameState.energy;
559
+ energyBar.style.width = `${gameState.energy}%`;
560
+ addToLog("The discovery invigorates you! +5 energy");
561
+ }
562
+ } else {
563
+ addToLog("You explore the area but don't find anything noteworthy.");
564
+ }
565
+
566
+ // Progress on discovery quest
567
+ progressQuest(1);
568
+
569
+ updateEnergy();
570
+ }
571
+
572
+ // Rest
573
+ function rest() {
574
+ const hour = gameState.time.getHours();
575
+
576
+ // Resting at night is more effective
577
+ const energyGain = (hour >= 21 || hour < 6) ? 30 : 15;
578
+
579
+ gameState.energy = Math.min(100, gameState.energy + energyGain);
580
+ energyElement.textContent = gameState.energy;
581
+ energyBar.style.width = `${gameState.energy}%`;
582
+
583
+ addToLog(`You rest and recover ${energyGain} energy.`);
584
+
585
+ // Small chance to dream about a new location
586
+ if (Math.random() > 0.7) {
587
+ addToLog("While resting, you have a vivid dream about a distant location...");
588
+ }
589
+ }
590
+
591
+ // Move location
592
+ function moveLocation() {
593
+ if (gameState.energy < 15) {
594
+ addToLog("Not enough energy to move!");
595
+ return;
596
+ }
597
+
598
+ gameState.energy = Math.max(0, gameState.energy - 15);
599
+ energyElement.textContent = gameState.energy;
600
+ energyBar.style.width = `${gameState.energy}%`;
601
+
602
+ addToLog("You set out to explore a new area...");
603
+
604
+ // Simulate moving by getting a new location
605
+ setTimeout(() => {
606
+ // In a real app, this would track actual movement
607
+ // For demo, we'll just slightly adjust coordinates
608
+ if (gameState.location) {
609
+ const latChange = (Math.random() - 0.5) * 0.02;
610
+ const lonChange = (Math.random() - 0.5) * 0.02;
611
+
612
+ gameState.location.lat += latChange;
613
+ gameState.location.lon += lonChange;
614
+
615
+ locationCoords.textContent = `${gameState.location.lat.toFixed(4)}, ${gameState.location.lon.toFixed(4)}`;
616
+ getLocationName(gameState.location.lat, gameState.location.lon);
617
+ getWeather(gameState.location.lat, gameState.location.lon);
618
+ generateLocationDescription();
619
+
620
+ addToLog("You've arrived at a new location!");
621
+
622
+ // Progress on movement quest
623
+ progressQuest(0);
624
+ }
625
+ }, 1500);
626
+
627
+ updateEnergy();
628
+ }
629
+
630
+ // Collect item
631
+ function collectItem() {
632
+ if (gameState.energy < 5) {
633
+ addToLog("Not enough energy to collect items!");
634
+ return;
635
+ }
636
+
637
+ gameState.energy = Math.max(0, gameState.energy - 5);
638
+ energyElement.textContent = gameState.energy;
639
+ energyBar.style.width = `${gameState.energy}%`;
640
+
641
+ // Items available depend on location and weather
642
+ let items = [];
643
+
644
+ if (gameState.weather.type === "sunny") {
645
+ items = ["sunstone", "wildflower", "feather"];
646
+ } else if (gameState.weather.type === "rain") {
647
+ items = ["rainwater vial", "mushroom", "frog"];
648
+ } else if (gameState.weather.type === "snow") {
649
+ items = ["icicle", "frost crystal", "winter berry"];
650
+ } else {
651
+ items = ["pebble", "twig", "strange seed"];
652
+ }
653
+
654
+ const collectedItem = items[Math.floor(Math.random() * items.length)];
655
+ gameState.inventory.push(collectedItem);
656
+
657
+ addToLog(`You collected a ${collectedItem}!`);
658
+
659
+ // Progress on collection quest
660
+ progressQuest(2);
661
+
662
+ updateEnergy();
663
+ }
664
+
665
+ // Progress quest
666
+ function progressQuest(questIndex) {
667
+ if (questIndex >= gameState.quests.length) return;
668
+
669
+ const quest = gameState.quests[questIndex];
670
+ quest.progress = Math.min(quest.target, quest.progress + 1);
671
+
672
+ if (quest.progress >= quest.target) {
673
+ addToLog(`Quest completed: ${quest.name}!`);
674
+
675
+ // Reward for completing quest
676
+ gameState.energy = Math.min(100, gameState.energy + 20);
677
+ energyElement.textContent = gameState.energy;
678
+ energyBar.style.width = `${gameState.energy}%`;
679
+ addToLog("Quest reward: +20 energy");
680
+
681
+ // Move to next quest
682
+ gameState.currentQuestIndex = (gameState.currentQuestIndex + 1) % gameState.quests.length;
683
+
684
+ // Reset current quest progress
685
+ quest.progress = 0;
686
+ }
687
+
688
+ updateQuestDisplay();
689
+ }
690
+
691
+ // Add to event log
692
+ function addToLog(message) {
693
+ const now = new Date();
694
+ const timeStr = now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' });
695
+
696
+ const logEntry = document.createElement('p');
697
+ logEntry.innerHTML = `<span class="text-yellow-300">[${timeStr}]</span> ${message}`;
698
+
699
+ // Remove placeholder if it exists
700
+ if (eventLog.firstChild && eventLog.firstChild.classList.contains('text-center')) {
701
+ eventLog.removeChild(eventLog.firstChild);
702
+ }
703
+
704
+ eventLog.insertBefore(logEntry, eventLog.firstChild);
705
+
706
+ // Limit log entries
707
+ if (eventLog.children.length > 10) {
708
+ eventLog.removeChild(eventLog.lastChild);
709
+ }
710
+ }
711
+
712
+ // Initialize the game when page loads
713
+ window.addEventListener('load', () => {
714
+ // Simulate loading time
715
+ setTimeout(initGame, 2000);
716
+ });
717
+ </script>
718
+ <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=scottobear/test-builds-for-scottobear" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
719
+ </html>
prompts.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ Write a game, playable on my phone, that incorporates my location, weather, and time of day into an adventure.