This scale assesses manic symptoms based on your clinical condition over the previous 48 hours. Please rate the severity of each item, considering both subjective report and clinical observations.
Scale Progress0 / 11 Items Rated
1
Elevated Mood
2
Increased Motor Activity-Energy
3
Sexual Interest
4
Sleep
5
Irritability
6
Speech (Rate and Amount)
7
Language-Thought Disorder
8
Content
9
Disruptive-Aggressive Behavior
10
Appearance
11
Insight
YMRS Score
0
/ 60
Remission / Euthymia
Score suggests symptoms are within the normal range or remission.
Disclaimer: The YMRS is a tool designed for use by trained clinicians to assess mania severity. This interactive version is for educational and informational purposes only and is not a substitute for professional medical evaluation, diagnosis, or treatment. If you have concerns about your mental health, please consult a qualified healthcare provider.
document.addEventListener('DOMContentLoaded', function() {
const form = document.getElementById('ymrs-form');
const resultsSection = document.getElementById('ymrs-results-section');
const scoreDisplay = document.getElementById('gauge-score');
const gaugeFill = document.getElementById('gauge-fill-circle');
const interpretationDisplay = document.getElementById('ymrs-interpretation');
const interpretationDetailDisplay = document.getElementById('ymrs-interpretation-detail');
const progressFill = document.getElementById('ymrs-progress-fill');
const progressText = document.getElementById('ymrs-progress-text');
const resetButton = document.getElementById('ymrs-reset-button');
const ymrsContainer = document.getElementById('ymrsContainer');
const questions = form.querySelectorAll('.ymrs-question');const totalQuestions = 11;
const maxScore = 60; // (7 items * 4 points) + (4 items * 8 points) = 28 + 32 = 60
const gaugeRadius = parseFloat(gaugeFill.getAttribute('r')); // e.g., 42%
const viewBoxSize = 100; // Assuming viewBox is "0 0 100 100"
const actualRadius = (gaugeRadius / 100) * (viewBoxSize / 2);
// Gauge covers 240 degrees (2/3 of circle)
const gaugeCircumference = (240 / 360) * 2 * Math.PI * actualRadius;// Add focus class for interaction visual feedback
questions.forEach(q => {
// Using mouseenter/mouseleave for hover effect persistence is tricky with radio groups
// Sticking to focus-within CSS for reliable interactive state indication
q.addEventListener('focusin', () => q.classList.add('focused'));
q.addEventListener('focusout', () => q.classList.remove('focused'));
});function calculateScore() {
let score = 0;
let answeredQuestions = 0;
const checkedRadios = form.querySelectorAll('input[type="radio"]:checked');checkedRadios.forEach(radio => {
score += parseInt(radio.value, 10);
answeredQuestions++;
});return { score, answeredQuestions };
}// Interpretation based on common clinical guidelines
function getInterpretation(score) {
let level = '';
let detail = '';
let colorVar = '--ymrs-remission'; // Default CSS variableif (score >= 0 && score = 12 && score = 20 && score = 26) { // Simplified '>25' as >=26
level = 'Severe Mania';
detail = 'Score indicates symptoms consistent with severe mania. Clinical evaluation is strongly recommended.';
colorVar = '--ymrs-severe';
} else {
level = 'Error';
detail = 'An error occurred calculating the score.';
colorVar = '--ymrs-gauge-track';
}
return { level, detail, colorVar };
}function updateGaugeVisuals(score, colorVar) {
const scorePercentage = Math.min(1, Math.max(0, score / maxScore)); // Clamp between 0 and 1
const severityColor = getComputedStyle(document.documentElement).getPropertyValue(colorVar).trim();// Arc Gauge Logic (Circle stroke-dashoffset)
const dashOffset = gaugeCircumference * (1 - scorePercentage);
gaugeFill.style.strokeDashoffset = Math.max(0, Math.min(gaugeCircumference, dashOffset));
gaugeFill.style.stroke = severityColor;scoreDisplay.textContent = score;
scoreDisplay.style.color = severityColor; // Match text color to gauge fill
}function updateUI() {
const { score, answeredQuestions } = calculateScore();
const { level, detail, colorVar } = getInterpretation(score);
const severityColor = getComputedStyle(document.documentElement).getPropertyValue(colorVar).trim();// Update Progress Bar
const progressPercentage = (answeredQuestions / totalQuestions) * 100;
progressFill.style.width = `${progressPercentage}%`;
progressText.textContent = `${answeredQuestions} / ${totalQuestions} Items Rated`;// Update Interpretation Text
interpretationDisplay.textContent = level;
interpretationDisplay.style.color = severityColor;
interpretationDetailDisplay.textContent = detail;// Update Gauge
updateGaugeVisuals(score, colorVar);// Toggle Reset Button Activation
if (answeredQuestions > 0) {
resetButton.classList.add('active');
} else {
resetButton.classList.remove('active');
}// Show/Hide Results Section
if (answeredQuestions === totalQuestions) {
if (!resultsSection.classList.contains('visible')) {
resultsSection.classList.add('visible');
// Smooth scroll to results only when first completed
setTimeout(() => {
resultsSection.scrollIntoView({ behavior: 'smooth', block: 'end' });
}, 150); // Slightly longer delay for animation
}
} else {
resultsSection.classList.remove('visible');
}
}function resetForm() {
form.reset();
updateUI();
resultsSection.classList.remove('visible');
resetButton.classList.remove('active');// Scroll back to the top
ymrsContainer.scrollIntoView({ behavior: 'smooth', block: 'start' });
}// --- Event Listeners ---
form.addEventListener('change', updateUI);
resetButton.addEventListener('click', resetForm);// Initial call to set defaults
updateUI();});/* --- EduLab 'All Scales' Button Styles (Refined Pathway) --- */
.edulab-button-container {
/* Centers the button horizontally */
text-align: center;
padding: 25px 0; /* Adds space above/below the button */
}.edulab-button.refined-pathway {
/* --- Fallback colors if CSS variables aren't available --- */
--accent-teal-bright-fb: #00f2ea;
--accent-lavender-soft-fb: #c8bfff;
--bg-deep-space-fb: #0a0f2e; /* Darkest background */
--bg-nebula-start-fb: #1a1f4b; /* Slightly lighter dark */
--text-primary-fb: #f0f0f5;
--font-main-fb: 'Poppins', sans-serif; /* Ensure this font is loaded on your site *//* --- Base Button Styling --- */
display: inline-block; /* Needed for centering via text-align */
position: relative;
padding: 15px 35px; /* Generous padding for visual presence */
margin: 10px 5px;
text-decoration: none;
font-family: var(--font-main, var(--font-main-fb));
font-weight: 600;
font-size: 1.1rem; /* Slightly larger font */
letter-spacing: 0.5px;
color: var(--accent-teal-bright, var(--accent-teal-bright-fb)); /* Bright teal text */
background-color: var(--bg-nebula-start, var(--bg-nebula-start-fb)); /* Dark base for contrast */
border: 2px solid var(--accent-teal-bright, var(--accent-teal-bright-fb));
border-radius: 10px; /* Softened corners */
overflow: hidden; /* Contains pseudo-elements */
cursor: pointer;
z-index: 1;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), /* Base shadow */
inset 0 0 8px rgba(0, 242, 234, 0.15); /* Subtle inner teal glow *//* --- Transitions --- */
transition: color 0.4s ease, background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease, transform 0.3s ease;
-webkit-backface-visibility: hidden; /* Smoother animations */
backface-visibility: hidden;
}/* --- Text Span --- */
.edulab-button.refined-pathway span {
position: relative;
z-index: 3; /* Always on top */
display: inline-block;
}/* --- Streaking Lines (Pseudo-elements) --- */
.edulab-button.refined-pathway::before,
.edulab-button.refined-pathway::after {
content: '';
position: absolute;
top: 0;
left: 0; /* Start from left edge */
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, var(--accent-teal-bright, var(--accent-teal-bright-fb)), transparent);
opacity: 0; /* Start hidden */
z-index: 2; /* Below text, above base background */
transform: skewX(-25deg) translateX(-150%); /* Start way off-screen */
transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1), opacity 0.4s ease;
}.edulab-button.refined-pathway::after {
background: linear-gradient(90deg, transparent, var(--accent-lavender-soft, var(--accent-lavender-soft-fb)), transparent);
transition-delay: 0.08s; /* Slightly adjusted stagger */
}/* --- Hover Effects --- */
.edulab-button.refined-pathway:hover {
color: var(--bg-deep-space, var(--bg-deep-space-fb)); /* Switch to dark text for HIGH CONTRAST */
background-color: var(--accent-teal-bright, var(--accent-teal-bright-fb)); /* Fill background with teal */
border-color: var(--accent-teal-bright, var(--accent-teal-bright-fb)); /* Border merges */
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), /* Lifted shadow */
0 0 30px rgba(0, 242, 234, 0.75); /* Stronger teal glow */
transform: translateY(-3px); /* Slight lift */
}.edulab-button.refined-pathway:hover::before,
.edulab-button.refined-pathway:hover::after {
transform: skewX(-25deg) translateX(150%); /* Sweep across */
opacity: 0.6; /* Make streaks visible */
}
.edulab-button.refined-pathway:hover::after {
opacity: 0.4; /* Lavender streak slightly fainter */
}/* --- Active (Click) Effects --- */
.edulab-button.refined-pathway:active {
transform: translateY(-1px) scale(0.98); /* Push down effect */
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2), /* Reduced shadow */
0 0 20px rgba(0, 242, 234, 0.6); /* Slightly reduced glow */
}