http
HTTP/1.1 200 OK
Content-Type: text/html
Permissions-Policy: idle-detection=(self)
<!DOCTYPE html>
<html>
<head><title>Team Chat</title></head>
<body>
<div id="presence">Status: Active</div>
<script>
const idleDetector = new IdleDetector();
idleDetector.addEventListener('change', () => {
const userState = idleDetector.userState;
const screenState = idleDetector.screenState;
if (userState === 'idle' || screenState === 'locked') {
document.getElementById('presence').textContent = 'Status: Away';
} else {
document.getElementById('presence').textContent = 'Status: Active';
}
});
idleDetector.start({threshold: 60000});
</script>
</body>
</html>