Resync
This commit is contained in:
@@ -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,🧪
|
||||
|
||||
|
@@ -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) {
|
||||
|
||||
@@ -96,13 +96,10 @@
|
||||
<strong>⏰ Important:</strong> The <strong>"Active Challenge"</strong> shows yesterday's monster.
|
||||
Log your steps from yesterday to see if your team caught it!
|
||||
</p>
|
||||
<p style="margin: 8px 0; line-height: 1.6; font-size: 14px; color: #aaa;">
|
||||
💡 You can enter steps for any past date, and catches will be updated automatically.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- Monster CSV Import Section -->
|
||||
<div class="import-section">
|
||||
<div class="import-section" style="display: none;">
|
||||
<h3>Admin: Import Monsters</h3>
|
||||
<p class="help-text">Upload CSV with columns: date, monster_name, monster_description, step_goal, monster_icon</p>
|
||||
<input type="file" id="monster-csv-file" accept=".csv">
|
||||
|
||||
@@ -56,7 +56,8 @@ function initializeDatabase() {
|
||||
`);
|
||||
|
||||
// Monster catches view - derived from actual step data
|
||||
// Drop the old table if it exists and recreate as a view
|
||||
// Drop the old table/view if it exists and recreate as a view
|
||||
db.run(`DROP VIEW IF EXISTS monster_catches`);
|
||||
db.run(`DROP TABLE IF EXISTS monster_catches`);
|
||||
db.run(`
|
||||
CREATE VIEW IF NOT EXISTS monster_catches AS
|
||||
|
||||
Reference in New Issue
Block a user