From a26c92ff2b01b474dfd79c201f22a383efa81e37 Mon Sep 17 00:00:00 2001
From: sascha
Date: Tue, 21 Oct 2025 22:29:44 +0200
Subject: [PATCH] Resync
---
monsters.csv | 8 ++++++--
public/app.js | 22 ++++++++++++++++++----
public/index.html | 5 +----
src/database.js | 3 ++-
4 files changed, 27 insertions(+), 11 deletions(-)
diff --git a/monsters.csv b/monsters.csv
index e833629..658b4ff 100644
--- a/monsters.csv
+++ b/monsters.csv
@@ -1,7 +1,11 @@
date,monster_name,monster_description,step_goal,monster_icon
-2025-10-17,Test Monster,Can you catch this spooky creature?,30000,๐ป
2025-10-20,Dracula,The Count demands your steps!,60000,๐ง
2025-10-21,Freddy Krueger,Don't fall asleep on your steps!,48000,๐ช
2025-10-22,Mummy,Unwrap your potential!,48000,๐ง
-2025-10-23,Aliens,Take steps to another world!,72000,๐ฝ
+2025-10-23,Xenomorph,The perfect organism hunts in the shadows!,72000,๐ฝ
2025-10-24,Predator,Hunt down those steps!,66000,๐น
+2025-10-27,Blob,This oozing creature is slow and easy to catch!,36000,๐ข
+2025-10-28,Godzilla,Each massive stride covers miles!,72000,๐ฆ
+2025-10-29,Werewolf,Fast and agile under the full moon!,78000,๐บ
+2025-10-30,Frankenstein's Monster,A lumbering creation seeks companionship!,48000,โก
+2025-10-31,Dr. Jekyll/Mr. Hyde,Two personalities - one fast chase!,66000,๐งช
diff --git a/public/app.js b/public/app.js
index b14c1c5..0ded3e4 100644
--- a/public/app.js
+++ b/public/app.js
@@ -13,8 +13,19 @@ document.addEventListener('DOMContentLoaded', () => {
setupEventListeners();
setDefaultDate();
handleRouting();
+ checkAdminMode();
});
+// Admin mode
+function checkAdminMode() {
+ const urlParams = new URLSearchParams(window.location.search);
+ if (urlParams.get('admin') === 'true') {
+ document.querySelectorAll('.import-section').forEach(el => {
+ el.style.display = 'block';
+ });
+ }
+}
+
// Routing
function handleRouting() {
// Handle initial load and hash changes
@@ -63,15 +74,17 @@ function initializeTabs() {
});
}
-// Set default date to today
+// Set default date to yesterday (since we enter steps the day after)
function setDefaultDate() {
- const today = new Date().toISOString().split('T')[0];
+ const yesterday = new Date();
+ yesterday.setDate(yesterday.getDate() - 1);
+ const yesterdayStr = yesterday.toISOString().split('T')[0];
const dateInput = document.getElementById('step-date');
- dateInput.value = today;
+ dateInput.value = yesterdayStr;
// Set max date to October 31, 2025
dateInput.max = '2025-10-31';
- dateInput.min = '2025-10-15';
+ dateInput.min = '2025-10-20';
}
// Load initial data
@@ -832,6 +845,7 @@ async function importMonsters() {
}
const overwrite = overwriteCheckbox.checked;
+ console.log('Overwrite checkbox checked:', overwrite);
// Confirm if overwrite is selected
if (overwrite) {
diff --git a/public/index.html b/public/index.html
index f88775a..76aaf75 100644
--- a/public/index.html
+++ b/public/index.html
@@ -96,13 +96,10 @@
โฐ Important: The "Active Challenge" shows yesterday's monster.
Log your steps from yesterday to see if your team caught it!
-
- ๐ก You can enter steps for any past date, and catches will be updated automatically.
-
-