The "Slide to Shut down" feature is not immediately visible to the average user, nor is it the default method for terminating a session. Unlike the prominent placement of the Power options in the Start Menu, this feature is typically hidden within the Windows Mobility Center or accessible via a command line ( slideToShutDown.exe ). Upon execution, it transforms the user's screen into a large, draggable curtain. The user is presented with a visual prompt to drag the screen downward, effectively "pulling" a shade over the operating system to power it off.
// snap back to 0 if not fully completed (except if exactly at max) if (currentTranslateX < maxOffset - 1) // smooth snap to zero (with animation transition) thumb.style.transition = 'transform 0.2s cubic-bezier(0.2, 0.9, 0.4, 1.1)'; setThumbOffset(0, true); // reset transition after animation setTimeout(() => if(thumb) thumb.style.transition = ''; , 220); // update status hint statusDiv.innerHTML = `<span>↺ Slid back — try again to shutdown</span>`; setTimeout(() => if(!shutdownTriggered && statusDiv.innerHTML.includes('↺ Slid back')) statusDiv.innerHTML = `<span>🔘 Drag the circle to the end ➔</span>`; , 1500); else if (currentTranslateX >= maxOffset - 0.5 && !shutdownTriggered) // ensure shutdown is triggered if at the edge performShutdown(); slide to shutdown windows 11
.slider-track background: rgba(255, 255, 255, 0.05); border-radius: 100px; position: relative; cursor: grab; transition: background 0.1s; The "Slide to Shut down" feature is not
// helper: update fill width based on translateX function updateFillAndLabel(offset) if (!fillDiv) return; const percentage = maxOffset > 0 ? (offset / maxOffset) : 0; const clamped = Math.min(1, Math.max(0, percentage)); fillDiv.style.width = (clamped * 100) + '%'; // optional dynamic label style: change opacity based on progress? not needed but nice const labelEl = document.getElementById('slideLabel'); if(labelEl && !shutdownTriggered) if(clamped >= 0.95) labelEl.style.opacity = '0.4'; else labelEl.style.opacity = '1'; The user is presented with a visual prompt
resetShutdownUI(); // also ensure that if we reset after shutdown, slider fully reinitialized recalcMaxOffset(); // force pointer release isDragging = false; );