Heimasíða Prakkarans með öllu

Ef þú skráir þig inn, má sérðu ALLT um sinn.

Vaktin

af

tommur

Vaktin – Þinn stafræni vinur https://cdn.tailwindcss.com https://cdn.jsdelivr.net/npm/chart.js @import url(‘https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;600;800&display=swap’); body { font-family: ‘Plus Jakarta Sans’, sans-serif; background-color: #F8FAFC; color: #0F172A; -webkit-tap-highlight-color: transparent; } .section-fade { animation: fadeIn 0.4s ease-out forwards; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } .btn-pulse { animation: pulse-ring 2s infinite; } @keyframes pulse-ring { 0% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0.4); } 70% { box-shadow: 0 0 0 15px rgba(79, 70, 229, 0); } 100% { box-shadow: 0 0 0 0 rgba(79, 70, 229, 0); } } /* Helper for hiding elements */ .hidden { display: none !important; } Falls back to Simulation if blocked by iframe/browser. 2. Features: All requested times (5min to 4weeks), Rooms, Emergency Contacts. 3. UI: Friendly Icelandic interface. –>
🛡️ VAKTIN
🤝

Látum vita af okkur.

Hæ vinur. Skráðu þig inn svo við vitum að þú sért hress. Ef þú gleymir þér, látum við ástvini vita.

// — DATA — const next10 = [ {n: „Garpur3342“, t: „4 mín“}, {n: „Sif9901“, t: „12 mín“}, {n: „Kátur11“, t: „20 mín“}, {n: „Lilja44“, t: „35 mín“}, {n: „Bjartur88“, t: „45 mín“}, {n: „Halla90“, t: „50 mín“}, {n: „Orri33“, t: „1 klst“}, {n: „Gulla88“, t: „2 klst“}, {n: „Steini1“, t: „3 klst“}, {n: „Lóa99“, t: „4 klst“} ]; const overdue = [ {n: „Hulda2231“, l: „15 mín“, loc: „Vesturbær“}, {n: „Jónas8899“, l: „3 klst“, loc: „Kópavogur“} ]; // — UI HELPERS — function showSection(id) { [‘hero’, ‘register’, ‘dashboard’, ‘room’].forEach(i => document.getElementById(i).classList.add(‘hidden’)); document.getElementById(id).classList.remove(‘hidden’); window.scrollTo(0,0); } function closeModal(id) { document.getElementById(id).classList.add(‘hidden’); } // — GPS LOGIC (ROBUST FALLBACK) — function openGpsModal() { document.getElementById(‘gps-modal’).classList.remove(‘hidden’); // Reset modal state document.getElementById(‘gps-action-btn’).textContent = „Leita núna“; document.getElementById(‘gps-status-text’).innerHTML = ‘Við reynum að finna þig sjálfkrafa.
Smelltu á „Leita“ og samþykktu í vafranum.‘; } function useManualLocation() { closeModal(‘gps-modal’); document.getElementById(‘reg-loc’).focus(); } function executeGpsLogic() { const btn = document.getElementById(‘gps-action-btn’); const status = document.getElementById(‘gps-status-text’); const input = document.getElementById(‘reg-loc’); btn.textContent = „Leita…“; btn.disabled = true; status.innerHTML = „Bíð eftir svari frá vafra…
Ef ekkert gerist, smelltu á ‘Slá inn handvirkt’.„; // 1. Check basic support if (!navigator.geolocation) { simulateLocationResult(„Vafri styður ekki GPS“, input); return; } // 2. Attempt Geolocation navigator.geolocation.getCurrentPosition( async (pos) => { // Success! try { const res = await fetch(`https://nominatim.openstreetmap.org/reverse?format=json&lat=${pos.coords.latitude}&lon=${pos.coords.longitude}`); const data = await res.json(); const parts = data.display_name.split(‘,’); input.value = parts[0] + „, “ + (parts[1] || „“); } catch(e) { input.value = `${pos.coords.latitude.toFixed(4)}, ${pos.coords.longitude.toFixed(4)}`; } finalizeGps(input); }, (err) => { // Error/Denial -> FALLBACK SIMULATION for Demo purposes so user isn’t stuck console.warn(„GPS Access Denied or Failed. Using fallback.“); simulateLocationResult(„Tenging mistókst (Demo)“, input); }, { timeout: 6000 } ); } function simulateLocationResult(reason, input) { // This ensures the demo works even if the preview environment blocks GPS setTimeout(() => { input.value = „Reykjavík (Áætlað)“; // Fallback value finalizeGps(input); alert(„Gat ekki náð nákvæmu sambandi (líklega öryggisstillingar). Nota áætlaða staðsetningu.“); }, 1500); } function finalizeGps(input) { closeModal(‘gps-modal’); const btn = document.getElementById(‘gps-action-btn’); btn.disabled = false; // Visual feedback on the main input button const mainBtn = document.querySelector(‘button[onclick=“openGpsModal()“]’); mainBtn.textContent = „✅“; } // — REGISTRATION — function finishRegistration(e) { e.preventDefault(); const name = document.getElementById(‘reg-name’).value; const nick = name.substring(0, 5).replace(/\s/g, “).padEnd(4, ‘x’).substring(0, 5) + Math.floor(1000 + Math.random() * 9000); const loc = document.getElementById(‘reg-loc’).value; document.getElementById(‘display-nick’).textContent = nick; document.getElementById(‘dash-nick’).textContent = nick; document.getElementById(‘dash-loc’).textContent = loc; document.getElementById(‘user-pill’).classList.remove(‘hidden’); renderLists(); initChart(); showSection(‘dashboard’); } // — LISTS & CHART — function confirmOk() { document.getElementById(‘ok-modal’).classList.remove(‘hidden’); } function renderLists() { document.getElementById(‘next-10-list’).innerHTML = next10.map(i => `
${i.n} ${i.t}
`).join(“); document.getElementById(‘overdue-list’).innerHTML = overdue.map(i => `
${i.n} SEINKUN: ${i.l}

Stað: ${i.loc}

`).join(“); } function initChart() { new Chart(document.getElementById(‘scoreChart’), { type: ‘line’, data: { labels: [‘M’, ‘Þ’, ‘M’, ‘F’, ‘F’, ‘L’, ‘S’], datasets: [{ data: [60, 75, 80, 85, 90, 95, 100], borderColor: ‘#4F46E5’, backgroundColor: ‘rgba(79, 70, 229, 0.1)’, fill: true, tension: 0.4, borderWidth: 2, pointRadius: 0 }] }, options: { responsive: true, maintainAspectRatio: false, plugins: { legend: { display: false } }, scales: { x: {display: false}, y: {display: false} } } }); }

Færðu inn athugasemd