-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.html
More file actions
167 lines (142 loc) · 9.13 KB
/
dashboard.html
File metadata and controls
167 lines (142 loc) · 9.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>GHOSTNET | COMMAND CENTER</title>
<script src="https://kit.fontawesome.com/eeb01edac2.js" crossorigin="anonymous"></script>
<style>
:root { --glow: #00ff41; --bg: #0b0b0b; --sidebar: #121212; --panel: #181818; }
body { background-color: var(--bg); color: #fff; font-family: 'Segoe UI', sans-serif; margin: 0; display: flex; height: 100vh; overflow: hidden; }
.sidebar { width: 260px; background: var(--sidebar); border-right: 1px solid #222; display: flex; flex-direction: column; padding: 20px 0; flex-shrink: 0; }
.sidebar-brand { padding: 0 25px 20px; font-weight: bold; color: var(--glow); letter-spacing: 2px; border-bottom: 1px solid #222; margin-bottom: 20px; }
.nav-item { padding: 12px 25px; color: #888; text-decoration: none; display: flex; align-items: center; gap: 15px; font-size: 14px; transition: 0.2s; cursor: pointer; }
.nav-item:hover { background: rgba(0,255,65,0.05); color: var(--glow); }
.nav-item.active { background: rgba(0,255,65,0.1); color: var(--glow); border-right: 3px solid var(--glow); }
.main-wrapper { flex-grow: 1; display: flex; flex-direction: column; }
.top-bar { height: 70px; background: var(--sidebar); border-bottom: 1px solid #222; display: flex; align-items: center; justify-content: flex-end; padding: 0 30px; gap: 20px; }
.content-body { padding: 30px; overflow-y: auto; flex-grow: 1; }
/* PANELS */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.panel { background: var(--panel); border: 1px solid #222; border-radius: 8px; padding: 25px; }
.panel-header { font-size: 16px; font-weight: bold; margin-bottom: 20px; color: var(--glow); display: flex; align-items: center; gap: 10px; }
/* DROPDOWN LOGIC */
.dropdown { position: relative; }
.dropdown-menu {
display: none; /* Hidden by default */
position: absolute;
right: 0;
top: 120%;
background: var(--panel);
border: 1px solid #333;
min-width: 180px;
border-radius: 4px;
z-index: 100;
box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}
.dropdown-menu.show { display: block; } /* Show class */
.dropdown-menu a { display: block; padding: 12px; color: #ccc; text-decoration: none; font-size: 13px; transition: 0.2s; }
.dropdown-menu a:hover { background: #222; color: var(--glow); }
/* LOADING SCREEN */
#loading-screen { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #000; z-index: 9999; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: 0.5s; }
.bar { width: 250px; height: 4px; background: #111; border-radius: 10px; margin-top: 20px; overflow: hidden; }
.fill { height: 100%; width: 0%; background: var(--glow); transition: width 0.1s linear; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.panel { background: var(--panel); border: 1px solid #222; border-radius: 8px; padding: 25px; }
.panel-header { font-size: 16px; font-weight: bold; margin-bottom: 20px; color: var(--glow); display: flex; align-items: center; gap: 10px; }
textarea { width: 100%; background: #000; border: 1px solid #333; color: #fff; padding: 10px; border-radius: 4px; margin-top: 10px; box-sizing: border-box; resize: none; }
button { background: var(--glow); color: #000; border: none; padding: 12px 20px; font-weight: bold; border-radius: 4px; cursor: pointer; margin-top: 15px; transition: 0.3s; width: 100%; }
button:hover { filter: brightness(1.2); box-shadow: 0 0 15px rgba(0,255,65,0.3); }
</style>
</head>
<body>
<div id="loading-screen">
<div style="color: var(--glow); letter-spacing: 5px; font-family: 'Courier New';">GHOSTNET_OS_BOOTING...</div>
<div class="bar"><div id="fill" class="fill"></div></div>
</div>
<div class="sidebar">
<div class="sidebar-brand">GHOSTNET_V2</div>
<div class="nav-item active"><i class="fas fa-th-large"></i> Server Overview</div>
<div class="nav-item"><i class="fas fa-cog"></i> Bot Settings</div>
<div class="nav-item"><i class="fas fa-bullhorn"></i> Welcomer</div>
<div class="nav-item"><i class="fas fa-terminal"></i> System Logs</div>
</div>
<div class="main-wrapper">
<header class="top-bar">
<a href="/" style="color: #666; text-decoration: none; font-size: 14px; margin-right: 20px;">Home</a>
<div class="dropdown">
<div id="profile-trigger" style="display: flex; align-items: center; gap: 10px; cursor: pointer; background: #1a1a1a; padding: 8px 15px; border-radius: 20px;">
<img id="user-avatar" src="https://i.imgur.com/6VBx3io.png" style="width: 25px; height: 25px; border-radius: 50%;">
<span id="user-name" style="font-size: 13px;">OPERATOR_01</span>
<i class="fas fa-chevron-down" style="font-size: 10px;"></i>
</div>
<div id="dropdown-menu" class="dropdown-menu">
<a href="#"><i class="fas fa-book-open"></i> Documentation</a>
<a href="#"><i class="fas fa-user-cog"></i> Account Settings</a>
<hr style="border: 0; border-top: 1px solid #333; margin: 5px 0;">
<a href="#" style="color: #ff4444;"><i class="fas fa-sign-out-alt"></i> Disconnect</a>
</div>
</div>
</header>
<main class="content-body">
<div class="grid">
<div class="panel">
<div class="panel-header"><i class="fas fa-bullhorn"></i> Welcomer Protocol</div>
<textarea id="welcome-text" rows="3" placeholder="Welcome to the terminal, {user}..."></textarea>
<button>SAVE_PROTOCOL</button>
</div>
<div class="panel">
<div class="panel-header"><i class="fas fa-heartbeat"></i> AI_CORE_STATUS</div>
<div style="display: flex; justify-content: space-between;"><span style="color: #555;">Neural_Link:</span><span style="color: var(--glow);">ACTIVE</span></div>
<button onclick="location.reload()" style="background: #222; color: #666; font-size: 10px;">HARD_REFRESH</button>
</div>
</div>
</main>
</div>
<script>
const BOT_API = "https://ghostnet-0p4u.onrender.com";
// --- DROPDOWN LOGIC ---
const trigger = document.getElementById('profile-trigger');
const menu = document.getElementById('dropdown-menu');
trigger.addEventListener('click', function(e) {
e.stopPropagation(); // Prevents click from bubbling to document
menu.classList.toggle('show');
});
// Close menu when clicking anywhere else
document.addEventListener('click', function() {
menu.classList.remove('show');
});
// --- DISCORD & LOADING LOGIC ---
async function handleDiscordLogin() {
const fill = document.getElementById('fill');
let width = 0;
const interval = setInterval(() => { if (width < 90) { width += 5; fill.style.width = width + '%'; } }, 50);
const urlParams = new URLSearchParams(window.location.search);
const code = urlParams.get('code');
if (code) {
const cleanURL = window.location.protocol + "//" + window.location.host + window.location.pathname;
window.history.replaceState({}, document.title, cleanURL);
try {
const response = await fetch(`${BOT_API}/login-callback?code=${code}`);
const userData = await response.json();
if (userData.username) {
localStorage.setItem('discord_user_name', userData.username);
localStorage.setItem('discord_user_avatar', `https://cdn.discordapp.com/avatars/${userData.id}/${userData.avatar}.png`);
}
} catch (err) { console.log("Offline Mode"); }
}
clearInterval(interval);
fill.style.width = '100%';
setTimeout(() => {
document.getElementById('loading-screen').style.opacity = '0';
setTimeout(() => { document.getElementById('loading-screen').style.display = 'none'; }, 500);
const name = localStorage.getItem('discord_user_name');
const avatar = localStorage.getItem('discord_user_avatar');
if(name) document.getElementById('user-name').innerText = name;
if(avatar) document.getElementById('user-avatar').src = avatar;
}, 400);
}
document.addEventListener('DOMContentLoaded', handleDiscordLogin);
</script>
</body>
</html>