Changed around line 1
+ document.addEventListener('DOMContentLoaded', () => {
+ const analyzeBtn = document.getElementById('analyze-btn');
+ const workoutInput = document.getElementById('workout-input');
+ const exerciseList = document.getElementById('exercise-list');
+ const videoContainer = document.getElementById('video-container');
+
+ // Sample exercise database
+ const exerciseDatabase = {
+ 'burpee': {
+ description: 'A full-body exercise combining a squat, push-up, and jump',
+ videoId: 'TU8QYVW0gDU'
+ },
+ 'pull-up': {
+ description: 'Upper body exercise lifting body weight using overhead grip',
+ videoId: 'eGo4IYlbE5g'
+ },
+ 'deadlift': {
+ description: 'A weight training exercise lifting a loaded barbell off the ground',
+ videoId: 'op9kVnSso6Q'
+ }
+ };
+
+ analyzeBtn.addEventListener('click', () => {
+ const workout = workoutInput.value.toLowerCase();
+ const foundExercises = [];
+
+ // Simple parsing logic (can be expanded)
+ Object.keys(exerciseDatabase).forEach(exercise => {
+ if (workout.includes(exercise)) {
+ foundExercises.push(exercise);
+ }
+ });
+
+ displayExercises(foundExercises);
+ });
+
+ function displayExercises(exercises) {
+ exerciseList.innerHTML = '';
+ exercises.forEach(exercise => {
+ const exerciseDiv = document.createElement('div');
+ exerciseDiv.className = 'exercise-item';
+ exerciseDiv.innerHTML = `
+
${exercise.charAt(0).toUpperCase() + exercise.slice(1)}
+
${exerciseDatabase[exercise].description}
+ `;
+
+ exerciseDiv.addEventListener('click', () => {
+ document.querySelectorAll('.exercise-item').forEach(item => {
+ item.classList.remove('active');
+ });
+ exerciseDiv.classList.add('active');
+ showVideo(exercise);
+ });
+
+ exerciseList.appendChild(exerciseDiv);
+ });
+ }
+
+ function showVideo(exercise) {
+ const videoId = exerciseDatabase[exercise].videoId;
+ videoContainer.innerHTML = `
Changed around line 1
+ :root {
+ --primary-color: #2a2d34;
+ --accent-color: #ff4b4b;
+ --bg-color: #f5f5f7;
+ --text-color: #333;
+ --shadow: 0 4px 6px rgba(0,0,0,0.1);
+ }
+
+ * {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+ }
+
+ body {
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
+ line-height: 1.6;
+ color: var(--text-color);
+ background: var(--bg-color);
+ }
+
+ header {
+ background: var(--primary-color);
+ color: white;
+ padding: 2rem;
+ text-align: center;
+ box-shadow: var(--shadow);
+ }
+
+ h1 {
+ font-size: 2.5rem;
+ margin-bottom: 0.5rem;
+ background: linear-gradient(45deg, var(--accent-color), #ff8f8f);
+ -webkit-background-clip: text;
+ -webkit-text-fill-color: transparent;
+ }
+
+ .tagline {
+ font-size: 1.1rem;
+ opacity: 0.9;
+ }
+
+ .container {
+ max-width: 1200px;
+ margin: 2rem auto;
+ padding: 0 1rem;
+ }
+
+ .input-section {
+ background: white;
+ padding: 2rem;
+ border-radius: 12px;
+ box-shadow: var(--shadow);
+ margin-bottom: 2rem;
+ }
+
+ textarea {
+ width: 100%;
+ height: 150px;
+ padding: 1rem;
+ margin: 1rem 0;
+ border: 2px solid #ddd;
+ border-radius: 8px;
+ resize: vertical;
+ font-size: 1rem;
+ transition: border-color 0.3s ease;
+ }
+
+ textarea:focus {
+ border-color: var(--accent-color);
+ outline: none;
+ }
+
+ button {
+ background: var(--accent-color);
+ color: white;
+ border: none;
+ padding: 1rem 2rem;
+ border-radius: 8px;
+ cursor: pointer;
+ font-size: 1rem;
+ font-weight: 600;
+ transition: transform 0.2s ease, background-color 0.2s ease;
+ }
+
+ button:hover {
+ background: #ff3333;
+ transform: translateY(-2px);
+ }
+
+ .results-container {
+ display: grid;
+ grid-template-columns: 1fr 1fr;
+ gap: 2rem;
+ }
+
+ .workout-breakdown, .video-pane {
+ background: white;
+ padding: 2rem;
+ border-radius: 12px;
+ box-shadow: var(--shadow);
+ }
+
+ .exercise-item {
+ padding: 1rem;
+ margin: 0.5rem 0;
+ border-radius: 8px;
+ background: #f8f8f8;
+ cursor: pointer;
+ transition: background-color 0.2s ease;
+ }
+
+ .exercise-item:hover {
+ background: #eee;
+ }
+
+ .exercise-item.active {
+ background: var(--accent-color);
+ color: white;
+ }
+
+ #video-container {
+ margin-top: 1rem;
+ aspect-ratio: 16/9;
+ background: #f8f8f8;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border-radius: 8px;
+ }
+
+ footer {
+ background: var(--primary-color);
+ color: white;
+ padding: 1.5rem;
+ text-align: center;
+ margin-top: 4rem;
+ }
+
+ footer nav a {
+ color: white;
+ text-decoration: none;
+ margin: 0 1rem;
+ opacity: 0.8;
+ transition: opacity 0.2s ease;
+ }
+
+ footer nav a:hover {
+ opacity: 1;
+ }
+
+ @media (max-width: 768px) {
+ .results-container {
+ grid-template-columns: 1fr;
+ }
+
+ header {
+ padding: 1.5rem;
+ }
+
+ h1 {
+ font-size: 2rem;
+ }
+ }