Am I in Depression?

 ðŸ§  Am I in Depression? Understanding the Signs and Finding Hope 🌿

Depression is more than just feeling sad or tired—it’s a serious mental health condition that affects your thoughts, emotions, and even your physical health. Many people silently struggle with the question: “Am I in depression?” If you’ve been feeling low, disconnected, or overwhelmed for a long time, it’s important to understand what you’re going through and know that help is available. 💛



🌧️ What Is Depression?

Depression is a mood disorder that causes persistent sadness and a loss of interest in things you once enjoyed. It can interfere with your daily life, relationships, and work. Depression isn’t a sign of weakness—it’s a medical condition that requires care, just like any other illness.


⚠️ Common Signs You Might Be in Depression

If you’re wondering whether you might be experiencing depression, here are some common signs and symptoms to look out for:

  1. Constant Sadness or Emptiness – You feel hopeless or tearful most of the time.

  2. Loss of Interest – Activities that once made you happy no longer excite you.

  3. Fatigue and Low Energy – Even small tasks feel exhausting.

  4. Sleep Problems – You might sleep too much or struggle with insomnia.

  5. Changes in Appetite – You may eat too little or too much, causing weight changes.

  6. Difficulty Concentrating – Focusing or making decisions feels harder than usual.

  7. Negative Thoughts – You often feel worthless, guilty, or that life isn’t worth living.

If you notice several of these signs lasting for more than two weeks, it’s time to take your mental health seriously. 🕯️


💬 Why People Don’t Recognize Depression

Many people ignore depression because they believe it’s just stress or tiredness. Others hide their feelings due to fear, shame, or the idea that they must “stay strong.” But recognizing your feelings doesn’t make you weak—it makes you brave. The first step toward healing is acknowledging what you feel. 🌼


🩺 What You Can Do

Here are some steps you can take if you suspect you’re in depression:

  1. Talk to Someone You Trust – Share your feelings with a friend, family member, or counselor.

  2. Seek Professional Help – A therapist, psychologist, or psychiatrist can diagnose and guide you through recovery.

  3. Take a Depression Test Online – Free and confidential quizzes (like those on BetterHelp or Psychology Today) can help you understand your mental state better.

  4. Practice Self-Care – Eat healthy, get enough sleep, and move your body daily. Even a short walk can lift your mood.

  5. Avoid Isolation – Stay connected with loved ones, even when you don’t feel like it.

  6. Be Kind to Yourself – Healing takes time. Don’t blame yourself for feeling this way.


🌈 There Is Always Hope

Depression can make you feel like nothing will ever change—but that’s not true. Many people have overcome depression with support, therapy, and self-care. Every small step you take toward recovery counts. 🌻

You are not alone. If you or someone you know is struggling with depression or thoughts of self-harm, please reach out to a local mental health hotline or seek immediate help. 💬


💖 Final Thought

If you’ve been wondering, “Am I in depression?”, take it as a sign to pause and listen to yourself. You deserve peace, support, and happiness. Healing begins when you accept that you need it—and that’s something to be proud of. 🌟


HTML Script

<!DOCTYPE html>

<html lang="en">

