Top Banner (Ad space)

Bottom Banner (Ad space)

Left Banner (Ad space)

Right Banner (Ad space)

⚠️ Tab is inactive. OffScreen may stop working.
Loading quote...

Welcome to OffScreen

This keeps your screen awake. No Start needed!

let wakeLock = null; const stopBtn = document.getElementById('stopBtn'); const startBtn = document.getElementById('startBtn'); const video = document.getElementById('silentVideo'); const notification = document.getElementById('notification'); const quoteBox = document.getElementById('quote-box'); const quotes = [ "Stay awake, stay inspired ✨", "Your focus determines your reality 🌟", "Dreams don’t work unless you do 💪", "Keep your screen alive, keep your goals alive 🎯", "Awake mode, activated — so are you! 🚀", "Greatness begins with not falling asleep 😴", "The future belongs to those who stay awake ⏰", "Stay alert, seize the moment! ⚡", "Awaken your potential, one moment at a time 🌈", "Keep shining, even in the dark 🌌", "No sleep, just dreams coming true 🥳", "Stay vigilant, create your destiny 🛠️", "Awake and ready to conquer the day! 🌅", "Your screen is your canvas, paint it bright! 🎨", "Awake mode: where ideas come to life! 💡", "Stay awake, stay curious! 🔍" ]; let quoteIndex = 0; let isTyping = false; function typeQuote(text, element, callback) { if (isTyping) return; isTyping = true; element.textContent = ''; let i = 0; function type() { if (i < text.length) { element.textContent += text.charAt(i); i++; setTimeout(type, 100); } else { isTyping = false; if (callback) callback(); } } type(); } function rotateQuotes() { if (isTyping) return; const quote = quotes[quoteIndex % quotes.length]; typeQuote(quote, quoteBox, () => { setTimeout(() => { quoteIndex++; rotateQuotes(); }, 3000); }); } async function requestWakeLock() { try { if (!window.isSecureContext) { showNotification("⚠️ OffScreen requires HTTPS for full functionality. Using video fallback."); video.play(); return; } if ('wakeLock' in navigator) { wakeLock = await navigator.wakeLock.request('screen'); wakeLock.addEventListener('release', () => { console.log('Wake Lock released'); video.play(); }); } else { showNotification("⚠️ Wake Lock API not supported. Using video fallback."); video.play(); } } catch (err) { console.error(`Wake Lock error: ${err.name}, ${err.message}`); showNotification("⚠️ Unable to use Wake Lock. Using video fallback."); video.play(); } } async function releaseWakeLock() { try { if (wakeLock !== null) { await wakeLock.release(); wakeLock = null; } } catch (err) { console.error(`Wake Lock release error: ${err.name}, ${err.message}`); } video.pause(); stopBtn.style.display = 'none'; startBtn.style.display = 'flex'; stopBtn.disabled = true; startBtn.disabled = false; } async function startOffScreen() { await requestWakeLock(); stopBtn.style.display = 'flex'; startBtn.style.display = 'none'; stopBtn.disabled = false; startBtn.disabled = true; } function showNotification(msg) { notification.textContent = msg; notification.style.display = 'block'; setTimeout(() => notification.style.display = 'none', 5000); } stopBtn.addEventListener('click', releaseWakeLock); startBtn.addEventListener('click', startOffScreen); setTimeout(rotateQuotes, 1000); requestWakeLock();