121 lines
5.9 KiB
PHP
121 lines
5.9 KiB
PHP
<?php
|
|
// --- Static Data Simulation ---
|
|
// In a real app, this would come from a database.
|
|
$workout_plan = [
|
|
'title' => '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'],
|
|
]
|
|
]
|
|
]
|
|
];
|
|
|
|
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 '<div class="exercise-card-wrapper col-lg-4 col-md-6 col-sm-12 mb-4">';
|
|
echo '<div class="exercise-card card h-100 shadow-sm border-0">';
|
|
echo '<div class="video-placeholder card-img-top" style="background-image: url('' . $video_url . '');">';
|
|
echo '<div class="play-icon"><i class="fas fa-play"></i></div>';
|
|
echo '</div>';
|
|
echo '<div class="card-body">';
|
|
echo '<h5 class="card-title">' . htmlspecialchars($exercise['name']) . '</h5>';
|
|
echo '<div class="details">';
|
|
echo '<span class="badge bg-primary-soft text-primary me-2">' . htmlspecialchars($exercise['reps']) . '</span>';
|
|
echo '<span class="badge bg-secondary-soft text-secondary">' . htmlspecialchars($exercise['sets']) . ' Sets</span>';
|
|
if (isset($exercise['rest'])) {
|
|
echo '<span class="badge bg-info-soft text-info ms-2">' . htmlspecialchars($exercise['rest']) . ' Rest</span>';
|
|
}
|
|
echo '</div>';
|
|
echo '</div>';
|
|
echo '</div>';
|
|
echo '</div>';
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title><?php echo htmlspecialchars($workout_plan['title']); ?> - Fitness App</title>
|
|
|
|
<!-- SEO Meta Tags -->
|
|
<meta name="description" content="Engage in a full-body workout designed for general fitness. Follow structured plans with video guides for every exercise.">
|
|
<meta name="keywords" content="fitness, workout, exercise, health, gym, home workout">
|
|
<meta name="author" content="FitApp">
|
|
|
|
<!-- Bootstrap 5 CDN -->
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
|
|
<!-- Font Awesome for Icons -->
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
|
|
|
|
<!-- Google Fonts -->
|
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap" rel="stylesheet">
|
|
|
|
<!-- Custom CSS -->
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
</head>
|
|
<body class="bg-light">
|
|
|
|
<div class="container-fluid workout-container py-5">
|
|
<header class="text-center mb-5">
|
|
<h1 class="display-5 fw-bold"><?php echo htmlspecialchars($workout_plan['title']); ?></h1>
|
|
<p class="lead text-muted">Estimated Duration: <?php echo htmlspecialchars($workout_plan['total_time']); ?></p>
|
|
<div class="progress mt-3 mx-auto" style="max-width: 500px; height: 10px;">
|
|
<div class="progress-bar" role="progressbar" style="width: 10%;" aria-valuenow="10" aria-valuemin="0" aria-valuemax="100"></div>
|
|
</div>
|
|
</header>
|
|
|
|
<?php foreach ($workout_plan['sections'] as $section): ?>
|
|
<section class="workout-section mb-5">
|
|
<h2 class="section-title h3 mb-4 ps-3"><?php echo htmlspecialchars($section['title']); ?> <small class="text-muted fw-normal">(<?php echo htmlspecialchars($section['duration']); ?>)</small></h2>
|
|
<div class="row">
|
|
<?php foreach ($section['exercises'] as $exercise): ?>
|
|
<?php render_exercise_card($exercise); ?>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
</section>
|
|
<?php endforeach; ?>
|
|
|
|
<footer class="text-center mt-5">
|
|
<button class="btn btn-primary btn-lg shadow-lg">
|
|
<i class="fas fa-check-circle me-2"></i> Mark Workout as Complete
|
|
</button>
|
|
</footer>
|
|
</div>
|
|
|
|
<!-- Bootstrap JS Bundle -->
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
|
<!-- Custom JS -->
|
|
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
|
</body>
|
|
</html>
|