class SakuraCyberDashboard { constructor() { this.consoleOutput = document.getElementById('console-output'); this.themeToggle = document.getElementById('theme-toggle'); this.currentTheme = 'sakura'; // Default theme this.loadTheme(); this.themeToggle.addEventListener('click', () => this.toggleTheme()); } log(message) { const timestamp = new Date().toLocaleTimeString(); this.consoleOutput.innerHTML += `[${timestamp}] ${this.glitchText(message)}\n`; this.consoleOutput.scrollTop = this.consoleOutput.scrollHeight; } glitchText(text) { // Japanese-inspired glitch effect const glitchChars = ['・', '◆', '◇', '■', '□']; return text.split('').map(char => Math.random() > 0.9 ? glitchChars[Math.floor(Math.random() * glitchChars.length)] : char ).join(''); } async launchVirtualBrowser() { this.log('Initializing Virtual Browser...'); try { // Check if user is signed in const token = localStorage.getItem('authToken'); if (!token) { // If not signed in, show sign in modal this.showSignInModal(); return; } // User is signed in, open virtual browser in new window const width = Math.min(1200, window.innerWidth * 0.9); const height = width * (9/16); // 16:9 aspect ratio const left = (window.innerWidth - width) / 2; const top = (window.innerHeight - height) / 2; window.open('vbrowser.html', 'Virtual Browser', `width=${width},height=${height},left=${left},top=${top}`); } catch (error) { this.log(`Browser Launch Error: ${error.message}`); } } async launchLiveStreamer() { this.log('Connecting to Live Stream...'); try { // Open the Telegram bot link in a new window const width = Math.min(1000, window.innerWidth * 0.8); const height = width * (9 / 16); // 16:9 aspect ratio const left = (window.innerWidth - width) / 2; const top = (window.innerHeight - height) / 2; window.open( 'https://telegram.me/python3463_bot', 'Live Streamer', `width=${width},height=${height},left=${left},top=${top}` ); } catch (error) { this.log(`Stream Connection Error: ${error.message}`); } } async launchLiveLogs() { this.log('Starting Log Trace Algorithm...'); try { const width = Math.min(1000, window.innerWidth * 0.8); const height = width * (9 / 16); // 16:9 aspect ratio const left = (window.innerWidth - width) / 2; const top = (window.innerHeight - height) / 2; window.open( 'https://akshay-365.github.io/', 'Code Hacks', `width=${width},height=${height},left=${left},top=${top}`); } catch (error) { this.log(`Trace Protocol Failure: ${error.message}`); } } toggleTheme() { this.currentTheme = this.currentTheme === 'sakura' ? 'program' : 'sakura'; this.applyTheme(); localStorage.setItem('theme', this.currentTheme); } loadTheme() { const storedTheme = localStorage.getItem('theme'); if (storedTheme) { this.currentTheme = storedTheme; } this.applyTheme(); } applyTheme() { const body = document.body; const root = document.documentElement; if (this.currentTheme === 'sakura') { // Sakura Theme root.style.setProperty('--background-primary', 'rgba(255, 255, 255, 0.1)'); root.style.setProperty('--background-secondary', 'rgba(255, 255, 255, 0.05)'); root.style.setProperty('--text-primary', '#f0f0f0'); root.style.setProperty('--text-secondary', '#c0c0c0'); root.style.setProperty('--accent-color', '#ff6b6b'); root.style.setProperty('--border-color', 'rgba(255, 255, 255, 0.2)'); body.style.background = 'linear-gradient(135deg, #1a1a2e, #16213e)'; this.themeToggle.innerHTML = ''; // Update card icons this.updateCardIcons('sakura'); } else if (this.currentTheme === 'program') { // Program Theme root.style.setProperty('--background-primary', 'rgba(255, 255, 255, 0.2)'); root.style.setProperty('--background-secondary', 'rgba(255, 255, 255, 0.2)'); root.style.setProperty('--text-primary', '#fff'); root.style.setProperty('--text-secondary', '#fff'); root.style.setProperty('--accent-color', '#5D3FD3'); root.style.setProperty('--border-color', 'rgba(255, 255, 255, 0.3)'); body.style.background = 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'; this.themeToggle.innerHTML = ''; // Update card icons this.updateCardIcons('program'); } } updateCardIcons(theme) { const virtualBrowserIcon = document.querySelector('.virtual-browser-card .card-icon'); const liveStreamerIcon = document.querySelector('.live-streamer-card .card-icon'); const liveLogsIcon = document.querySelector('.live-logs-card .card-icon'); if (theme === 'sakura') { virtualBrowserIcon.innerHTML = ` `; liveStreamerIcon.innerHTML = ` `; liveLogsIcon.innerHTML = ` `; } else if (theme === 'program') { virtualBrowserIcon.innerHTML = ` `; liveStreamerIcon.innerHTML = ` `; liveLogsIcon.innerHTML = ` `; } } showSignInModal() { const modal = document.createElement('div'); modal.innerHTML = `

Sign In

`; document.body.appendChild(modal); const closeModal = () => { document.body.removeChild(modal); }; document.getElementById('closeModal').onclick = closeModal; document.getElementById('signInBtn').onclick = async () => { const email = document.getElementById('email').value; const password = document.getElementById('password').value; try { const response = await fetch('/signin', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({email, password}) }); const data = await response.json(); if (data.token) { localStorage.setItem('authToken', data.token); closeModal(); this.launchVirtualBrowser(); } else { alert(data.error || 'Sign in failed'); } } catch (error) { alert('Sign in failed: ' + error.message); } }; document.getElementById('signUpBtn').onclick = async () => { const email = document.getElementById('email').value; const password = document.getElementById('password').value; try { const response = await fetch('/signup', { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({email, password}) }); const data = await response.json(); if (response.ok) { alert('Account created! Please sign in.'); } else { alert(data.error || 'Sign up failed'); } } catch (error) { alert('Sign up failed: ' + error.message); } }; } } // Initialize the dashboard const dashboard = new SakuraCyberDashboard(); // Attach global window functions window.launchVirtualBrowser = () => dashboard.launchVirtualBrowser(); window.launchLiveStreamer = () => dashboard.launchLiveStreamer(); window.launchLiveLogs = () => dashboard.launchLiveLogs();