mirror of
https://github.com/litruv/lit.ruv.wtf.git
synced 2026-07-24 02:36:02 +10:00
feat: add skip functionality to boot animation and update chat room alias
This commit is contained in:
@@ -91,10 +91,35 @@ function runBootAnimation() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Start fade in from black after brief delay
|
||||
let skipped = false;
|
||||
const timeouts = [];
|
||||
|
||||
// Skip animation on space key press
|
||||
const skipHandler = (event) => {
|
||||
if (event.code === 'Space' && !skipped) {
|
||||
event.preventDefault();
|
||||
skipped = true;
|
||||
|
||||
// Clear all pending timeouts
|
||||
timeouts.forEach(timeout => clearTimeout(timeout));
|
||||
|
||||
// Complete the boot screen immediately
|
||||
bootScreen.classList.add('fade-out');
|
||||
setTimeout(() => {
|
||||
if (pageFade) pageFade.classList.add('fade-out');
|
||||
}, 200);
|
||||
bootScreen.style.display = 'none';
|
||||
if (pageFade) pageFade.style.display = 'none';
|
||||
document.removeEventListener('keydown', skipHandler);
|
||||
resolve();
|
||||
}, 100);
|
||||
}
|
||||
};
|
||||
|
||||
document.addEventListener('keydown', skipHandler);
|
||||
|
||||
// Start fade in from black after brief delay
|
||||
timeouts.push(setTimeout(() => {
|
||||
if (pageFade && !skipped) pageFade.classList.add('fade-out');
|
||||
}, 200));
|
||||
|
||||
let lineIndex = 0;
|
||||
let totalDelay = 800; // Start after fade begins
|
||||
@@ -104,7 +129,9 @@ function runBootAnimation() {
|
||||
const delay = totalDelay;
|
||||
totalDelay += line.delay || baseDelay;
|
||||
|
||||
setTimeout(() => {
|
||||
timeouts.push(setTimeout(() => {
|
||||
if (skipped) return;
|
||||
|
||||
const span = document.createElement('span');
|
||||
if (line.class) {
|
||||
span.className = line.class;
|
||||
@@ -115,18 +142,21 @@ function runBootAnimation() {
|
||||
if (!line.inline) {
|
||||
biosText.appendChild(document.createTextNode('\n'));
|
||||
}
|
||||
}, delay);
|
||||
}, delay));
|
||||
});
|
||||
|
||||
// Fade out and remove boot screen
|
||||
setTimeout(() => {
|
||||
timeouts.push(setTimeout(() => {
|
||||
if (skipped) return;
|
||||
|
||||
bootScreen.classList.add('fade-out');
|
||||
setTimeout(() => {
|
||||
timeouts.push(setTimeout(() => {
|
||||
bootScreen.style.display = 'none';
|
||||
if (pageFade) pageFade.style.display = 'none';
|
||||
document.removeEventListener('keydown', skipHandler);
|
||||
resolve();
|
||||
}, 500);
|
||||
}, totalDelay + 300);
|
||||
}, 500));
|
||||
}, totalDelay + 300));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -487,7 +487,7 @@ const commands = {
|
||||
description: 'Connect to chat room',
|
||||
execute: async (args) => {
|
||||
const homeserver = 'https://chat.ruv.wtf';
|
||||
const roomAlias = '#generalchat:b.ruv.wtf';
|
||||
const roomAlias = '#publicchat:ruv.wtf';
|
||||
|
||||
// Generate UUID
|
||||
const generateUUID = () => {
|
||||
@@ -998,7 +998,7 @@ async function writeStartupChatMotd() {
|
||||
const result = await Promise.race([
|
||||
(async () => {
|
||||
const [latest, presence] = await Promise.all([
|
||||
fetchPublicLastMessage('#generalchat:b.ruv.wtf'),
|
||||
fetchPublicLastMessage('#publicchat:ruv.wtf'),
|
||||
fetchPublicPresence('@litruv:b.ruv.wtf')
|
||||
]);
|
||||
return { latest, presence };
|
||||
|
||||
Reference in New Issue
Block a user