Spaces:
Sleeping
Sleeping
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Exercise Video Upload</title> | |
| <style> | |
| /* Basic Reset */ | |
| * { | |
| margin: 0; | |
| padding: 0; | |
| box-sizing: border-box; | |
| } | |
| body { | |
| font-family: Arial, sans-serif; | |
| background-image: url('{{ url_for('static', filename='workouts_list.jpg') }}'); /* Replace with your image URL */ | |
| background-size: cover; /* Ensure the image covers the entire background */ | |
| background-position: center; /* Center the image */ | |
| background-attachment: fixed; /* Keep the background fixed while scrolling */ | |
| color: #ffa500; /* Orange text */ | |
| padding: 20px; | |
| text-align: center; | |
| } | |
| h1, h2 { | |
| color: #ffa500; /* Orange text */ | |
| margin-bottom: 20px; | |
| } | |
| .exercise-container { | |
| display: flex; | |
| flex-direction: column; /* Stack cards vertically */ | |
| justify-content: center; | |
| align-items: center; | |
| gap: 30px; /* Spacing between cards */ | |
| max-width: 800px; /* Limit container width */ | |
| margin: 0 auto; /* Center the container */ | |
| overflow-y: auto; /* Enable scrolling if needed */ | |
| padding: 10px; | |
| } | |
| .exercise-card { | |
| background-color: rgba(34, 34, 34, 0.8); /* Dark background with transparency */ | |
| border: 2px solid #ffa500; /* Orange border */ | |
| border-radius: 8px; | |
| width: 100%; /* Full width of container */ | |
| max-width: 500px; /* Restrict maximum width */ | |
| padding: 20px; | |
| text-align: center; | |
| box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3); | |
| transition: transform 0.3s, box-shadow 0.3s; | |
| } | |
| .exercise-card:hover { | |
| transform: translateY(-10px); | |
| box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2); | |
| } | |
| .exercise-card h2 { | |
| font-size: 1.5em; | |
| color: #ffa500; /* Orange text */ | |
| margin-bottom: 10px; | |
| } | |
| .exercise-card p { | |
| font-size: 1.2em; | |
| color: #ddd; /* Lighter text */ | |
| margin-bottom: 15px; | |
| } | |
| .upload-container { | |
| display: flex; | |
| flex-direction: column; /* Stack elements vertically */ | |
| align-items: center; /* Center align elements */ | |
| gap: 10px; /* Space between input and button */ | |
| } | |
| /* Hidden file input */ | |
| .hidden-file-input { | |
| position: absolute; | |
| opacity: 0; | |
| width: 0; | |
| height: 0; | |
| pointer-events: none; | |
| } | |
| /* Upload icon styling */ | |
| .upload-symbol { | |
| background-color: #ffa500; /* Orange background */ | |
| color: black; | |
| border: none; | |
| border-radius: 50%; | |
| width: 50px; | |
| height: 50px; | |
| display: flex; | |
| justify-content: center; | |
| align-items: center; | |
| cursor: pointer; | |
| font-size: 1.5em; | |
| transition: background-color 0.3s; | |
| } | |
| .upload-symbol:hover { | |
| background-color: #cc8400; /* Darker orange on hover */ | |
| } | |
| /* Upload button styling */ | |
| .upload-btn { | |
| background-color: #ffa500; /* Orange button */ | |
| color: black; | |
| font-size: 1em; | |
| padding: 10px 20px; | |
| border: none; | |
| border-radius: 5px; | |
| cursor: pointer; | |
| transition: background-color 0.3s; | |
| } | |
| .upload-btn:hover { | |
| background-color: #cc8400; /* Darker orange on hover */ | |
| } | |
| /* Finish button styling */ | |
| .finish-btn { | |
| background-color: #ffa500; /* Orange button */ | |
| color: black; | |
| font-size: 1em; | |
| padding: 10px 20px; | |
| border: none; | |
| border-radius: 5px; | |
| cursor: pointer; | |
| transition: background-color 0.3s; | |
| margin-top: 15px; /* Space from the other buttons */ | |
| } | |
| .finish-btn:hover { | |
| background-color: #cc8400; /* Darker orange on hover */ | |
| } | |
| /* Card scrolling animation */ | |
| @keyframes scroll-animation { | |
| 0% { | |
| opacity: 0; | |
| transform: translateY(50px); | |
| } | |
| 100% { | |
| opacity: 1; | |
| transform: translateY(0); | |
| } | |
| } | |
| /* Responsive Design */ | |
| @media (max-width: 768px) { | |
| .exercise-card { | |
| width: 90%; | |
| } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <header> | |
| <h1>Exercise List</h1> | |
| <p>Upload a video for each exercise you perform!</p> | |
| </header> | |
| <div class="exercise-container"> | |
| <!-- Dynamically render exercises --> | |
| {% for exercise in exercises %} | |
| <div class="exercise-card"> | |
| <h2>{{ exercise.name }}</h2> | |
| <p>Repetitions: {{ exercise.reps }}</p> | |
| <form class="upload-container" action="/upload-video/{{ exercise.name }}" method="POST" enctype="multipart/form-data"> | |
| <!-- Hidden file input --> | |
| <input type="file" name="video" accept="video/*" class="hidden-file-input" id="upload-{{ loop.index }}" required> | |
| <!-- Custom label acting as the upload button --> | |
| <label for="upload-{{ loop.index }}" class="upload-symbol">📤</label> | |
| <!-- Submit button --> | |
| <button type="submit" class="upload-btn">Start</button> | |
| </form> | |
| </div> | |
| {% endfor %} | |
| <button class="finish-btn" onclick="window.location.href='/daily-report'">Finish</button> | |
| </div> | |
| <h2>Live Processed Video</h2> | |
| <div> | |
| <img id="videoStream" src="/video_feed" alt="Live Processed Video" style="width: 100%; max-width: 800px; margin-top: 20px;"> | |
| </div> | |
| </body> | |
| </html> | |