| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="UTF-8"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| <title>YourDailyGym</title> |
| <link rel="preconnect" href="https://fonts.googleapis.com"> |
| <link href="https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"> |
| <style> |
| :root{ |
| --floor: #1C1B1A; |
| --floor-2: #242321; |
| --chalk: #F3F0E8; |
| --chalk-dim: #B9B6AC; |
| --yellow: #FFC72C; |
| --yellow-dim: #8A6A16; |
| --steel: #5C6670; |
| --red: #E24B4A; |
| --line: #35332F; |
| } |
| *{box-sizing:border-box;} |
| body{ |
| margin:0; |
| background: |
| repeating-linear-gradient(90deg, var(--floor) 0 78px, var(--floor-2) 78px 80px), |
| var(--floor); |
| color:var(--chalk); |
| font-family:'Inter',sans-serif; |
| min-height:100vh; |
| } |
| header{ |
| padding:56px 24px 32px; |
| text-align:center; |
| border-bottom:1px solid var(--line); |
| } |
| .brand{ |
| font-family:'Anton',sans-serif; |
| font-size:clamp(36px,7vw,64px); |
| letter-spacing:1px; |
| line-height:0.95; |
| margin:0; |
| color:var(--chalk); |
| } |
| .brand span{color:var(--yellow);} |
| .tagline{ |
| font-family:'JetBrains Mono',monospace; |
| font-size:13px; |
| letter-spacing:3px; |
| text-transform:uppercase; |
| color:var(--chalk-dim); |
| margin:12px 0 0; |
| } |
| main{ |
| max-width:640px; |
| margin:0 auto; |
| padding:40px 20px 100px; |
| } |
| .panel{ |
| background:var(--floor-2); |
| border:1px solid var(--line); |
| border-radius:10px; |
| padding:24px; |
| margin-bottom:40px; |
| } |
| .panel h2{ |
| font-family:'Anton',sans-serif; |
| font-weight:400; |
| letter-spacing:0.5px; |
| font-size:20px; |
| margin:0 0 18px; |
| color:var(--yellow); |
| } |
| label{ |
| display:block; |
| font-size:12px; |
| text-transform:uppercase; |
| letter-spacing:1.5px; |
| color:var(--chalk-dim); |
| margin:16px 0 6px; |
| } |
| label:first-of-type{margin-top:0;} |
| input[type="text"], textarea{ |
| width:100%; |
| background:var(--floor); |
| border:1px solid var(--line); |
| border-radius:6px; |
| color:var(--chalk); |
| font-family:'Inter',sans-serif; |
| font-size:15px; |
| padding:12px 14px; |
| resize:vertical; |
| } |
| textarea{min-height:130px; line-height:1.6; font-family:'JetBrains Mono',monospace; font-size:13.5px;} |
| input:focus, textarea:focus{ |
| outline:none; |
| border-color:var(--yellow-dim); |
| } |
| .hint{font-size:12px;color:var(--chalk-dim);margin-top:6px;} |
| button{ |
| margin-top:20px; |
| width:100%; |
| background:var(--yellow); |
| color:#231A00; |
| border:none; |
| border-radius:6px; |
| padding:14px; |
| font-family:'Inter',sans-serif; |
| font-weight:600; |
| font-size:15px; |
| letter-spacing:0.3px; |
| cursor:pointer; |
| transition:transform 0.08s ease, opacity 0.15s ease; |
| } |
| button:hover{opacity:0.92;} |
| button:active{transform:scale(0.98);} |
| .feed-heading{ |
| display:flex; |
| align-items:baseline; |
| justify-content:space-between; |
| margin-bottom:18px; |
| } |
| .feed-heading h2{ |
| font-family:'Anton',sans-serif; |
| font-weight:400; |
| font-size:20px; |
| letter-spacing:0.5px; |
| margin:0; |
| } |
| .feed-count{ |
| font-family:'JetBrains Mono',monospace; |
| font-size:12px; |
| color:var(--chalk-dim); |
| } |
| .card{ |
| background:var(--floor-2); |
| border:1px solid var(--line); |
| border-left:4px solid var(--yellow); |
| border-radius:8px; |
| padding:20px 22px; |
| margin-bottom:16px; |
| } |
| .card-top{ |
| display:flex; |
| justify-content:space-between; |
| align-items:flex-start; |
| gap:12px; |
| } |
| .card-date{ |
| font-family:'JetBrains Mono',monospace; |
| font-size:11.5px; |
| color:var(--yellow); |
| letter-spacing:1px; |
| text-transform:uppercase; |
| margin:0 0 6px; |
| } |
| .card-title{ |
| font-size:18px; |
| font-weight:600; |
| margin:0; |
| } |
| .del{ |
| background:transparent; |
| border:1px solid var(--line); |
| color:var(--chalk-dim); |
| width:auto; |
| margin:0; |
| padding:6px 10px; |
| font-size:12px; |
| border-radius:6px; |
| } |
| .del:hover{color:var(--red);border-color:var(--red);opacity:1;} |
| .card-body{ |
| white-space:pre-wrap; |
| font-family:'JetBrains Mono',monospace; |
| font-size:13.5px; |
| line-height:1.75; |
| color:var(--chalk-dim); |
| margin-top:14px; |
| border-top:1px solid var(--line); |
| padding-top:14px; |
| } |
| .empty{ |
| text-align:center; |
| color:var(--chalk-dim); |
| font-size:14px; |
| padding:40px 0; |
| border:1px dashed var(--line); |
| border-radius:8px; |
| } |
| </style> |
| </head> |
| <body> |
|
| <header> |
| <p class="brand">YOUR<span>DAILY</span>GYM</p> |
| <p class="tagline">one plan a day / no skipped sets</p> |
| </header> |
|
| <main> |
| <section class="panel"> |
| <h2>Post today's workout</h2> |
| <label for="title">Workout title</label> |
| <input type="text" id="title" placeholder="Push day / Leg day / Full body"> |
| <label for="plan">Exercises</label> |
| <textarea id="plan" placeholder="1. Bench press — 4x8 2. Incline dumbbell press — 3x10 3. Cable fly — 3x12 4. Tricep pushdown — 3x15"></textarea> |
| <p class="hint">One exercise per line. This posts with today's date.</p> |
| <button id="postBtn">Post today's plan</button> |
| </section> |
|
| <section> |
| <div class="feed-heading"> |
| <h2>The board</h2> |
| <span class="feed-count" id="count">0 plans posted</span> |
| </div> |
| <div id="feed"></div> |
| </section> |
| </main> |
|
| <script> |
| const STORAGE_KEY = 'yourdailygym_plans'; |
|
| function loadPlans(){ |
| try{ |
| const raw = localStorage.getItem(STORAGE_KEY); |
| return raw ? JSON.parse(raw) : []; |
| }catch(e){ |
| return []; |
| } |
| } |
|
| function savePlans(plans){ |
| localStorage.setItem(STORAGE_KEY, JSON.stringify(plans)); |
| } |
|
| function formatDate(iso){ |
| const d = new Date(iso); |
| return d.toLocaleDateString(undefined, { weekday:'short', month:'short', day:'numeric', year:'numeric' }); |
| } |
|
| function escapeHtml(str){ |
| const div = document.createElement('div'); |
| div.textContent = str; |
| return div.innerHTML; |
| } |
|
| function render(){ |
| const plans = loadPlans(); |
| const feed = document.getElementById('feed'); |
| const count = document.getElementById('count'); |
| count.textContent = plans.length + (plans.length === 1 ? ' plan posted' : ' plans posted'); |
|
| if(plans.length === 0){ |
| feed.innerHTML = '<div class="empty">No plans posted yet. Add today\'s workout above.</div>'; |
| return; |
| } |
|
| feed.innerHTML = plans |
| .slice() |
| .sort((a,b) => b.createdAt - a.createdAt) |
| .map(p => ` |
| <div class="card" data-id="${p.id}"> |
| <div class="card-top"> |
| <div> |
| <p class="card-date">${formatDate(p.createdAt)}</p> |
| <p class="card-title">${escapeHtml(p.title)}</p> |
| </div> |
| <button class="del" data-id="${p.id}">Delete</button> |
| </div> |
| <div class="card-body">${escapeHtml(p.plan)}</div> |
| </div> |
| `).join(''); |
|
| feed.querySelectorAll('.del').forEach(btn => { |
| btn.addEventListener('click', () => { |
| const id = btn.getAttribute('data-id'); |
| const updated = loadPlans().filter(p => String(p.id) !== id); |
| savePlans(updated); |
| render(); |
| }); |
| }); |
| } |
|
| document.getElementById('postBtn').addEventListener('click', () => { |
| const titleEl = document.getElementById('title'); |
| const planEl = document.getElementById('plan'); |
| const title = titleEl.value.trim(); |
| const plan = planEl.value.trim(); |
|
| if(!title || !plan){ |
| alert('Add a title and at least one exercise before posting.'); |
| return; |
| } |
|
| const plans = loadPlans(); |
| plans.push({ |
| id: Date.now(), |
| title, |
| plan, |
| createdAt: Date.now() |
| }); |
| savePlans(plans); |
|
| titleEl.value = ''; |
| planEl.value = ''; |
| render(); |
| }); |
|
| render(); |
| </script> |
|
| </body> |
| </html> |
|