terminal-e
@@ -308,26 +281,24 @@ document.querySelectorAll(".window").forEach(win=>{
});
// Neofetch Output
-// Uses textContent so Unicode block/box chars render as-is.
-// JetBrains Mono (loaded via Google Fonts) covers all these glyphs.
const neofetchWin = document.getElementById("neofetchTerminal");
const neofetchData = `
▄
▟█▙
▟███▙ oiupoyt@archlinux
▟█████▙
- ▟███████▙ Arch Linux x86_64
- ▂▔▀▜██████▙ Linux 6.19.8-arch1-1
- ▟██▅▂▝▜█████▙ 1254 (pacman), 60 (flatpak)
- ▟█████████████▙ fish 4.5.0
- ▟███████████████▙ kitty 0.46.1
- ▟█████████████████▙ Hyprland 0.54.2 (Wayland)
- ▟███████████████████▙ breeze
- ▟█████████▛▀▀▜████████▙ NotoSansMono-Regular (11pt)
- ▟████████▛ ▜███████▙ 9 hours, 16 mins
- ▟█████████ ████████▙ 2026-4-10
+ ▟███████▙ Arch Linux x86_64
+ ▂▔▀▜██████▙ Linux 6.19.8-arch1-1
+ ▟██▅▂▝▜█████▙ 1254 (pacman), 60 (flatpak)
+ ▟█████████████▙ fish 4.5.0
+ ▟███████████████▙ kitty 0.46.1
+ ▟█████████████████▙ Hyprland 0.54.2 (Wayland)
+ ▟███████████████████▙ breeze
+ ▟█████████▛▀▀▜████████▙ NotoSansMono-Regular (11pt)
+ ▟████████▛ ▜███████▙ 9 hours, 16 mins
+ ▟█████████ ████████▙ 2026-4-10
▟██████████ █████▆▅▄▃▂ Baiaa081 - Noite Isolada (Playing)
- ▟██████████▛ ▜█████████▙ Youtube (Mozilla zen)
+ ▟██████████▛ ▜█████████▙ Youtube (Mozilla zen)
▟██████▀▀▀ ▀▀██████▙
▟███▀▘ ▝▀███▙
▟▛▀ ▀▜▙
@@ -344,8 +315,10 @@ const musicIcon = document.getElementById('musicIcon');
let isPlaying = false;
+// Set initial volume
bgMusic.volume = volumeSlider.value / 100;
+// Play/Pause button
playPauseBtn.addEventListener('click', () => {
if (isPlaying) {
bgMusic.pause();
@@ -366,10 +339,12 @@ playPauseBtn.addEventListener('click', () => {
}
});
+// Volume control
volumeSlider.addEventListener('input', (e) => {
bgMusic.volume = e.target.value / 100;
});
+// Update status when music ends
bgMusic.addEventListener('ended', () => {
playPauseIcon.className = 'fas fa-play';
musicStatus.textContent = 'Ended';
@@ -377,15 +352,20 @@ bgMusic.addEventListener('ended', () => {
isPlaying = false;
});
-// Loading screen
+// Loading screen functionality
const loadingScreen = document.getElementById('loadingScreen');
const bgVideo = document.getElementById('bgVideo');
const pipesVideo = document.getElementById('pipesVideo');
const pipesPlaceholder = document.getElementById('pipesPlaceholder');
loadingScreen.addEventListener('click', () => {
+ // Hide loading screen
loadingScreen.classList.add('hidden');
+
+ // Start videos
tryAutoLoad();
+
+ // Auto-play music
setTimeout(() => {
bgMusic.play().then(() => {
playPauseIcon.className = 'fas fa-pause';
@@ -399,38 +379,75 @@ loadingScreen.addEventListener('click', () => {
}, 500);
});
-async function tryFetch(paths) {
- for (const path of paths) {
- try {
- const res = await fetch(path);
- if (res.ok) {
- const blob = await res.blob();
- return URL.createObjectURL(blob);
- }
- } catch (e) { /* try next */ }
- }
- return null;
-}
-
+// Try to auto-load if videos are in same directory (fallback)
async function tryAutoLoad() {
- // Background video
- const bgUrl = await tryFetch(['backgroundVideo.mp4', 'backgroundVideo.webm']);
- if (bgUrl) {
- bgVideo.src = bgUrl;
- bgVideo.load();
- bgVideo.play().catch(e => console.error('BG video error:', e));
+ try {
+ const bgResponse = await fetch('backgroundVideo.mp4');
+ if (bgResponse.ok) {
+ const blob = await bgResponse.blob();
+ const url = URL.createObjectURL(blob);
+ bgVideo.src = url;
+ bgVideo.load();
+ bgVideo.play().catch(e => console.error('BG video error:', e));
+ }
+ } catch (e) {
+ console.log('Background video not found, trying .webm');
+ try {
+ const bgResponse = await fetch('backgroundVideo.webm');
+ if (bgResponse.ok) {
+ const blob = await bgResponse.blob();
+ const url = URL.createObjectURL(blob);
+ bgVideo.src = url;
+ bgVideo.load();
+ bgVideo.play().catch(e => console.error('BG video error:', e));
+ }
+ } catch (e2) {
+ console.error('No background video found');
+ }
}
- // Terminal/pipes video — supports transparent webm (alpha channel)
- const pipesUrl = await tryFetch(['terminal.webm', 'terminal.mp4', 'pipes.webm', 'pipes.mp4']);
- if (pipesUrl) {
- pipesVideo.src = pipesUrl;
- pipesVideo.style.display = 'block';
- pipesPlaceholder.style.display = 'none';
- pipesVideo.load();
- pipesVideo.play().catch(e => console.error('Pipes video error:', e));
- } else {
- pipesPlaceholder.textContent = 'No video found';
+ try {
+ const pipesResponse = await fetch('terminal.mp4');
+ if (pipesResponse.ok) {
+ const blob = await pipesResponse.blob();
+ const url = URL.createObjectURL(blob);
+ pipesVideo.src = url;
+ pipesVideo.style.display = 'block';
+ pipesPlaceholder.style.display = 'none';
+ pipesVideo.load();
+ pipesVideo.play().catch(e => console.error('Pipes video error:', e));
+ }
+ } catch (e) {
+ console.log('Pipes video not found, trying .webm or pipes.mp4');
+ try {
+ const pipesResponse = await fetch('terminal.webm');
+ if (pipesResponse.ok) {
+ const blob = await pipesResponse.blob();
+ const url = URL.createObjectURL(blob);
+ pipesVideo.src = url;
+ pipesVideo.style.display = 'block';
+ pipesPlaceholder.style.display = 'none';
+ pipesVideo.load();
+ pipesVideo.play().catch(e => console.error('Pipes video error:', e));
+ }
+ } catch (e2) {
+ // Try pipes.mp4 as fallback
+ try {
+ const pipesResponse = await fetch('pipes.mp4');
+ if (pipesResponse.ok) {
+ const blob = await pipesResponse.blob();
+ const url = URL.createObjectURL(blob);
+ pipesVideo.src = url;
+ pipesVideo.style.display = 'block';
+ pipesPlaceholder.style.display = 'none';
+ pipesVideo.load();
+ pipesVideo.play().catch(e => console.error('Pipes video error:', e));
+ }
+ } catch (e3) {
+ console.error('No pipes video found');
+ pipesPlaceholder.textContent = 'No video found';
+ }
+ }
}
}