🎉 Added minimal performance optimizations to documentation and codebase.
This commit is contained in:
@@ -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');
|
||||
|
Reference in New Issue
Block a user