<head>

    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Am I in Depression? - Mental Health Self-Assessment</title>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">

    <style>

        /* Base Styles */

        * {

            margin: 0;

            padding: 0;

            box-sizing: border-box;

            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

        }

        

        :root {

            --primary: #8A2BE2;

            --secondary: #4A00E0;

            --accent: #FF6B6B;

            --light: #F8F9FA;

            --dark: #2D3748;

            --gray: #718096;

        }

        

        body {

            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);

            color: var(--dark);

            line-height: 1.6;

            min-height: 100vh;

            display: flex;

            flex-direction: column;

            overflow-x: hidden;

        }

        

        /* Header Styles */

        header {

            background-color: rgba(255, 255, 255, 0.95);

            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);

            padding: 1.2rem 2rem;

            position: sticky;

            top: 0;

            z-index: 100;

            backdrop-filter: blur(10px);

        }

        

        .header-content {

            max-width: 1200px;

            margin: 0 auto;

            display: flex;

            justify-content: space-between;

            align-items: center;

        }

        

        .logo {

            display: flex;

            align-items: center;

            gap: 12px;

        }

        

        .logo-icon {

            font-size: 2.2rem;

            color: var(--primary);

            animation: pulse 2s infinite;

        }

        

        .logo-text {

            font-size: 1.8rem;

            font-weight: 800;

            color: var(--dark);

            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);

        }

        

        .tagline {

            font-size: 1rem;

            color: var(--gray);

            font-weight: 500;

        }

        

        /* Main Content Styles */

        main {

            flex: 1;

            display: flex;

            flex-direction: column;

            align-items: center;

            justify-content: center;

            padding: 2rem;

            max-width: 1200px;

            margin: 0 auto;

            width: 100%;

        }

        

        .hero-section {

            text-align: center;

            margin-bottom: 3rem;

            animation: fadeIn 1.5s ease-out;

            width: 100%;

        }

        

        .hero-title {

            font-size: 4rem;

            color: white;

            margin-bottom: 1.5rem;

            text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3);

            line-height: 1.2;

            animation: titleGlow 3s infinite alternate;

        }

        

        .hero-subtitle {

            font-size: 1.6rem;

            color: rgba(255, 255, 255, 0.9);

            max-width: 800px;

            margin: 0 auto 2.5rem;

            font-weight: 300;

        }

        

        .cta-button {

            display: inline-block;

            background-color: var(--accent);

            color: white;

            padding: 18px 50px;

            font-size: 1.3rem;

            font-weight: 700;

            border-radius: 50px;

            text-decoration: none;

            box-shadow: 0 8px 20px rgba(255, 107, 107, 0.5);

            transition: all 0.4s ease;

            cursor: pointer;

            border: none;

            position: relative;

            overflow: hidden;

        }

        

        .cta-button:before {

            content: '';

            position: absolute;

            top: 0;

            left: -100%;

            width: 100%;

            height: 100%;

            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);

            transition: 0.5s;

        }

        

        .cta-button:hover:before {

            left: 100%;

        }

        

        .cta-button:hover {

            transform: translateY(-5px);

            box-shadow: 0 12px 25px rgba(255, 107, 107, 0.7);

            background-color: #ff5252;

        }

        

        .floating-elements {

            position: absolute;

            width: 100%;

            height: 100%;

            top: 0;

            left: 0;

            overflow: hidden;

            z-index: -1;

        }

        

        .floating-element {

            position: absolute;

            background: rgba(255, 255, 255, 0.1);

            border-radius: 50%;

            animation: float 15s infinite linear;

        }

        

        .floating-element:nth-child(1) {

            width: 80px;

            height: 80px;

            top: 20%;

            left: 10%;

            animation-duration: 20s;

        }

        

        .floating-element:nth-child(2) {

            width: 120px;

            height: 120px;

            top: 60%;

            left: 80%;

            animation-duration: 25s;

        }

        

        .floating-element:nth-child(3) {

            width: 60px;

            height: 60px;

            top: 80%;

            left: 20%;

            animation-duration: 15s;

        }

        

        .floating-element:nth-child(4) {

            width: 100px;

            height: 100px;

            top: 30%;

            left: 70%;

            animation-duration: 30s;

        }

        

        /* Quiz Container */

        .quiz-container {

            background-color: white;

            border-radius: 25px;

            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);

            padding: 3.5rem;

            width: 100%;

            max-width: 850px;

            display: none;

            animation: slideUp 0.8s ease-out;

            position: relative;

            overflow: hidden;

        }

        

        .quiz-container:before {

            content: '';

            position: absolute;

            top: 0;

            left: 0;

            width: 100%;

            height: 8px;

            background: linear-gradient(90deg, var(--primary), var(--accent));

        }

        

        .quiz-title {

            text-align: center;

            color: var(--dark);

            margin-bottom: 2.5rem;

            font-size: 2.3rem;

            position: relative;

            display: inline-block;

            left: 50%;

            transform: translateX(-50%);

        }

        

        .quiz-title:after {

            content: '';

            position: absolute;

            bottom: -10px;

            left: 0;

            width: 100%;

            height: 4px;

            background: linear-gradient(90deg, var(--primary), var(--accent));

            border-radius: 2px;

        }

        

        .question {

            margin-bottom: 2.5rem;

            animation: fadeIn 0.8s ease-out;

            padding: 1.5rem;

            border-radius: 15px;

            background-color: rgba(248, 249, 250, 0.7);

            transition: all 0.3s ease;

        }

        

        .question:hover {

            background-color: rgba(248, 249, 250, 0.9);

            transform: translateY(-3px);

            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);

        }

        

        .question-text {

            font-size: 1.4rem;

            margin-bottom: 1.5rem;

            color: var(--dark);

            font-weight: 600;

        }

        

        .options {

            display: flex;

            flex-direction: column;

            gap: 12px;

        }

        

        .option {

            padding: 15px 25px;

            border: 2px solid #e0e0e0;

            border-radius: 12px;

            cursor: pointer;

            transition: all 0.3s ease;

            display: flex;

            align-items: center;

            gap: 12px;

            font-size: 1.1rem;

        }

        

        .option:hover {

            background-color: #f5f5f5;

            border-color: var(--primary);

            transform: translateX(5px);

        }

        

        .option.selected {

            background-color: var(--primary);

            color: white;

            border-color: var(--primary);

            transform: translateX(10px);

        }

        

        .option i {

            font-size: 1.2rem;

        }

        

        .navigation {

            display: flex;

            justify-content: space-between;

            margin-top: 2.5rem;

        }

        

        .nav-button {

            padding: 15px 30px;

            background: linear-gradient(135deg, var(--primary), var(--secondary));

            color: white;

            border: none;

            border-radius: 12px;

            cursor: pointer;

            font-size: 1.1rem;

            font-weight: 600;

            transition: all 0.3s ease;

            display: flex;

            align-items: center;

            gap: 8px;

            box-shadow: 0 4px 15px rgba(138, 43, 226, 0.3);

        }

        

        .nav-button:hover {

            transform: translateY(-3px);

            box-shadow: 0 6px 20px rgba(138, 43, 226, 0.4);

        }

        

        .nav-button:disabled {

            background: #cccccc;

            cursor: not-allowed;

            transform: none;

            box-shadow: none;

        }

        

        .progress-container {

            width: 100%;

            background-color: #e0e0e0;

            border-radius: 10px;

            margin: 2rem 0;

            height: 12px;

            overflow: hidden;

        }

        

        .progress-bar {

            height: 100%;

            background: linear-gradient(90deg, var(--primary), var(--accent));

            border-radius: 10px;

            width: 20%;

            transition: width 0.5s ease;

        }

        

        /* Results Section */

        .results-container {

            background-color: white;

            border-radius: 25px;

            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);

            padding: 3.5rem;

            width: 100%;

            max-width: 850px;

            text-align: center;

            display: none;

            animation: slideUp 0.8s ease-out;

            position: relative;

            overflow: hidden;

        }

        

        .results-container:before {

            content: '';

            position: absolute;

            top: 0;

            left: 0;

            width: 100%;

            height: 8px;

            background: linear-gradient(90deg, var(--primary), var(--accent));

        }

        

        .results-title {

            color: var(--dark);

            margin-bottom: 1.5rem;

            font-size: 2.5rem;

        }

        

        .score-display {

            font-size: 5rem;

            font-weight: 800;

            color: var(--primary);

            margin: 2rem 0;

            animation: pulse 2s infinite;

            text-shadow: 2px 2px 4px rgba(0,0,0,0.1);

        }

        

        .score-message {

            font-size: 1.4rem;

            margin-bottom: 2rem;

            color: #555;

            line-height: 1.8;

            padding: 0 1rem;

        }

        

        .resources-section {

            margin-top: 2.5rem;

            padding: 2rem;

            background: linear-gradient(135deg, #f8f9fa, #e9ecef);

            border-radius: 15px;

        }

        

        .resources-title {

            font-size: 1.5rem;

            margin-bottom: 1.5rem;

            color: var(--dark);

        }

        

        .resources-grid {

            display: grid;

            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));

            gap: 15px;

            margin-top: 1.5rem;

        }

        

        .resource-tool {

            background: white;

            padding: 1.5rem;

            border-radius: 12px;

            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);

            transition: all 0.3s ease;

            cursor: pointer;

            display: flex;

            flex-direction: column;

            align-items: center;

            gap: 10px;

        }

        

        .resource-tool:hover {

            transform: translateY(-5px);

            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);

        }

        

        .resource-tool i {

            font-size: 2rem;

            color: var(--primary);

        }

        

        .resource-tool span {

            font-weight: 600;

            color: var(--dark);

        }

        

        .resources-link {

            display: inline-block;

            margin-top: 1.5rem;

            color: var(--primary);

            text-decoration: none;

            font-weight: 700;

            border-bottom: 2px solid transparent;

            transition: all 0.3s ease;

            font-size: 1.1rem;

            padding: 10px 20px;

            border: 2px solid var(--primary);

            border-radius: 10px;

        }

        

        .resources-link:hover {

            background-color: var(--primary);

            color: white;

        }

        

        /* Footer Styles */

        footer {

            background-color: rgba(0, 0, 0, 0.85);

            color: white;

            padding: 2.5rem 2rem;

            text-align: center;

            margin-top: auto;

        }

        

        .footer-content {

            max-width: 1200px;

            margin: 0 auto;

        }

        

        .disclaimer {

            font-size: 0.9rem;

            color: #ccc;

            margin-top: 1.5rem;

            max-width: 800px;

            margin-left: auto;

            margin-right: auto;

            line-height: 1.6;

        }

        

        .footer-links {

            display: flex;

            justify-content: center;

            gap: 20px;

            margin-top: 1.5rem;

        }

        

        .footer-link {

            color: #aaa;

            text-decoration: none;

            transition: color 0.3s ease;

        }

        

        .footer-link:hover {

            color: white;

        }

        

        /* Animations */

        @keyframes fadeIn {

            from { opacity: 0; }

            to { opacity: 1; }

        }

        

        @keyframes slideUp {

            from { 

                opacity: 0;

                transform: translateY(30px);

            }

            to { 

                opacity: 1;

                transform: translateY(0);

            }

        }

        

        @keyframes pulse {

            0% { transform: scale(1); }

            50% { transform: scale(1.05); }

            100% { transform: scale(1); }

        }

        

        @keyframes titleGlow {

            0% { text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3); }

            100% { text-shadow: 3px 3px 15px rgba(255, 255, 255, 0.5); }

        }

        

        @keyframes float {

            0% { transform: translateY(0) rotate(0deg); }

            50% { transform: translateY(-20px) rotate(180deg); }

            100% { transform: translateY(0) rotate(360deg); }

        }

        

        /* Responsive Design */

        @media (max-width: 768px) {

            .hero-title {

                font-size: 2.8rem;

            }

            

            .hero-subtitle {

                font-size: 1.3rem;

            }

            

            .quiz-container, .results-container {

                padding: 2.5rem 2rem;

            }

            

            .question-text {

                font-size: 1.2rem;

            }

            

            .resources-grid {

                grid-template-columns: 1fr;

            }

        }

        

        @media (max-width: 480px) {

            .header-content {

                flex-direction: column;

                gap: 10px;

            }

            

            .hero-title {

                font-size: 2.2rem;

            }

            

            .quiz-container, .results-container {

                padding: 2rem 1.5rem;

            }

            

            .navigation {

                flex-direction: column;

                gap: 12px;

            }

            

            .nav-button {

                justify-content: center;

            }

        }

    </style>

