commit ab7f2b3c15f80d8f4e29231ad0ee481f1ff13da6
Author: root <root@hub.scroll.pub> Date: 2024-12-27 08:55:57 +0000 Subject: Initial commit diff --git a/body.html b/body.html new file mode 100644 index 0000000..9c453a0 --- /dev/null +++ b/body.html @@ -0,0 +1,58 @@ +<header> + <nav> + <div class="logo">FitPlan</div> + <div class="menu-toggle"> + <span></span> + <span></span> + <span></span> + </div> + <ul class="nav-links"> + <li><a href="#planner" aria-label="Go to planner">Planner</a></li> + <li><a href="#exercises" aria-label="View exercises">Exercises</a></li> + <li><a href="#save" aria-label="Save plan">Save Plan</a></li> + </ul> + </nav> +</header> + +<main> + <section class="hero"> + <h1>Create Your Perfect Workout Plan</h1> + <p>Drag and drop exercises to build your custom routine</p> + </section> + + <section id="planner" class="planner-grid"> + <div class="exercise-library"> + <h2>Exercise Library</h2> + <div class="exercise-list" id="exerciseList"> + <div class="exercise" draggable="true" data-exercise="Push-ups">Push-ups</div> + <div class="exercise" draggable="true" data-exercise="Squats">Squats</div> + <div class="exercise" draggable="true" data-exercise="Planks">Planks</div> + <div class="exercise" draggable="true" data-exercise="Lunges">Lunges</div> + <div class="exercise" draggable="true" data-exercise="Burpees">Burpees</div> + <div class="exercise" draggable="true" data-exercise="Mountain Climbers">Mountain Climbers</div> + </div> + </div> + + <div class="workout-plan"> + <h2>Your Workout Plan</h2> + <div class="plan-container" id="planContainer"> + <div class="day-column" data-day="Monday"> + <h3>Monday</h3> + <div class="drop-zone" data-day="Monday"></div> + </div> + <div class="day-column" data-day="Wednesday"> + <h3>Wednesday</h3> + <div class="drop-zone" data-day="Wednesday"></div> + </div> + <div class="day-column" data-day="Friday"> + <h3>Friday</h3> + <div class="drop-zone" data-day="Friday"></div> + </div> + </div> + </div> + </section> +</main> + +<footer> + <p>FitPlan - Your Personal Exercise Planner</p> +</footer> diff --git a/index.scroll b/index.scroll new file mode 100644 index 0000000..3d0cf84 --- /dev/null +++ b/index.scroll @@ -0,0 +1,8 @@ +buildHtml +baseUrl https://fitplan.scroll.pub +metaTags +editButton /edit.html +title FitPlan - Your Personal Exercise Planner +style.css +body.html +script.js diff --git a/readme.scroll b/readme.scroll new file mode 100644 index 0000000..6fa0491 --- /dev/null +++ b/readme.scroll @@ -0,0 +1,2 @@ +# fitplan.scroll.pub +Website generated by Claude from prompt: create a exercise planner having these excexises \ No newline at end of file diff --git a/script.js b/script.js new file mode 100644 index 0000000..8008bdf --- /dev/null +++ b/script.js @@ -0,0 +1,101 @@ +document.addEventListener('DOMContentLoaded', () => { + // Mobile menu toggle + const menuToggle = document.querySelector('.menu-toggle'); + const navLinks = document.querySelector('.nav-links'); + + menuToggle.addEventListener('click', () => { + navLinks.classList.toggle('active'); + }); + + // Drag and drop functionality + const exercises = document.querySelectorAll('.exercise'); + const dropZones = document.querySelectorAll('.drop-zone'); + + exercises.forEach(exercise => { + exercise.addEventListener('dragstart', dragStart); + exercise.addEventListener('dragend', dragEnd); + }); + + dropZones.forEach(zone => { + zone.addEventListener('dragover', dragOver); + zone.addEventListener('dragleave', dragLeave); + zone.addEventListener('drop', drop); + }); + + function dragStart(e) { + e.target.classList.add('dragging'); + e.dataTransfer.setData('text/plain', e.target.dataset.exercise); + } + + function dragEnd(e) { + e.target.classList.remove('dragging'); + } + + function dragOver(e) { + e.preventDefault(); + e.currentTarget.classList.add('dragover'); + } + + function dragLeave(e) { + e.currentTarget.classList.remove('dragover'); + } + + function drop(e) { + e.preventDefault(); + const exerciseName = e.dataTransfer.getData('text/plain'); + const exerciseElement = document.createElement('div'); + exerciseElement.className = 'exercise'; + exerciseElement.textContent = exerciseName; + + // Add remove functionality + exerciseElement.addEventListener('dblclick', function() { + this.remove(); + }); + + e.currentTarget.appendChild(exerciseElement); + e.currentTarget.classList.remove('dragover'); + } + + // Save functionality + const savePlan = () => { + const plan = {}; + dropZones.forEach(zone => { + const day = zone.parentElement.dataset.day; + const exercises = Array.from(zone.children).map(ex => ex.textContent); + plan[day] = exercises; + }); + localStorage.setItem('workoutPlan', JSON.stringify(plan)); + alert('Workout plan saved!'); + }; + + // Load saved plan + const loadPlan = () => { + const savedPlan = localStorage.getItem('workoutPlan'); + if (savedPlan) { + const plan = JSON.parse(savedPlan); + dropZones.forEach(zone => { + const day = zone.parentElement.dataset.day; + if (plan[day]) { + plan[day].forEach(exercise => { + const exerciseElement = document.createElement('div'); + exerciseElement.className = 'exercise'; + exerciseElement.textContent = exercise; + exerciseElement.addEventListener('dblclick', function() { + this.remove(); + }); + zone.appendChild(exerciseElement); + }); + } + }); + } + }; + + // Load saved plan on page load + loadPlan(); + + // Add save button functionality + document.querySelector('a[href="#save"]').addEventListener('click', (e) => { + e.preventDefault(); + savePlan(); + }); +}); diff --git a/style.css b/style.css new file mode 100644 index 0000000..61d2a3e --- /dev/null +++ b/style.css @@ -0,0 +1,166 @@ +:root { + --primary-color: #2c3e50; + --accent-color: #3498db; + --background-color: #f5f6fa; + --text-color: #2c3e50; + --shadow: 0 4px 6px rgba(0, 0, 0, 0.1); +} + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + font-family: 'Segoe UI', system-ui, sans-serif; + line-height: 1.6; + color: var(--text-color); + background: var(--background-color); +} + +header { + background: var(--primary-color); + padding: 1rem; + box-shadow: var(--shadow); +} + +nav { + max-width: 1200px; + margin: 0 auto; + display: flex; + justify-content: space-between; + align-items: center; +} + +.logo { + font-size: 1.5rem; + font-weight: bold; + color: white; +} + +.nav-links { + display: flex; + list-style: none; +} + +.nav-links li a { + color: white; + text-decoration: none; + padding: 0.5rem 1rem; + transition: color 0.3s ease; +} + +.nav-links li a:hover { + color: var(--accent-color); +} + +.menu-toggle { + display: none; + flex-direction: column; + gap: 5px; + cursor: pointer; +} + +.menu-toggle span { + width: 25px; + height: 3px; + background: white; + transition: 0.3s; +} + +.hero { + text-align: center; + padding: 4rem 1rem; + background: linear-gradient(135deg, var(--primary-color), var(--accent-color)); + color: white; +} + +.hero h1 { + font-size: 2.5rem; + margin-bottom: 1rem; +} + +.planner-grid { + max-width: 1200px; + margin: 2rem auto; + padding: 0 1rem; + display: grid; + grid-template-columns: 1fr 2fr; + gap: 2rem; +} + +.exercise-library, .workout-plan { + background: white; + padding: 1.5rem; + border-radius: 10px; + box-shadow: var(--shadow); +} + +.exercise { + background: var(--accent-color); + color: white; + padding: 1rem; + margin: 0.5rem 0; + border-radius: 5px; + cursor: move; + transition: transform 0.2s ease; +} + +.exercise:hover { + transform: translateY(-2px); +} + +.plan-container { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 1rem; +} + +.day-column { + background: var(--background-color); + padding: 1rem; + border-radius: 5px; +} + +.drop-zone { + min-height: 200px; + border: 2px dashed #ccc; + border-radius: 5px; + margin-top: 1rem; + padding: 1rem; +} + +.drop-zone.dragover { + background: rgba(52, 152, 219, 0.1); + border-color: var(--accent-color); +} + +@media (max-width: 768px) { + .planner-grid { + grid-template-columns: 1fr; + } + + .menu-toggle { + display: flex; + } + + .nav-links { + display: none; + position: absolute; + top: 100%; + left: 0; + right: 0; + background: var(--primary-color); + flex-direction: column; + padding: 1rem; + } + + .nav-links.active { + display: flex; + } + + .plan-container { + grid-template-columns: 1fr; + } +}