(option)
| 273 | |
| 274 | // Handle graphics option changes |
| 275 | function handleGraphicsOptionChange(option) { |
| 276 | if (option === 'video-settings') { |
| 277 | // Show video settings popup |
| 278 | showVideoSettingsPopup(); |
| 279 | return; |
| 280 | } |
| 281 | |
| 282 | if (option === 'toggle-auto-bloom') { |
| 283 | // Don't process as regular option - handled by checkbox |
| 284 | return; |
| 285 | } |
| 286 | |
| 287 | // Determine URL parameter based on selection |
| 288 | let gfxParam = ''; |
| 289 | if (option === 'gfx-simple') { |
| 290 | gfxParam = '0'; // Force fast renderer |
| 291 | } else if (option === 'gfx-bloom') { |
| 292 | gfxParam = '1'; // Force ThreeJS renderer with bloom |
| 293 | } |
| 294 | |
| 295 | // Update URL and reload page with new graphics setting |
| 296 | const url = new URL(window.location); |
| 297 | if (gfxParam) { |
| 298 | url.searchParams.set('gfx', gfxParam); |
| 299 | } else { |
| 300 | url.searchParams.delete('gfx'); |
| 301 | } |
| 302 | |
| 303 | // Show a brief notification before reloading |
| 304 | const toast = document.createElement('div'); |
| 305 | toast.className = 'toast-notification'; |
| 306 | toast.textContent = `Switching to ${option.replace('-', ' ')}...`; |
| 307 | document.body.appendChild(toast); |
| 308 | |
| 309 | // Force reflow |
| 310 | void toast.offsetHeight; |
| 311 | toast.classList.add('toast-notification-show'); |
| 312 | |
| 313 | // Reload with new graphics setting after brief delay |
| 314 | setTimeout(() => { |
| 315 | window.location.href = url.toString(); |
| 316 | }, 500); |
| 317 | } |
| 318 | |
| 319 | // Video Settings Popup Functions - Optimized for encoding speed with MP4 compatibility |
| 320 | const videoSettingsDefaults = { |
no test coverage detected