Files
ash-pages/workout/template.html
T

108 lines
4.9 KiB
HTML

<!-- WORKOUT CARD TEMPLATE — copy this structure for new workout cards -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Workout: Day X — DATE</title>
<style>
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
background: #0f0f0f;
color: #e0e0e0;
min-height: 100vh;
display: flex;
justify-content: center;
padding: 40px 20px;
}
.container { max-width: 800px; width: 100%; }
h1 { font-size: 1.8rem; margin-bottom: 4px; color: #f97316; }
.breadcrumb { color: #666; margin-bottom: 24px; font-size: 0.85rem; }
.breadcrumb a { color: #888; text-decoration: none; }
.breadcrumb a:hover { color: #f97316; }
.date-header { color: #888; font-size: 0.9rem; margin-bottom: 16px; }
.day-badge { display: inline-block; background: rgba(249, 115, 22, 0.2); color: #f97316; padding: 4px 12px; border-radius: 16px; font-size: 0.85rem; font-weight: 500; margin-bottom: 24px; }
.section { margin-bottom: 32px; }
h2 { font-size: 1.2rem; color: #f97316; margin-bottom: 16px; }
.table {
background: rgba(255,255,255,0.04);
border: 1px solid rgba(255,255,255,0.08);
border-radius: 12px;
overflow: hidden;
}
.table table { width: 100%; border-collapse: collapse; }
.table th { background: rgba(255,255,255,0.08); padding: 12px 16px; text-align: left; font-weight: 500; font-size: 0.85rem; color: #888; }
.table td { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,0.08); font-size: 0.95rem; }
.exercise-name { font-weight: 500; }
.reps { color: #666; font-size: 0.9rem; }
.weight { color: #666; font-size: 0.9rem; }
.video-link { color: #4a9eff; text-decoration: none; font-size: 0.85rem; }
.video-link:hover { color: #6bb3ff; }
.form-note { color: #666; font-size: 0.85rem; font-style: italic; }
.note { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px; margin-top: 16px; color: #888; font-size: 0.85rem; }
.back-link { display: inline-block; color: #f97316; text-decoration: none; font-size: 0.85rem; margin-top: 32px; }
.back-link:hover { color: #ff8c42; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }
.wake-locked { position: fixed; bottom: 20px; right: 20px; background: rgba(249, 115, 22, 0.9); color: white; padding: 8px 16px; border-radius: 20px; font-size: 0.85rem; animation: pulse 2s infinite; display: none; }
</style>
</head>
<body>
<div class="container">
<p class="breadcrumb"><a href="../">Ash Pages</a> / <a href="index.html">Workouts</a> /</p>
<h1>💪 Workout Day</h1>
<div class="date-header">DATE_HERE</div>
<div class="day-badge">Day X — DESCRIPTION</div>
<!-- Main workout table -->
<div class="section">
<h2>Main Workout</h2>
<div class="table">
<table>
<thead><tr><th>#</th><th>Exercise</th><th>Reps</th><th>Weight</th><th>Form Video</th></tr></thead>
<tbody>
<!-- Fill in exercises from workout-program.org -->
</tbody>
</table>
</div>
<div class="note"><strong>Structure:</strong> 3 rounds, 60-90s rest</div>
</div>
<!-- Core finisher (if present in program) -->
<a href="index.html" class="back-link">← Back to workout list</a>
</div>
<div class="wake-locked" id="wakeLockStatus">Screen locked for workout</div>
<script>
// Wake Lock API — MUST use navigator.wakeLock, NOT window.WakeLock
let wakeLock = null;
async function requestWakeLock() {
try {
wakeLock = await navigator.wakeLock.request('screen');
const status = document.getElementById('wakeLockStatus');
status.style.display = 'block';
status.textContent = '🔒 Screen locked for workout';
wakeLock.addEventListener('release', () => { status.style.display = 'none'; wakeLock = null; });
} catch (err) {
const status = document.getElementById('wakeLockStatus');
status.style.display = 'block';
status.textContent = '⚠️ Wake lock not available';
status.style.background = 'rgba(100, 100, 100, 0.9)';
}
}
if ('wakeLock' in navigator) {
const btn = document.createElement('button');
btn.textContent = '🔒 Lock Screen';
btn.style.cssText = 'position:fixed;bottom:20px;left:20px;background:#f97316;color:white;border:none;padding:8px 16px;border-radius:20px;font-size:0.85rem;cursor:pointer;z-index:1000;';
btn.addEventListener('click', requestWakeLock);
document.body.appendChild(btn);
document.addEventListener('visibilitychange', async () => {
if (wakeLock !== null && document.visibilityState === 'visible') await requestWakeLock();
});
}
</script>
</body>
</html>