diff --git a/src/components/Bars.tsx b/src/components/Bars.tsx index 8535825..137e9c3 100644 --- a/src/components/Bars.tsx +++ b/src/components/Bars.tsx @@ -206,6 +206,8 @@ export function LeftBar() { const [isMounted, setIsMounted] = createSignal(false); const [signOutLoading, setSignOutLoading] = createSignal(false); + const [getLostText, setGetLostText] = createSignal("What's this?"); + const [getLostVisible, setGetLostVisible] = createSignal(false); const handleLinkClick = () => { if (typeof window !== "undefined" && window.innerWidth < 768) { @@ -252,6 +254,60 @@ export function LeftBar() { onMount(() => { setIsMounted(true); + // Terminal-style appearance animation for "Get Lost" button + const glitchChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?~`"; + const originalText = "What's this?"; + let glitchInterval: NodeJS.Timeout; + + // Delay appearance to match terminal vibe + setTimeout(() => { + // Make visible immediately so typing animation is visible + setGetLostVisible(true); + + // Type-in animation with random characters resolving + let currentIndex = 0; + const typeInterval = setInterval(() => { + if (currentIndex <= originalText.length) { + let displayText = originalText.substring(0, currentIndex); + // Add random trailing characters + if (currentIndex < originalText.length) { + const remaining = originalText.length - currentIndex; + for (let i = 0; i < remaining; i++) { + displayText += + glitchChars[Math.floor(Math.random() * glitchChars.length)]; + } + } + setGetLostText(displayText); + currentIndex++; + } else { + clearInterval(typeInterval); + setGetLostText(originalText); + + // Start regular glitch effect after typing completes + glitchInterval = setInterval(() => { + if (Math.random() > 0.9) { + // 10% chance to glitch + let glitched = ""; + for (let i = 0; i < originalText.length; i++) { + if (Math.random() > 0.7) { + // 30% chance each character glitches + glitched += + glitchChars[Math.floor(Math.random() * glitchChars.length)]; + } else { + glitched += originalText[i]; + } + } + setGetLostText(glitched); + + setTimeout(() => { + setGetLostText(originalText); + }, 100); + } + }, 150); + } + }, 140); // Type speed (higher is slower) + }, 500); // Initial delay before appearing + if (ref) { // Focus trap for accessibility on mobile const handleKeyDown = (e: KeyboardEvent) => { @@ -291,6 +347,11 @@ export function LeftBar() { onCleanup(() => { ref?.removeEventListener("keydown", handleKeyDown); + clearInterval(glitchInterval); + }); + } else { + onCleanup(() => { + clearInterval(glitchInterval); }); } @@ -498,29 +559,39 @@ export function LeftBar() { -
{props.error.stack}
- {props.error.stack}
+
- {item.output}
-
-