HIMANEESH123 commited on
Commit
bf12ecc
Β·
verified Β·
1 Parent(s): 05fdc43

Update static/app.js

Browse files
Files changed (1) hide show
  1. static/app.js +19 -2
static/app.js CHANGED
@@ -161,10 +161,18 @@ async function fetchPoses() {
161
  return STATE.poses;
162
  } catch (error) {
163
  console.error('[YogaMate] Error fetching poses:', error);
 
164
  STATE.poses = [
165
  { id: 'downward-dog', name: 'Downward Facing Dog', english: 'Downward Facing Dog', emoji: 'πŸ•', difficulty: 'Beginner', category: 'Standing', benefits: ['Stretches hamstrings', 'Lengthens spine'], steps: ['Start on hands and knees', 'Lift hips to sky'] },
166
  { id: 'warrior-2', name: 'Warrior II', english: 'Warrior II', emoji: 'βš”οΈ', difficulty: 'Beginner', category: 'Standing', benefits: ['Strengthens legs', 'Opens hips'], steps: ['Stand wide', 'Bend front knee'] },
167
  { id: 'tree', name: 'Tree Pose', english: 'Tree Pose', emoji: '🌳', difficulty: 'Beginner', category: 'Balancing', benefits: ['Improves balance', 'Strengthens ankles'], steps: ['Stand tall', 'Place foot on thigh'] },
 
 
 
 
 
 
 
168
  ];
169
  renderPoseGrid(STATE.poses);
170
  return STATE.poses;
@@ -176,7 +184,10 @@ function renderPoseGrid(poses = STATE.poses) {
176
  const grid = el('pose-grid');
177
  if (!grid) return;
178
 
179
- if (!poses || poses.length === 0) {
 
 
 
180
  grid.innerHTML = `
181
  <div style="grid-column:1/-1;text-align:center;padding:60px 20px;color:var(--text-secondary);">
182
  <div style="font-size:48px;margin-bottom:16px;">🧘</div>
@@ -187,7 +198,7 @@ function renderPoseGrid(poses = STATE.poses) {
187
  return;
188
  }
189
 
190
- grid.innerHTML = poses.map(p => {
191
  const isFav = STATE.favorites.includes(p.id);
192
  const diffClass = `pose-diff-${(p.difficulty || 'beginner').toLowerCase()}`;
193
 
@@ -203,6 +214,12 @@ function renderPoseGrid(poses = STATE.poses) {
203
  </div>
204
  `;
205
  }).join('');
 
 
 
 
 
 
206
  }
207
 
208
  // ─── Favorites ───
 
161
  return STATE.poses;
162
  } catch (error) {
163
  console.error('[YogaMate] Error fetching poses:', error);
164
+ // All Beginner level poses only - NO Intermediate
165
  STATE.poses = [
166
  { id: 'downward-dog', name: 'Downward Facing Dog', english: 'Downward Facing Dog', emoji: 'πŸ•', difficulty: 'Beginner', category: 'Standing', benefits: ['Stretches hamstrings', 'Lengthens spine'], steps: ['Start on hands and knees', 'Lift hips to sky'] },
167
  { id: 'warrior-2', name: 'Warrior II', english: 'Warrior II', emoji: 'βš”οΈ', difficulty: 'Beginner', category: 'Standing', benefits: ['Strengthens legs', 'Opens hips'], steps: ['Stand wide', 'Bend front knee'] },
168
  { id: 'tree', name: 'Tree Pose', english: 'Tree Pose', emoji: '🌳', difficulty: 'Beginner', category: 'Balancing', benefits: ['Improves balance', 'Strengthens ankles'], steps: ['Stand tall', 'Place foot on thigh'] },
169
+ { id: 'cobra', name: 'Cobra Pose', english: 'Cobra Pose', emoji: '🐍', difficulty: 'Beginner', category: 'Backbend', benefits: ['Strengthens spine', 'Opens chest'], steps: ['Lie face down', 'Press palms under shoulders', 'Lift chest up'] },
170
+ { id: 'mountain', name: 'Mountain Pose', english: 'Mountain Pose', emoji: 'πŸ”οΈ', difficulty: 'Beginner', category: 'Standing', benefits: ['Improves posture', 'Grounding'], steps: ['Stand tall', 'Press feet into ground'] },
171
+ { id: 'childs-pose', name: "Child's Pose", english: "Child's Pose", emoji: 'πŸ™', difficulty: 'Beginner', category: 'Restorative', benefits: ['Calms mind', 'Stretches back'], steps: ['Kneel down', 'Fold forward'] },
172
+ { id: 'cat-cow', name: 'Cat-Cow Pose', english: 'Cat-Cow Pose', emoji: '🐱', difficulty: 'Beginner', category: 'Warm-up', benefits: ['Spinal mobility', 'Relieves back tension'], steps: ['Start on hands and knees', 'Arch and round back'] },
173
+ { id: 'bridge', name: 'Bridge Pose', english: 'Bridge Pose', emoji: 'πŸŒ‰', difficulty: 'Beginner', category: 'Backbend', benefits: ['Strengthens back', 'Opens chest'], steps: ['Lie on back', 'Lift hips up'] },
174
+ { id: 'seated-forward', name: 'Seated Forward Bend', english: 'Seated Forward Bend', emoji: '🧘', difficulty: 'Beginner', category: 'Forward Bend', benefits: ['Stretches hamstrings', 'Calms mind'], steps: ['Sit with legs extended', 'Fold forward'] },
175
+ { id: 'butterfly', name: 'Butterfly Pose', english: 'Butterfly Pose', emoji: 'πŸ¦‹', difficulty: 'Beginner', category: 'Hip Opener', benefits: ['Opens hips', 'Stretches inner thighs'], steps: ['Sit with feet together', 'Press knees down'] },
176
  ];
177
  renderPoseGrid(STATE.poses);
178
  return STATE.poses;
 
184
  const grid = el('pose-grid');
185
  if (!grid) return;
186
 
187
+ // Take only the first 10 poses for the popular section
188
+ const popularPoses = poses.slice(0, 10);
189
+
190
+ if (!popularPoses || popularPoses.length === 0) {
191
  grid.innerHTML = `
192
  <div style="grid-column:1/-1;text-align:center;padding:60px 20px;color:var(--text-secondary);">
193
  <div style="font-size:48px;margin-bottom:16px;">🧘</div>
 
198
  return;
199
  }
200
 
201
+ grid.innerHTML = popularPoses.map(p => {
202
  const isFav = STATE.favorites.includes(p.id);
203
  const diffClass = `pose-diff-${(p.difficulty || 'beginner').toLowerCase()}`;
204
 
 
214
  </div>
215
  `;
216
  }).join('');
217
+
218
+ // Update the pose count display
219
+ const countEl = el('pose-count');
220
+ if (countEl) {
221
+ countEl.textContent = `Showing ${Math.min(poses.length, 10)} of ${poses.length} poses`;
222
+ }
223
  }
224
 
225
  // ─── Favorites ───