🎉 Added minimal performance optimizations to documentation and codebase.

This commit is contained in:
Till Tomczak
2025-06-20 08:46:41 +02:00
parent cbea4cb765
commit e0eab2b6b1
25 changed files with 431 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ class GlassmorphismNotificationSystem {
this.notifications = new Map();
this.toastCounter = 0;
this.soundEnabled = localStorage.getItem('myp-notification-sound') !== 'false';
this.animationsEnabled = !window.matchMedia('(prefers-reduced-motion: reduce)').matches;
this.animationsEnabled = window.matchMedia('(prefers-reduced-motion: no-preference)').matches && !this.isLowPerformanceDevice();
// Callback-Registry für Actions hinzufügen
this.actionCallbacks = new Map();
@@ -29,6 +29,14 @@ class GlassmorphismNotificationSystem {
console.log('🎨 Glassmorphism Notification System initialisiert');
}
isLowPerformanceDevice() {
return (
navigator.hardwareConcurrency <= 2 ||
navigator.deviceMemory <= 2 ||
/Android|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile|WPDesktop/i.test(navigator.userAgent)
);
}
createToastContainer() {
if (!document.getElementById('glassmorphism-toast-container')) {
const container = document.createElement('div');