diff --git a/MindShift-Windows/MindShift-v1.0.5.apk b/MindShift-Windows/MindShift-v1.0.5.apk
new file mode 100644
index 0000000..5f98266
Binary files /dev/null and b/MindShift-Windows/MindShift-v1.0.5.apk differ
diff --git a/MindShift-Windows/package.json b/MindShift-Windows/package.json
index 71063d7..1ea59d8 100644
--- a/MindShift-Windows/package.json
+++ b/MindShift-Windows/package.json
@@ -1,6 +1,6 @@
{
"name": "mindshift-cbt-therapy",
- "version": "1.0.4",
+ "version": "1.0.5",
"description": "MindShift - Your personal CBT therapy companion for Windows 11",
"main": "src/main.js",
"homepage": "./",
diff --git a/MindShift-Windows/src/app.js b/MindShift-Windows/src/app.js
index e3e5a05..2c1a94d 100644
--- a/MindShift-Windows/src/app.js
+++ b/MindShift-Windows/src/app.js
@@ -1222,72 +1222,119 @@ function quickRelax() {
startGuidedRelaxation();
}
-// --- Guided Relaxation (5-4-3-2-1 Grounding) ---
+// --- Guided Relaxation (Mindfulness System) ---
let relaxationState = {
+ mode: null, // 'grounding', 'body_scan', 'visualization'
step: 0,
isActive: false,
- steps: [] // Will be populated dynamically based on language
+ isPaused: false,
+ steps: [],
+ timer: null,
+ duration: 0
};
-function getRelaxationSteps() {
+// Data Providers
+function getGroundingSteps() {
return [
- {
- title: t('guided_sight_title'),
- instruction: t('guided_sight_instruction'),
- sub: t('guided_sight_sub'),
- count: 5,
- icon: "👁️",
- color: "#64B5F6"
- },
- {
- title: t('guided_touch_title'),
- instruction: t('guided_touch_instruction'),
- sub: t('guided_touch_sub'),
- count: 4,
- icon: "✋",
- color: "#81C784"
- },
- {
- title: t('guided_sound_title'),
- instruction: t('guided_sound_instruction'),
- sub: t('guided_sound_sub'),
- count: 3,
- icon: "👂",
- color: "#FFB74D"
- },
- {
- title: t('guided_smell_title'),
- instruction: t('guided_smell_instruction'),
- sub: t('guided_smell_sub'),
- count: 2,
- icon: "👃",
- color: "#BA68C8"
- },
- {
- title: t('guided_taste_title'),
- instruction: t('guided_taste_instruction'),
- sub: t('guided_taste_sub'),
- count: 1,
- icon: "👅",
- color: "#E57373"
- }
+ { title: t('guided_sight_title'), instruction: t('guided_sight_instruction'), sub: t('guided_sight_sub'), count: 5, icon: "👁️", color: "#64B5F6" },
+ { title: t('guided_touch_title'), instruction: t('guided_touch_instruction'), sub: t('guided_touch_sub'), count: 4, icon: "✋", color: "#81C784" },
+ { title: t('guided_sound_title'), instruction: t('guided_sound_instruction'), sub: t('guided_sound_sub'), count: 3, icon: "👂", color: "#FFB74D" },
+ { title: t('guided_smell_title'), instruction: t('guided_smell_instruction'), sub: t('guided_smell_sub'), count: 2, icon: "👃", color: "#BA68C8" },
+ { title: t('guided_taste_title'), instruction: t('guided_taste_instruction'), sub: t('guided_taste_sub'), count: 1, icon: "👅", color: "#E57373" }
];
}
+function getBodyScanSteps() {
+ return [
+ { instruction: t('scan_intro'), duration: 5000 },
+ { instruction: t('scan_feet'), duration: 8000 },
+ { instruction: t('scan_legs'), duration: 8000 },
+ { instruction: t('scan_stomach'), duration: 8000 },
+ { instruction: t('scan_chest'), duration: 8000 },
+ { instruction: t('scan_shoulders'), duration: 8000 },
+ { instruction: t('scan_face'), duration: 8000 },
+ { instruction: t('scan_outro'), duration: 6000 }
+ ];
+}
+
+function getVisualizationSteps() {
+ return [
+ { instruction: t('vis_intro'), duration: 6000 },
+ { instruction: t('vis_step1'), duration: 10000 },
+ { instruction: t('vis_step2'), duration: 10000 },
+ { instruction: t('vis_step3'), duration: 10000 },
+ { instruction: t('vis_step4'), duration: 10000 },
+ { instruction: t('vis_outro'), duration: 8000 }
+ ];
+}
+
+// Entry Point
function startGuidedRelaxation() {
- relaxationState.step = 0;
- relaxationState.isActive = true;
- relaxationState.steps = getRelaxationSteps();
+ relaxationState = { mode: null, step: 0, isActive: true, isPaused: false, steps: [], timer: null, duration: 0 };
const overlay = document.createElement('div');
overlay.id = 'guided-relaxation-overlay';
overlay.className = 'guided-overlay';
document.body.appendChild(overlay);
- renderRelaxationStep();
+ // Add styles dynamically if not present (using the styles we wrote to guided-styles.css but injecting here for simplicity in single file context if needed, but best to rely on CSS file)
+ // Assuming guided-styles.css is linked or merged. For safety, we rely on the styles.css update.
+
+ renderModeSelection();
}
-function renderRelaxationStep() {
+function renderModeSelection() {
+ const overlay = document.getElementById('guided-relaxation-overlay');
+ if (!overlay) return;
+
+ overlay.innerHTML = `
+
+
+
+
+ ${t('guided_select_mode')}
+
+
+
+ 🌿
+ ${t('mode_grounding')}
+
+
+ 🧘
+ ${t('mode_body_scan')}
+
+
+ 🌄
+ ${t('mode_visualization')}
+
+
+ `;
+}
+
+function startSession(mode) {
+ relaxationState.mode = mode;
+ relaxationState.step = 0;
+ relaxationState.isActive = true;
+
+ const overlay = document.getElementById('guided-relaxation-overlay');
+ if (overlay) overlay.className = `guided-overlay mode-${mode}`;
+
+ if (mode === 'grounding') {
+ relaxationState.steps = getGroundingSteps();
+ renderGroundingStep();
+ } else if (mode === 'body_scan') {
+ relaxationState.steps = getBodyScanSteps();
+ runAutoSession();
+ } else if (mode === 'visualization') {
+ relaxationState.steps = getVisualizationSteps();
+ runAutoSession();
+ }
+}
+
+// --- Grounding Logic (Interactive) ---
+function renderGroundingStep() {
const overlay = document.getElementById('guided-relaxation-overlay');
if (!overlay || !relaxationState.isActive) return;
@@ -1312,24 +1359,20 @@ function renderRelaxationStep() {
${progressDots}
-