Spaces:
Sleeping
Sleeping
Update static/app.js
Browse files- 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 |
-
|
|
|
|
|
|
|
|
|
|
| 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 =
|
| 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 βββ
|