diff --git a/admin_edit_exercise.php b/admin_edit_exercise.php new file mode 100644 index 0000000..a9c67ed --- /dev/null +++ b/admin_edit_exercise.php @@ -0,0 +1,131 @@ +prepare("UPDATE exercises SET name = ?, description = ?, video_url = ?, muscle_group = ? WHERE id = ?"); + $stmt->execute([$name, $description, $video_url, $muscle_group, $id]); + } + header("Location: admin_exercises.php"); + exit; +} + +// Fetch the exercise +$stmt = db()->prepare("SELECT * FROM exercises WHERE id = ?"); +$stmt->execute([$id]); +$exercise = $stmt->fetch(); + +if (!$exercise) { + header("Location: admin_exercises.php"); + exit; +} +?> + + + + + + Edit Exercise + + + + + +
+

Edit Exercise

+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + Cancel +
+
+
+ + diff --git a/admin_exercises.php b/admin_exercises.php new file mode 100644 index 0000000..433679e --- /dev/null +++ b/admin_exercises.php @@ -0,0 +1,171 @@ +prepare("INSERT INTO exercises (name, description, video_url, muscle_group) VALUES (?, ?, ?, ?)"); + $stmt->execute([$name, $description, $video_url, $muscle_group]); + } + header("Location: admin_exercises.php"); + exit; +} + +// Handle deletion of an exercise +if (isset($_GET['delete'])) { + $id = $_GET['delete']; + $stmt = db()->prepare("DELETE FROM exercises WHERE id = ?"); + $stmt->execute([$id]); + header("Location: admin_exercises.php"); + exit; +} + +// Fetch all exercises +$stmt = db()->query("SELECT * FROM exercises ORDER BY created_at DESC"); +$exercises = $stmt->fetchAll(); +?> + + + + + + Exercise Management + + + + + +
+

Exercise Management

+ +
+

Add New Exercise

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+
+ +
+

Exercise Library

