lifeman / index.html
mrhappynice's picture
Upload 5 files
0816524 verified
Raw History Blame Contribute Delete
5.47 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>life-manager</title>
<!-- PWA: theme color (matches manifest) -->
<meta name="theme-color" content="#0f1014">
<!-- PWA: manifest -->
<link rel="manifest" href="manifest.webmanifest">
<link rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
</head>
<body>
<div class="container">
<header>
<div style="flex: 1; margin-right: 30px;">
<h1>Life Manager</h1>
<!-- NEW: Search Input similar to OS Site -->
<input type="search" id="search-input" placeholder="Search entries..." autocomplete="off"
style="width: 100%; max-width: 400px; padding: 10px; margin-bottom: 15px; border-radius: 8px; border: 1px solid #333; background: #0f1014; color: white;">
<div id="tag-filter-bar" class="filter-bar">
<!-- Buttons injected via JS -->
</div>
</div>
<div style="display:flex; gap:10px; align-items: flex-start;">
<!-- NEW: Data Controls -->
<div class="view-toggle">
<button class="toggle-btn" onclick="downloadData()" title="Download Backup">πŸ’Ύ</button>
<button class="toggle-btn" onclick="triggerImport()" title="Import Backup">πŸ“‚</button>
<button class="toggle-btn" onclick="openUrlModal()" title="Load from URL">🌐</button>
</div>
<!-- Existing View Toggles -->
<div class="view-toggle">
<button id="view-list" class="toggle-btn active" onclick="switchView('list')">List</button>
<button id="view-cal" class="toggle-btn" onclick="switchView('calendar')">Calendar</button>
</div>
<button onclick="openNew()" class="btn-primary" style="font-size:1.1rem;">+ New Entry</button>
</div>
<!-- NEW: Hidden Input for File Upload -->
<input type="file" id="import-file" accept=".json" style="display:none" onchange="handleFileImport(this)">
</header>
<div id="grid" class="grid"></div>
<div id="calendar-view" class="calendar-container hidden">
<div class="cal-header">
<button onclick="changeMonth(-1)">&#8592;</button>
<h2 id="cal-month-name">Month Year</h2>
<button onclick="changeMonth(1)">&#8594;</button>
</div>
<div class="cal-grid-header">
<div>Sun</div><div>Mon</div><div>Tue</div><div>Wed</div><div>Thu</div><div>Fri</div><div>Sat</div>
</div>
<div id="cal-days" class="cal-grid-days">
<!-- Javascript will inject days here -->
</div>
<div id="mobile-day-details" class="mobile-day-details hidden">
<h3 id="mobile-selected-date-title">Select a day...</h3>
<div id="mobile-event-list"></div>
</div>
</div>
</div>
<!-- Wizard Modal -->
<div id="modal" class="modal">
<div class="wizard-box">
<button onclick="closeModal()" style="float:right; background:none; border:none; color:#666; cursor:pointer; font-size:1.2rem;">&times;</button>
<div id="wizard-body">
<!-- Injected via JS -->
</div>
<div style="display:flex; justify-content:space-between; margin-top:30px;">
<button id="prev-btn" class="hidden" onclick="moveWizard(-1)" style="background:none; border:none; color:#888; cursor:pointer;">Back</button>
<button id="next-btn" class="hidden btn-primary" onclick="moveWizard(1)">Next</button>
</div>
</div>
</div>
<div id="url-modal" class="modal">
<div class="wizard-box" style="height: auto;">
<button onclick="closeUrlModal()" style="float:right; background:none; border:none; color:#666; cursor:pointer; font-size:1.2rem;">&times;</button>
<h2 style="margin-top:0; text-align:center;">Load Remote Data</h2>
<p style="color:#888; text-align:center; font-size:0.9rem;">
Enter a JSON URL or load the example data.
</p>
<div class="form-group">
<label>JSON File URL</label>
<input type="text" id="import-url-input" placeholder="https://example.com/data.json">
</div>
<button onclick="loadCustomUrl()" class="btn-primary" style="width:100%;">Fetch & Load</button>
<div style="display:flex; align-items:center; gap:10px; margin: 20px 0;">
<div style="flex:1; height:1px; background:#333;"></div>
<span style="color:#666; font-size:0.8rem;">OR</span>
<div style="flex:1; height:1px; background:#333;"></div>
</div>
<button onclick="loadExampleData()" class="btn-primary" style="width:100%; background: #2c303a; border:1px solid #444;">
πŸ“‚ Load Example Data (GitHub)
</button>
</div>
</div>
<script src="script.js"></script>
<script>
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js')
.catch(err => {
console.error('SW registration failed', err);
});
});
}
</script>
</body>
</html>