</head>

<body>

    <div class="floating-elements">

        <div class="floating-element"></div>

        <div class="floating-element"></div>

        <div class="floating-element"></div>

        <div class="floating-element"></div>

    </div>

    

    <header>

        <div class="header-content">

            <div class="logo">

                <div class="logo-icon"><i class="fas fa-brain"></i></div>

                <div>

                    <div class="logo-text">Am I in Depression?</div>

                    <div class="tagline">Mental Health Self-Assessment Tool</div>

                </div>

            </div>

        </div>

    </header>

    

    <main>

        <section class="hero-section">

            <h1 class="hero-title">Am I in Depression?</h1>

            <p class="hero-subtitle">Take our quick, confidential assessment to better understand your mental health and get personalized insights.</p>

            <button class="cta-button" id="startQuiz">

                <i class="fas fa-play-circle"></i> Start Assessment Now

            </button>

        </section>

        

        <section class="quiz-container" id="quizContainer">

            <h2 class="quiz-title">Mental Health Assessment</h2>

            

            <div class="progress-container">

                <div class="progress-bar" id="progressBar"></div>

            </div>

            

            <div class="question" id="question1">

                <p class="question-text">1. Over the past two weeks, how often have you felt down, depressed, or hopeless?</p>

                <div class="options">

                    <div class="option" data-value="0">

                        <i class="far fa-smile"></i>

                        <span>Not at all</span>

                    </div>

                    <div class="option" data-value="1">

                        <i class="far fa-meh"></i>

                        <span>Several days</span>

                    </div>

                    <div class="option" data-value="2">

                        <i class="far fa-frown"></i>

                        <span>More than half the days</span>

                    </div>

                    <div class="option" data-value="3">

                        <i class="far fa-sad-tear"></i>

                        <span>Nearly every day</span>

                    </div>

                </div>

            </div>

            

            <div class="question" id="question2" style="display: none;">

                <p class="question-text">2. How often have you had little interest or pleasure in doing things?</p>

                <div class="options">

                    <div class="option" data-value="0">

                        <i class="far fa-smile"></i>

                        <span>Not at all</span>

                    </div>

                    <div class="option" data-value="1">

                        <i class="far fa-meh"></i>

                        <span>Several days</span>

                    </div>

                    <div class="option" data-value="2">

                        <i class="far fa-frown"></i>

                        <span>More than half the days</span>

                    </div>

                    <div class="option" data-value="3">

                        <i class="far fa-sad-tear"></i>

                        <span>Nearly every day</span>

                    </div>

                </div>

            </div>

            

            <div class="question" id="question3" style="display: none;">

                <p class="question-text">3. How often have you had trouble falling or staying asleep, or sleeping too much?</p>

                <div class="options">

                    <div class="option" data-value="0">

                        <i class="far fa-smile"></i>

                        <span>Not at all</span>

                    </div>

                    <div class="option" data-value="1">

                        <i class="far fa-meh"></i>

                        <span>Several days</span>

                    </div>

                    <div class="option" data-value="2">

                        <i class="far fa-frown"></i>

                        <span>More than half the days</span>

                    </div>

                    <div class="option" data-value="3">

                        <i class="far fa-sad-tear"></i>

                        <span>Nearly every day</span>

                    </div>

                </div>

            </div>

            

            <div class="question" id="question4" style="display: none;">

                <p class="question-text">4. How often have you felt tired or had little energy?</p>

                <div class="options">

                    <div class="option" data-value="0">

                        <i class="far fa-smile"></i>

                        <span>Not at all</span>

                    </div>

                    <div class="option" data-value="1">

                        <i class="far fa-meh"></i>

                        <span>Several days</span>

                    </div>

                    <div class="option" data-value="2">

                        <i class="far fa-frown"></i>

                        <span>More than half the days</span>

                    </div>

                    <div class="option" data-value="3">

                        <i class="far fa-sad-tear"></i>

                        <span>Nearly every day</span>

                    </div>

                </div>

            </div>

            

            <div class="question" id="question5" style="display: none;">

                <p class="question-text">5. How often have you had poor appetite or overeaten?</p>

                <div class="options">

                    <div class="option" data-value="0">

                        <i class="far fa-smile"></i>

                        <span>Not at all</span>

                    </div>

                    <div class="option" data-value="1">

                        <i class="far fa-meh"></i>

                        <span>Several days</span>

                    </div>

                    <div class="option" data-value="2">

                        <i class="far fa-frown"></i>

                        <span>More than half the days</span>

                    </div>

                    <div class="option" data-value="3">

                        <i class="far fa-sad-tear"></i>

                        <span>Nearly every day</span>

                    </div>

                </div>

            </div>

            

            <div class="navigation">

                <button class="nav-button" id="prevButton" disabled>

                    <i class="fas fa-arrow-left"></i> Previous

                </button>

                <button class="nav-button" id="nextButton">

                    Next <i class="fas fa-arrow-right"></i>

                </button>

            </div>

        </section>

        

        <section class="results-container" id="resultsContainer">

            <h2 class="results-title">Your Assessment Results</h2>

            <p>Based on your responses, here is your score:</p>

            <div class="score-display" id="scoreDisplay">0</div>

            <p class="score-message" id="scoreMessage"></p>

            <p>Remember, this is not a diagnosis. If you're concerned about your mental health, please consult a healthcare professional.</p>

            

            <div class="resources-section">

                <h3 class="resources-title">Mental Health Resources</h3>

                <p>Explore these resources for additional support and information:</p>

                

                <div class="resources-grid">

                    <div class="resource-tool" onclick="window.open('techpk', '_blank')">

                        <i class="fas fa-user-md"></i>

                        <span>Find a Therapist</span>

                    </div>

                    <div class="resource-tool" onclick="window.open('techpk', '_blank')">

                        <i class="fas fa-users"></i>

                        <span>Support Groups</span>

                    </div>

                    <div class="resource-tool" onclick="window.open('techpk', '_blank')">

                        <i class="fas fa-phone-alt"></i>

                        <span>Crisis Hotlines</span>

                    </div>

                    <div class="resource-tool" onclick="window.open('techpk', '_blank')">

                        <i class="fas fa-mobile-alt"></i>

                        <span>Mental Health Apps</span>

                    </div>

                </div>

                

                <a href="techpk" target="_blank" class="resources-link">

                    <i class="fas fa-search"></i> Find More Resources on Google

                </a>

            </div>

        </section>

    </main>

    

    <footer>

        <div class="footer-content">

            <p><strong>Am I in Depression? - Mental Health Self-Assessment Tool</strong></p>

            <div class="footer-links">

                <a href="techpk" class="footer-link">Privacy Policy</a>

                <a href="techpk" class="footer-link">Terms of Use</a>

                <a href="techpk" class="footer-link">Contact Us</a>

            </div>

            <p class="disclaimer">This assessment is based on the PHQ-9 screening tool and is for informational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment. If you are in crisis or think you may have an emergency, call your doctor or 911 immediately.</p>

        </div>

    </footer>


    <script>

        document.addEventListener('DOMContentLoaded', function() {

            // Elements

            const startQuizButton = document.getElementById('startQuiz');

            const quizContainer = document.getElementById('quizContainer');

            const resultsContainer = document.getElementById('resultsContainer');

            const prevButton = document.getElementById('prevButton');

            const nextButton = document.getElementById('nextButton');

            const scoreDisplay = document.getElementById('scoreDisplay');

            const scoreMessage = document.getElementById('scoreMessage');

            const progressBar = document.getElementById('progressBar');

            

            // Quiz state

            let currentQuestion = 1;

            let userAnswers = [0, 0, 0, 0, 0];

            

            // Start quiz

            startQuizButton.addEventListener('click', function() {

                document.querySelector('.hero-section').style.display = 'none';

                quizContainer.style.display = 'block';

                showQuestion(currentQuestion);

            });

            

            // Show specific question

            function showQuestion(questionNum) {

                // Hide all questions

                for (let i = 1; i <= 5; i++) {

                    document.getElementById(`question${i}`).style.display = 'none';

                }

                

                // Show current question

                document.getElementById(`question${questionNum}`).style.display = 'block';

                

                // Update navigation buttons

                prevButton.disabled = (questionNum === 1);

                nextButton.textContent = (questionNum === 5) ? 'See Results' : 'Next';

                nextButton.innerHTML = (questionNum === 5) ? 'See Results <i class="fas fa-chart-bar"></i>' : 'Next <i class="fas fa-arrow-right"></i>';

                

                // Update progress bar

                progressBar.style.width = `${questionNum * 20}%`;

                

                // Select previously chosen option if exists

                const options = document.querySelectorAll(`#question${questionNum} .option`);

                options.forEach(option => {

                    option.classList.remove('selected');

                    if (parseInt(option.getAttribute('data-value')) === userAnswers[questionNum - 1]) {

                        option.classList.add('selected');

                    }

                });

            }

            

            // Option selection

            document.querySelectorAll('.option').forEach(option => {

                option.addEventListener('click', function() {

                    const questionId = this.closest('.question').id;

                    const questionNum = parseInt(questionId.replace('question', ''));

                    

                    // Remove selected class from all options in this question

                    this.parentElement.querySelectorAll('.option').forEach(opt => {

                        opt.classList.remove('selected');

                    });

                    

                    // Add selected class to clicked option

                    this.classList.add('selected');

                    

                    // Store the answer

                    userAnswers[questionNum - 1] = parseInt(this.getAttribute('data-value'));

                });

            });

            

            // Navigation

            prevButton.addEventListener('click', function() {

                if (currentQuestion > 1) {

                    currentQuestion--;

                    showQuestion(currentQuestion);

                }

            });

            

            nextButton.addEventListener('click', function() {

                if (currentQuestion < 5) {

                    currentQuestion++;

                    showQuestion(currentQuestion);

                } else {

                    // Open adsterra in a new tab when "See Results" is clicked

                    window.open('techpk', '_blank');

                    

                    // Calculate and show results

                    calculateResults();

                }

            });

            

            // Calculate results

            function calculateResults() {

                const totalScore = userAnswers.reduce((sum, value) => sum + value, 0);

                

                // Display score

                scoreDisplay.textContent = totalScore;

                

                // Determine message based on score

                let message = '';

                if (totalScore <= 4) {

                    message = 'Your responses suggest minimal signs of depression. Continue to prioritize your mental wellbeing with self-care practices and maintaining healthy routines.';

                } else if (totalScore <= 9) {

                    message = 'Your responses suggest mild symptoms of depression. Consider speaking with a healthcare provider and implementing self-care strategies.';

                } else if (totalScore <= 14) {

                    message = 'Your responses suggest moderate symptoms of depression. We recommend consulting with a mental health professional to discuss your symptoms and treatment options.';

                } else if (totalScore <= 19) {

                    message = 'Your responses suggest moderately severe symptoms of depression. Please seek professional help as soon as possible to address these concerns.';

                } else {

                    message = 'Your responses suggest severe symptoms of depression. It is important to consult with a healthcare provider immediately to discuss appropriate treatment options.';

                }

                

                scoreMessage.textContent = message;

                

                // Show results container

                quizContainer.style.display = 'none';

                resultsContainer.style.display = 'block';

            }

        });

    </script>

</body>

</html>

No comments:

Post a Comment

If you have any question you can ask me feelfree.