+
+ + + + + + + + + + + + + + + + + +
NameMuscle GroupActions
+ Edit + Delete +
+
+
+
+ + diff --git a/assets/css/custom.css b/assets/css/custom.css new file mode 100644 index 0000000..da0bb28 --- /dev/null +++ b/assets/css/custom.css @@ -0,0 +1,136 @@ +/* +Palette & Fonts: +--primary: #14b8a6; (Teal) +--secondary: #f97316; (Orange) +--background: #f8fafc; (Light Gray) +--surface: #ffffff; (White) +--text-color: #0f172a; (Dark Slate) +--font-family: 'Inter', sans-serif; +*/ + +:root { + --primary: #14b8a6; + --secondary: #f97316; + --info: #3b82f6; + --background: #f8fafc; + --surface: #ffffff; + --text-color: #0f172a; + --border-color: #e2e8f0; + --border-radius: 0.5rem; +} + +body { + font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; + background-color: var(--background); + color: var(--text-color); +} + +.workout-container { + max-width: 1200px; + margin: 0 auto; +} + +h1, h2, h3, h4, h5, h6 { + font-weight: 700; +} + +.section-title { + border-left: 4px solid var(--primary); + color: var(--text-color); +} + +.progress-bar { + background-color: var(--primary); +} + +.exercise-card { + border-radius: var(--border-radius); + transition: transform 0.3s ease, box-shadow 0.3s ease; + overflow: hidden; /* Ensures video placeholder respects border radius */ +} + +.exercise-card:hover { + transform: translateY(-5px); + box-shadow: 0 1rem 1.5rem rgba(0,0,0,0.1) !important; +} + +.video-placeholder { + height: 180px; + background-size: cover; + background-position: center; + position: relative; + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; +} + +.video-placeholder .play-icon { + color: white; + font-size: 3rem; + background-color: rgba(0,0,0,0.4); + border-radius: 50%; + width: 80px; + height: 80px; + display: flex; + align-items: center; + justify-content: center; + transition: transform 0.2s ease, background-color 0.2s ease; + backdrop-filter: blur(4px); +} + +.exercise-card:hover .play-icon { + transform: scale(1.1); + background-color: rgba(20, 184, 166, 0.7); +} + +.card-title { + font-weight: 600; + color: var(--text-color); +} + +/* Soft Badge Styles */ +.badge.bg-primary-soft { + background-color: rgba(20, 184, 166, 0.1); + color: #0d9488; +} + +.badge.bg-secondary-soft { + background-color: rgba(249, 115, 22, 0.1); + color: #d97706; +} + +.badge.bg-info-soft { + background-color: rgba(59, 130, 246, 0.1); + color: #2563eb; +} + +.btn-primary { + background: linear-gradient(45deg, var(--primary), #2dd4bf); + border: none; + padding: 0.75rem 1.5rem; + font-weight: 600; + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.btn-primary:hover { + transform: translateY(-2px); + box-shadow: 0 0.5rem 1rem rgba(20, 184, 166, 0.3) !important; +} + +/* Animation */ +.exercise-card-wrapper { + animation: fadeInUp 0.5s ease-out forwards; + opacity: 0; +} + +@keyframes fadeInUp { + from { + opacity: 0; + transform: translateY(20px); + } + to { + opacity: 1; + transform: translateY(0); + } +} diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..1955215 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,17 @@ +document.addEventListener('DOMContentLoaded', function () { + const cards = document.querySelectorAll('.exercise-card-wrapper'); + + const observer = new IntersectionObserver((entries) => { + entries.forEach((entry, index) => { + if (entry.isIntersecting) { + // Apply a staggered delay for the animation + entry.target.style.animationDelay = `${index * 100}ms`; + observer.unobserve(entry.target); + } + }); + }, { threshold: 0.1 }); + + cards.forEach(card => { + observer.observe(card); + }); +}); diff --git a/db/migrations/001_create_exercises_table.sql b/db/migrations/001_create_exercises_table.sql new file mode 100644 index 0000000..10d81d6 --- /dev/null +++ b/db/migrations/001_create_exercises_table.sql @@ -0,0 +1,9 @@ +CREATE TABLE IF NOT EXISTS exercises ( + id INT AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + description TEXT, + video_url VARCHAR(255), + muscle_group VARCHAR(100), + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP +); \ No newline at end of file diff --git a/index.php b/index.php index 7205f3d..a07872c 100644 --- a/index.php +++ b/index.php @@ -1,150 +1,121 @@ 'General Fitness - Week 1, Day 1', + 'total_time' => '45-60 min', + 'sections' => [ + [ + 'title' => 'Warm-up', + 'duration' => '5-10 min', + 'exercises' => [ + ['name' => 'Jumping Jacks', 'reps' => '30 seconds', 'sets' => 2, 'video_id' => '1047269'], + ['name' => 'Arm Circles', 'reps' => '15 each way', 'sets' => 1, 'video_id' => '1047274'], + ['name' => 'Leg Swings', 'reps' => '15 each leg', 'sets' => 1, 'video_id' => '1047279'], + ] + ], + [ + 'title' => 'Main Workout', + 'duration' => '30-40 min', + 'exercises' => [ + ['name' => 'Bodyweight Squats', 'reps' => '15', 'sets' => 3, 'rest' => '60s', 'video_id' => '4721626'], + ['name' => 'Push-ups (or Knee Push-ups)', 'reps' => '10-12', 'sets' => 3, 'rest' => '60s', 'video_id' => '4721630'], + ['name' => 'Plank', 'reps' => '30-60 seconds', 'sets' => 3, 'rest' => '60s', 'video_id' => '7030386'], + ['name' => 'Glute Bridges', 'reps' => '15', 'sets' => 3, 'rest' => '60s', 'video_id' => '7030390'], + ['name' => 'Dumbbell Rows (if available)', 'reps' => '12 each arm', 'sets' => 3, 'rest' => '60s', 'video_id' => '7030395'], + ] + ], + [ + 'title' => 'Cool-down', + 'duration' => '5-10 min', + 'exercises' => [ + ['name' => 'Quad Stretch', 'reps' => '30s each leg', 'sets' => 1, 'video_id' => '4761019'], + ['name' => 'Hamstring Stretch', 'reps' => '30s each leg', 'sets' => 1, 'video_id' => '4761025'], + ['name' => 'Chest Stretch', 'reps' => '30 seconds', 'sets' => 1, 'video_id' => '4761031'], + ] + ] + ] +]; -$phpVersion = PHP_VERSION; -$now = date('Y-m-d H:i:s'); +function render_exercise_card($exercise) { + $video_url = "https://images.pexels.com/videos/" . $exercise['video_id'] . "/pexels-photo-" . $exercise['video_id'] . ".jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500"; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
'; + echo '
' . htmlspecialchars($exercise['name']) . '
'; + echo '
'; + echo '' . htmlspecialchars($exercise['reps']) . ''; + echo '' . htmlspecialchars($exercise['sets']) . ' Sets'; + if (isset($exercise['rest'])) { + echo '' . htmlspecialchars($exercise['rest']) . ' Rest'; + } + echo '
'; + echo '
'; + echo '
'; + echo '
'; +} ?> - + - - - New Style - - - - - - - - - - - - - - - - - - - + + + <?php echo htmlspecialchars($workout_plan['title']); ?> - Fitness App + + + + + + + + + + + + + + + + + + + - -
-
-

Analyzing your requirements and generating your website…

-
- Loading… -
-

AI is collecting your requirements and applying the first changes.

-

This page will update automatically as the plan is implemented.

-

Runtime: PHP — UTC

+ + +
+
+

+

Estimated Duration:

+
+
+
+
+ + +
+

()

+
+ + + +
+
+ + +
-
- + + + + + - + \ No newline at end of file