Shortcut - Rotate The Screen
.rotation-menu button:hover background: #f0f0f0;
// Close menu when clicking outside document.addEventListener('click', (e) => if (!this.rotateBtn.contains(e.target)) this.rotationMenu.classList.remove('active'); ); rotate the screen shortcut
switch(orientation) case 'portrait-primary': degrees = 0; break; case 'portrait-secondary': degrees = 180; break; case 'landscape-primary': degrees = 90; break; case 'landscape-secondary': degrees = 270; break; .rotation-menu button:hover background: #f0f0f0
setupEventListeners() // Toggle menu this.rotateBtn.addEventListener('click', (e) => e.stopPropagation(); this.rotationMenu.classList.toggle('active'); ); switch(orientation) case 'portrait-primary': degrees = 0
class ScreenRotationShortcut constructor() this.currentRotation = 0; this.isAutoRotate = false; this.init(); init() this.rotateBtn = document.getElementById('rotateBtn'); this.rotationMenu = document.getElementById('rotationMenu'); this.setupEventListeners(); this.loadSavedPreferences();