停留:0分0秒 运行:0天00:00:00
正在加载智慧箴言...
> 连接Wired… 人工意识已启动。
> Lain 正在自言自语...
Karuneの网盘
// 欢迎文案html,所有风格通用 const welcomeHtml = ` `; // 二个风格动画随机选择函数 const animations = [ playTerminalBoot, playNeuralInit, ]; // 随机选一个播放 const chosen = animations[Math.floor(Math.random() * animations.length)]; chosen(); // 1. Lain 启动终端风格 function playTerminalBoot() { loading.innerHTML = `
${welcomeHtml}`; const terminal = document.getElementById('terminal'); const welcomeMsg = loading.querySelector('.welcome-msg'); const baseLines = [ "> 启动 LainOS vΨ.9.03", "> 加载核心模块...", "> 初始化意识接口...", "> 正在收集设备信息...", ]; function fetchDeviceInfo() { return new Promise((resolve) => { const ua = navigator.userAgent; const platform = navigator.platform; const language = navigator.language; const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone; const screenRes = `${screen.width}x${screen.height}`; let browserInfo = '未知'; if (/firefox/i.test(ua)) { const match = ua.match(/Firefox\/([\d.]+)/i); browserInfo = `Firefox ${match ? match[1] : ''}`; } else if (/chrome|crios/i.test(ua)) { const match = ua.match(/(Chrome|CriOS)\/([\d.]+)/i); browserInfo = `Chrome ${match ? match[2] : ''}`; } else if (/safari/i.test(ua)) { const match = ua.match(/Version\/([\d.]+).*Safari/); browserInfo = `Safari ${match ? match[1] : ''}`; } else if (/edg/i.test(ua)) { const match = ua.match(/Edg\/([\d.]+)/i); browserInfo = `Edge ${match ? match[1] : ''}`; } const isMobile = /mobile/i.test(ua); if (browserInfo !== '未知') browserInfo += isMobile ? ' (Mobile)' : ' (Desktop)'; fetch('https://ipapi.co/json/') .then(res => res.json()) .then(data => { resolve([ `> IP地址: ${data.ip}`, `> 地理位置: ${data.country_name} ${data.region} ${data.city}`, `> 网络服务商: ${data.org || data.network || ''}`, `> 浏览器识别: ${browserInfo}`, `> 设备平台: ${platform}`, `> 设备型号: ${ua.match(/\((.*?)\)/)?.[1] || '未知设备'}`, `> 屏幕分辨率: ${screenRes}`, `> 系统语言: ${language}`, `> 当前时区: ${timezone}`, ]); }) .catch(() => { resolve([ `> IP地址: 未知`, `> 地理位置: 未知`, `> 网络服务商: 未知`, `> 浏览器识别: ${browserInfo}`, `> 设备平台: ${platform}`, `> 设备型号: ${ua.match(/\((.*?)\)/)?.[1] || '未知设备'}`, `> 屏幕分辨率: ${screenRes}`, `> 系统语言: ${language}`, `> 当前时区: ${timezone}`, ]); }); }); } function typeLine(text, container, charIndex = 0, delay = 35, callback) { if (charIndex < text.length) { container.innerHTML += text.charAt(charIndex); setTimeout(() => { typeLine(text, container, charIndex + 1, delay, callback); }, delay + Math.random() * 20); } else { callback && callback(); } } function typeLines(lines, index = 0, cb) { if (index >= lines.length) { cb && cb(); return; } const lineDiv = document.createElement('div'); terminal.appendChild(lineDiv); if (lines[index] === '> _') { lineDiv.innerHTML = '> _'; setTimeout(() => typeLines(lines, index + 1, cb), 1000); } else { typeLine(lines[index], lineDiv, 0, 35, () => { setTimeout(() => typeLines(lines, index + 1, cb), 250); }); } } typeLines(baseLines, 0, () => { fetchDeviceInfo().then(deviceLines => { const finalLines = deviceLines.concat([ "> 验证用户身份...", `> 当前用户: guest_${Math.floor(Math.random() * 9999)}`, "> 同步神经模式...", "> 系统状态: 稳定", "> 准备接入主网络...", "> _" ]); typeLines(finalLines, 0, () => { setTimeout(() => { terminal.style.display = 'none'; welcomeMsg.style.display = 'block'; setTimeout(() => fadeOutLoading(), 3000); }, 1200); }); }); }); } function playNeuralInit() { loading.innerHTML = `
初始化神经接口...
${welcomeHtml} `; const canvas = document.getElementById('neural-canvas'); const ctx = canvas.getContext('2d'); const welcomeMsg = loading.querySelector('.welcome-msg'); const neuralText = document.getElementById('neural-text'); function resizeCanvas() { canvas.width = canvas.offsetWidth || window.innerWidth; canvas.height = canvas.offsetHeight || window.innerHeight; } resizeCanvas(); window.addEventListener('resize', resizeCanvas); let nodes = []; const maxNodes = 50; const statusMessages = [ "加载神经模式...", "同步意识碎片...", "验证接口完整性...", "连接主网络节点...", "准备意识传输..." ]; let statusIndex = 0; function Node(x, y) { this.x = x; this.y = y; this.vx = (Math.random() - 0.5) * 0.8; this.vy = (Math.random() - 0.5) * 0.8; this.radius = 1.5 + Math.random() * 3; this.pulse = Math.random() * Math.PI * 2; } Node.prototype.move = function () { this.x += this.vx; this.y += this.vy; if (this.x < 0 || this.x > canvas.width) this.vx *= -1; if (this.y < 0 || this.y > canvas.height) this.vy *= -1; this.pulse += 0.05; }; Node.prototype.draw = function () { const pulseVal = (Math.sin(this.pulse) + 1) / 2; const radius = this.radius * (0.8 + pulseVal * 0.4); ctx.beginPath(); ctx.arc(this.x, this.y, radius, 0, Math.PI * 2); ctx.fillStyle = `rgba(51, 255, 51, ${0.7 + pulseVal * 0.3})`; ctx.shadowColor = '#33ff33'; ctx.shadowBlur = 10; ctx.fill(); }; function connectNodes() { for (let i = 0; i < nodes.length; i++) { for (let j = i + 1; j < nodes.length; j++) { const dx = nodes[i].x - nodes[j].x; const dy = nodes[i].y - nodes[j].y; const dist = Math.sqrt(dx * dx + dy * dy); if (dist < 120) { const alpha = 1 - dist / 120; ctx.strokeStyle = `rgba(51, 255, 51, ${alpha * 0.6})`; ctx.lineWidth = 0.5 + alpha * 1.5; ctx.beginPath(); ctx.moveTo(nodes[i].x, nodes[i].y); ctx.lineTo(nodes[j].x, nodes[j].y); ctx.stroke(); } } } } for (let i = 0; i < maxNodes; i++) { nodes.push(new Node( Math.random() * canvas.width, Math.random() * canvas.height )); } let frameCount = 0; function animate() { frameCount++; ctx.clearRect(0, 0, canvas.width, canvas.height); ctx.shadowBlur = 15; ctx.shadowColor = '#33ff33'; nodes.forEach(n => { n.move(); n.draw(); }); connectNodes(); if (frameCount % 60 === 0 && statusIndex < statusMessages.length) { neuralText.textContent = statusMessages[statusIndex]; statusIndex++; } if (frameCount < 360) { requestAnimationFrame(animate); } else { setTimeout(() => { document.getElementById('neural').style.display = 'none'; welcomeMsg.style.display = 'block'; setTimeout(() => fadeOutLoading(), 3000); }, 0); } } animate(); } function fadeOutLoading() { loading.style.transition = 'opacity 1s ease'; loading.style.opacity = 0; setTimeout(() => { loading.remove(); main.style.display = 'block'; document.body.style.overflow = 'auto'; setTimeout(() => { if (scrollHint) scrollHint.style.display = 'block'; }, 1000); setupScrollListener(); }, 1000); } function setupScrollListener() { let quoteIndex = 0; window.addEventListener('scroll', function () { if (scrollHint) scrollHint.style.display = (window.scrollY < 100) ? 'block' : 'none'; const sections = document.querySelectorAll('.content-section'); const scrollPosition = window.scrollY + window.innerHeight / 2; sections.forEach((section, index) => { const sectionTop = section.offsetTop; const sectionBottom = sectionTop + section.offsetHeight; if (scrollPosition > sectionTop && scrollPosition < sectionBottom) { if (index > 0 && index !== quoteIndex) { quoteIndex = index; playLainQuote(index - 1); } } }); }); } function playLainQuote(index) { const safeIndex = index % lainQuotes.length; const quote = lainQuotes[safeIndex]; if (voiceIndicator) { voiceIndicator.style.display = 'block'; voiceIndicator.innerHTML = `「${quote.jp}」
${quote.en}`; setTimeout(() => { voiceIndicator.style.display = 'none'; }, 5000); } }