Rotate The Screen Shortcut ((better)) Info

init() this.rotateBtn = document.getElementById('rotateBtn'); this.rotationMenu = document.getElementById('rotationMenu'); this.setupEventListeners(); this.loadSavedPreferences();

.rotation-menu.active display: flex;

setupEventListeners() // Toggle menu this.rotateBtn.addEventListener('click', (e) => e.stopPropagation(); this.rotationMenu.classList.toggle('active'); ); rotate the screen shortcut

.rotation-menu button:hover background: #f0f0f0; init() this

rotateScreen(degrees) degrees === 270) document.body.style.width = `$window.innerHeightpx`; document.body.style.height = `$window.innerWidthpx`; else document.body.style.width = 'auto'; document.body.style.height = 'auto'; init() this.rotateBtn = document.getElementById('rotateBtn')

if (typeof DeviceOrientationEvent !== 'undefined' && typeof DeviceOrientationEvent.requestPermission === 'function') // iOS requires permission rotateBtn.addEventListener('click', async () => await DeviceOrientationEvent.requestPermission(); );