Mindfulness Exercise Generator

Mindfulness Exercise Generator

Find a moment of peace tailored to your needs.

A Note on Practice

Mindfulness is a skill. Like any skill, it grows stronger with consistent practice. Be patient and kind to yourself.

Sit comfortably and close your eyes. Let your attention settle on the world of sound.

  1. Listen to the Layers: First, notice the most obvious sounds around you. Then, try to listen for more subtle sounds in the background. Can you hear sounds even further away?
  2. Observe without Judgment: Your mind might label sounds as 'annoying' or 'pleasant'. Try to let go of these labels and just experience the sounds as pure sensation—vibrations in the air.
  3. Notice the Silence: Pay attention to the brief moments of silence between sounds. What does the silence feel like?

When you are ready, gently bring your awareness back to the room.

" }, 5: { title: "5-Minute Breath & Thought Tracking", content: "

Sit in a stable, upright position. Close your eyes and bring your attention to your breath.

  1. Anchor to the Breath (2 mins): Focus on the sensation of breathing. Feel the air at your nostrils or the rise and fall of your chest. When your mind wanders, gently guide it back to the breath. This is the core practice of focus training.
  2. Label Your Thoughts (2 mins): Now, when your mind wanders, gently and without judgment, label the thought. For example, 'planning,' 'worrying,' 'remembering.' After labeling, guide your attention back to your breath. This helps you see your thoughts without getting lost in them.
  3. Rest in Awareness (1 min): For the final minute, let go of all effort. Simply sit, aware of your breath, your body, and the sounds around you, all at once.
" } }, anxiety: { 1: { title: "1-Minute Grounding", content: "

Stand or sit with your feet flat on the floor.

  1. Feel Your Feet: Press your feet firmly into the ground. Notice the sensation of the floor supporting you. Wiggle your toes.
  2. Name 3 Things: Look around and silently name three things you can see. Then, name three things you can hear.
  3. Take One Breath: Take one slow, deliberate breath in, and a long, complete breath out. Feel the stability of the ground beneath you.
" }, 3: { title: "3-Minute 'RAIN' Practice", content: "

This practice helps you work with difficult emotions. Sit quietly and bring a challenging feeling to mind.

  1. R - Recognize: Acknowledge what you are feeling. Silently say to yourself, 'anxiety is here' or 'I am feeling fear.'
  2. A - Allow: Allow the feeling to be there, just as it is. Don't try to push it away or fix it. Give it space.
  3. I - Investigate: With kindness, investigate the feeling. Where do you feel it in your body? Is it heavy or light? Buzzing or still? Be curious, not critical.
  4. N - Nurture: Offer yourself some kindness. You might place a hand over your heart and say something like, 'This is a moment of suffering. May I be kind to myself.'
" }, 5: { title: "5-Minute Safe Place Visualization", content: "

Find a comfortable position and close your eyes.

  1. Imagine a Place: Bring to mind a place where you feel completely safe, calm, and at ease. It can be a real place or an imaginary one—a beach, a forest, a cozy room.
  2. Engage Your Senses (3 mins): Use all your senses to make this place vivid. What do you see? What colors and shapes are there? What can you hear? Are there sounds of nature or quiet? What can you feel? The sun on your skin, a soft blanket? What can you smell?
  3. Breathe in Calm (1 min): As you rest in your safe place, imagine that with every inhale, you are breathing in a sense of peace and calm. With every exhale, you are releasing tension and anxiety.
  4. Return: Know that you can return to this place in your mind whenever you need to. Gently bring your awareness back to the present moment.
" } }, gratitude: { 1: { title: "1-Minute Gratitude Pause", content: "

Pause and take a gentle breath.

  1. One Simple Thing: Think of one simple thing in your life you are grateful for right now. It could be the chair you're sitting on, the coffee you're drinking, or the fact that the sun is shining.
  2. Feel It: For a few moments, truly connect with the feeling of gratitude for this one thing. Let the feeling fill you.
  3. Say Thank You: Silently or aloud, say 'thank you.' Carry that feeling with you.
" }, 3: { title: "3-Minute 'What Went Well?'", content: "

Sit quietly and let your gaze soften. Reflect on the last 24 hours.

  1. Identify Three Things: Bring to mind three things that went well, no matter how small. Perhaps a pleasant conversation, a task you completed, or a moment of beauty you noticed.
  2. Relive Each Moment: For each of the three things, take a moment to relive it in your mind. What happened? Who was there? What did it feel like?
  3. Acknowledge Your Role: For one of those things, consider what you did to help make it happen. Acknowledge your own effort or awareness.
" }, 5: { title: "5-Minute Body Gratitude", content: "

Sit or lie down comfortably. Close your eyes.

  1. Thank Your Feet & Legs (1 min): Bring your awareness to your feet and legs. Silently thank them for carrying you through your day, for allowing you to stand, walk, and run.
  2. Thank Your Hands & Arms (1 min): Move your awareness to your hands and arms. Thank them for all they do—lifting, holding, creating, and connecting with others.
  3. Thank Your Senses (2 mins): One by one, offer gratitude for your senses. Thank your eyes for seeing, your ears for hearing, your nose for smelling, your tongue for tasting, and your skin for feeling the world.
  4. Thank Your Breath (1 min): Finally, rest your attention on your breath. Thank this life-giving process that happens automatically, sustaining you in every moment.
