acesesibiliti
This commit is contained in:
154
src/systems/ADHDAutismSupportSystem.js
Normal file
154
src/systems/ADHDAutismSupportSystem.js
Normal file
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* ADHD/AUTISM SUPPORT SYSTEM
|
||||
* Provides focus assistance and predictable UI for neurodivergent players
|
||||
*/
|
||||
class ADHDAutismSupportSystem {
|
||||
constructor(scene) {
|
||||
this.scene = scene;
|
||||
this.enabled = true;
|
||||
|
||||
// Settings
|
||||
this.settings = {
|
||||
focusMode: false, // Hide non-essential UI
|
||||
reminderSystem: true, // Task reminders
|
||||
simplifiedMenus: false, // Simplified navigation
|
||||
noJumpScares: true, // Disable sudden events
|
||||
predictableUI: true, // Consistent UI patterns
|
||||
reducedAnimations: false, // Less motion
|
||||
taskTimer: true, // Visual task timer
|
||||
breakReminders: true, // Regular break reminders
|
||||
soundWarnings: true // Warn before loud sounds
|
||||
};
|
||||
|
||||
// Reminder state
|
||||
this.reminders = [];
|
||||
this.lastBreakReminder = Date.now();
|
||||
this.breakInterval = 30 * 60 * 1000; // 30 minutes
|
||||
|
||||
// Focus mode overlay
|
||||
this.focusOverlay = null;
|
||||
|
||||
this.loadSettings();
|
||||
this.init();
|
||||
|
||||
console.log('✅ ADHD/Autism Support System initialized');
|
||||
}
|
||||
|
||||
init() {
|
||||
if (this.settings.focusMode) {
|
||||
this.enableFocusMode();
|
||||
}
|
||||
|
||||
if (this.settings.breakReminders) {
|
||||
this.startBreakReminders();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable focus mode (hide non-essential UI)
|
||||
*/
|
||||
enableFocusMode() {
|
||||
this.settings.focusMode = true;
|
||||
|
||||
// Create dark overlay for non-focused areas
|
||||
if (!this.focusOverlay) {
|
||||
this.createFocusOverlay();
|
||||
}
|
||||
|
||||
console.log('🎯 Focus mode enabled');
|
||||
this.saveSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Disable focus mode
|
||||
*/
|
||||
disableFocusMode() {
|
||||
this.settings.focusMode = false;
|
||||
|
||||
if (this.focusOverlay) {
|
||||
this.focusOverlay.setVisible(false);
|
||||
}
|
||||
|
||||
console.log('🎯 Focus mode disabled');
|
||||
this.saveSettings();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create focus mode overlay
|
||||
*/
|
||||
createFocusOverlay() {
|
||||
// Implementation would create a vignette effect
|
||||
console.log('Creating focus overlay...');
|
||||
}
|
||||
|
||||
/**
|
||||
* Add reminder
|
||||
*/
|
||||
addReminder(text, time) {
|
||||
this.reminders.push({ text, time });
|
||||
console.log(`⏰ Reminder added: ${text} at ${time}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Start break reminders
|
||||
*/
|
||||
startBreakReminders() {
|
||||
setInterval(() => {
|
||||
if (this.settings.breakReminders) {
|
||||
this.showBreakReminder();
|
||||
}
|
||||
}, this.breakInterval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show break reminder
|
||||
*/
|
||||
showBreakReminder() {
|
||||
const message = 'Take a break! You\'ve been playing for 30 minutes.';
|
||||
|
||||
if (this.scene.screenReader) {
|
||||
this.scene.screenReader.speak(message, 'alert');
|
||||
}
|
||||
|
||||
console.log('⏰ Break reminder shown');
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle simplified menus
|
||||
*/
|
||||
toggleSimplifiedMenus() {
|
||||
this.settings.simplifiedMenus = !this.settings.simplifiedMenus;
|
||||
this.saveSettings();
|
||||
console.log(`📋 Simplified menus: ${this.settings.simplifiedMenus ? 'ON' : 'OFF'}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Toggle no jump scares
|
||||
*/
|
||||
toggleNoJumpScares() {
|
||||
this.settings.noJumpScares = !this.settings.noJumpScares;
|
||||
this.saveSettings();
|
||||
console.log(`👻 No jump scares: ${this.settings.noJumpScares ? 'ON' : 'OFF'}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings
|
||||
*/
|
||||
saveSettings() {
|
||||
localStorage.setItem('novafarma_adhd_autism_support', JSON.stringify(this.settings));
|
||||
}
|
||||
|
||||
/**
|
||||
* Load settings
|
||||
*/
|
||||
loadSettings() {
|
||||
const saved = localStorage.getItem('novafarma_adhd_autism_support');
|
||||
if (saved) {
|
||||
this.settings = { ...this.settings, ...JSON.parse(saved) };
|
||||
}
|
||||
}
|
||||
|
||||
destroy() {
|
||||
console.log('🧠 ADHD/Autism Support System destroyed');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user