" } }, body_scan: { 1: { title: "1-Minute Body Contact Scan", content: "

Wherever you are, bring your awareness to your body.

  1. Feet on Floor: Feel the precise sensation of your feet touching the ground. Notice the pressure, the texture, the temperature.
  2. Body on Seat: Feel the weight of your body on the chair or surface you're sitting on. Notice the points of contact.
  3. Hands at Rest: Notice where your hands are resting. Feel the sensation of your skin, or the texture of the fabric they are touching.
" }, 3: { title: "3-Minute Head-to-Heart Scan", content: "

Sit comfortably with your back straight. Close your eyes.

  1. Top of the Head: Bring your awareness to the very top of your head. Notice any sensations here—tingling, warmth, coolness.
  2. Face: Gently scan your awareness across your forehead, eyes, nose, and mouth. Notice the subtle sensations in the muscles of your face without trying to change them.
  3. Neck and Shoulders: Move your awareness down to your neck and shoulders, a common area for tension. Just notice what's there.
  4. Chest and Heart: Finally, rest your awareness in the area of your chest and heart. Feel the gentle rise and fall with each breath.
" }, 5: { title: "5-Minute Full Body Scan", content: "

Lie down on your back if possible, or sit comfortably. Close your eyes.

  1. Feet and Toes (1 min): Bring your full attention to the toes of your left foot. Notice any sensations—tingling, warmth, numbness—without judgment. Slowly scan up through your foot to your ankle. Repeat with the right foot.
  2. Legs (1 min): Move your awareness up both legs, from your calves to your knees and up to your thighs and hips. Notice the weight of your legs on the surface beneath you.
  3. Torso (1 min): Scan your attention up through your pelvis, abdomen, and chest. Feel the gentle movement of your breath. Then scan across your lower and upper back.
  4. Arms and Hands (1 min): Bring your awareness to your fingertips. Scan up through your hands, wrists, and all the way up your arms to your shoulders.
  5. Neck, Face, and Head (1min): Finally, scan your neck, your jaw, your face, and all the way to the top of your head. Then, for a few moments, be aware of your whole body breathing before you finish.
" } } }; // --- DOM Elements --- const focusAreaSelect = document.getElementById('focusArea'); const durationSelect = document.getElementById('duration'); const generateBtn = document.getElementById('generateBtn'); const resultsContainer = document.getElementById('resultsContainer'); const exerciseTitle = document.getElementById('exerciseTitle'); const exerciseContent = document.getElementById('exerciseContent'); const downloadPdfBtn = document.getElementById('downloadPdfBtn'); let lastExercise = null; // --- Initialization --- const init = () => { generateBtn.addEventListener('click', generateExercise); downloadPdfBtn.addEventListener('click', generatePDF); }; // --- Core Logic --- const generateExercise = () => { const focus = focusAreaSelect.value; const duration = durationSelect.value; const exercise = exercises[focus]?.[duration]; if (exercise) { lastExercise = exercise; exerciseTitle.textContent = exercise.title; exerciseContent.innerHTML = exercise.content; resultsContainer.classList.remove('hidden'); resultsContainer.scrollIntoView({ behavior: 'smooth' }); } else { alert("Sorry, an exercise for that combination could not be found."); } }; // --- PDF Generation --- const generatePDF = () => { if (!lastExercise) return; const { jsPDF } = window.jspdf; const pdf = new jsPDF({ orientation: 'portrait', unit: 'mm', format: 'a4' }); const margin = 20; const pdfWidth = pdf.internal.pageSize.getWidth(); let currentY = margin; pdf.setFont('helvetica', 'bold').setFontSize(22).text('Your Mindfulness Exercise', pdfWidth / 2, currentY, { align: 'center' }); currentY += 15; pdf.setFontSize(16).setFont('helvetica', 'bold').text(lastExercise.title, pdfWidth / 2, currentY, { align: 'center' }); currentY += 10; pdf.setDrawColor(220, 220, 220).line(margin, currentY, pdfWidth - margin, currentY); currentY += 15; // Convert HTML content to text for PDF const tempDiv = document.createElement('div'); tempDiv.innerHTML = lastExercise.content; pdf.setFontSize(11).setFont('helvetica', 'normal'); Array.from(tempDiv.childNodes).forEach(node => { if (currentY > 260) { pdf.addPage(); currentY = margin; } let textToPrint = ''; let isListItem = false; if (node.nodeName === 'P') { textToPrint = node.innerText; } else if (node.nodeName === 'OL') { Array.from(node.children).forEach((li, index) => { const itemText = li.innerText; const lines = pdf.splitTextToSize(itemText, pdfWidth - (margin * 2) - 10); pdf.setFont('helvetica', 'normal').text(lines, margin + 5, currentY); currentY += lines.length * 5 + 2; }); return; // Skip the generic text print below } const lines = pdf.splitTextToSize(textToPrint, pdfWidth - (margin * 2)); pdf.text(lines, margin, currentY); currentY += lines.length * 5 + 5; }); const pageHeight = pdf.internal.pageSize.getHeight(); pdf.setFontSize(9).setFont('helvetica', 'italic').text('Generated by the Mindfulness Exercise Generator.', pdfWidth / 2, pageHeight - 15, { align: 'center' }); pdf.save('My-Mindfulness-Exercise.pdf'); }; init(); });
Scroll to Top