new tab polish

This commit is contained in:
esef committed 2026-07-12 18:46:05 +03:00
1 parent 6d5fb5c76d
commit b27cca3ed5
4 files changed
+224 -107

No files matched your search

+2
View File
@@ -5,3 +5,5 @@ __pycache__/
Thumbs.db Thumbs.db
*.log *.log
.DS_Store .DS_Store
firebase.txt
manipulate_boxes.md
+40 -38
View File
@@ -111,53 +111,54 @@
<section id="yuukabot" class="tab-content"> <section id="yuukabot" class="tab-content">
<header class="dash-header"> <header class="dash-header">
<h1>Yuuka Bot</h1> <h1><span class="status-dot" id="dash-status-dot"></span>Yuuka Bot</h1>
<p>Live dashboard — stats, music, gacha, and more.</p>
</header> </header>
<div class="dash-grid"> <div class="dash-grid">
<!-- Card 1: Now Playing --> <!-- Uptime -->
<div class="dash-card">
<div class="card-icon">🎵</div>
<div class="card-body">
<h3>Now Playing</h3>
<p class="card-value" id="dash-nowplaying">—</p>
<span class="card-label">across all servers</span>
</div>
</div>
<!-- Card 2: Gacha pulls -->
<div class="dash-card">
<div class="card-icon">🎫</div>
<div class="card-body">
<h3>Total Pulls</h3>
<p class="card-value" id="dash-pulls">—</p>
<span class="card-label">recruitments since launch</span>
</div>
</div>
<!-- Card 3: Radio listeners -->
<div class="dash-card">
<div class="card-icon">📻</div>
<div class="card-body">
<h3>Radio Listeners</h3>
<p class="card-value" id="dash-radio">—</p>
<span class="card-label">servers tuned in right now</span>
</div>
</div>
<!-- Card 4: Uptime -->
<div class="dash-card"> <div class="dash-card">
<div class="card-top">
<div class="card-icon">⏱️</div> <div class="card-icon">⏱️</div>
<div class="card-body"> <span class="card-label">System Uptime</span>
<h3>Uptime</h3>
<p class="card-value" id="dash-uptime">—</p>
<span class="card-label" id="dash-uptime-label">since last restart</span>
</div> </div>
<p class="card-value" id="dash-uptime">—</p>
<span class="card-detail">since last boot</span>
</div>
<!-- CPU -->
<div class="dash-card">
<div class="card-top">
<div class="card-icon">⚡</div>
<span class="card-label">CPU</span>
</div>
<p class="card-value" id="dash-cpu-val">—</p>
<div class="card-bar-wrap"><div class="card-bar-fill cpu" id="dash-cpu-bar" style="width:0%"></div></div>
</div>
<!-- RAM -->
<div class="dash-card">
<div class="card-top">
<div class="card-icon">💾</div>
<span class="card-label">Memory</span>
</div>
<p class="card-value" id="dash-ram-val">—</p>
<div class="card-bar-wrap"><div class="card-bar-fill ram" id="dash-ram-bar" style="width:0%"></div></div>
<span class="card-detail" id="dash-ram-detail"></span>
</div>
<!-- Disk -->
<div class="dash-card">
<div class="card-top">
<div class="card-icon">💿</div>
<span class="card-label">Disk</span>
</div>
<p class="card-value" id="dash-disk-val">—</p>
<div class="card-bar-wrap"><div class="card-bar-fill disk" id="dash-disk-bar" style="width:0%"></div></div>
<span class="card-detail" id="dash-disk-detail"></span>
</div> </div>
</div> </div>
<p class="dash-footer">Live data from <code>esef-514bf</code> · updates every 60s</p> <p class="dash-footer">synced every 10s</p>
</section> </section>
<script src="js/gallery.js" defer></script> <script src="js/gallery.js" defer></script>
@@ -167,6 +168,7 @@
<script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-app-compat.js"></script> <script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-app-compat.js"></script>
<script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-firestore-compat.js"></script> <script src="https://www.gstatic.com/firebasejs/10.12.0/firebase-firestore-compat.js"></script>
<script src="js/comments.js"></script> <script src="js/comments.js"></script>
<script src="js/yuukabot.js"></script>
<!-- Lightbox --> <!-- Lightbox -->
<div id="lightbox" class="lightbox"> <div id="lightbox" class="lightbox">
+75
View File
@@ -0,0 +1,75 @@
// ═══════════════════════════════════════════════════════════
// YUUKA BOT DASHBOARD — live Firestore reader
// ═══════════════════════════════════════════════════════════
const YUUKA_FIREBASE_CONFIG = {
apiKey: "AIzaSyDuSjEGEKx5FnWYnQq8f_owbpYRBRrl5x0",
authDomain: "esef-514bf.firebaseapp.com",
projectId: "esef-514bf",
storageBucket: "esef-514bf.firebasestorage.app",
messagingSenderId: "353969651290",
appId: "1:353969651290:web:41e3aaf8e54c743702a263"
};
document.addEventListener("DOMContentLoaded", () => {
const dash = document.getElementById("yuukabot");
if (!dash) return;
// Init Firebase (skip if already done by comments.js)
if (!firebase.apps.length) {
firebase.initializeApp(YUUKA_FIREBASE_CONFIG);
}
const db = firebase.firestore();
// Live listener: updates the dashboard whenever Firestore changes
db.collection("sysinfo").doc("server").onSnapshot(
(doc) => {
if (!doc.exists) return;
const d = doc.data();
// Online status
const dot = document.getElementById("dash-status-dot");
if (dot) {
dot.className = d.online ? "status-dot" : "status-dot offline";
}
// Uptime
const uptimeEl = document.getElementById("dash-uptime");
if (uptimeEl && d.uptime) uptimeEl.textContent = d.uptime;
// CPU
setBar("dash-cpu-val", "dash-cpu-bar", "dash-cpu-detail", d.cpu, "%", "cpu");
// RAM
const ramEl = document.getElementById("dash-ram-detail");
if (ramEl && d.ramUsed && d.ramTotal) {
ramEl.textContent = d.ramUsed + " / " + d.ramTotal;
}
setBar("dash-ram-val", "dash-ram-bar", null, d.ram, "%", "ram");
// Disk
const diskEl = document.getElementById("dash-disk-detail");
if (diskEl && d.diskUsed && d.diskTotal) {
diskEl.textContent = d.diskUsed + " / " + d.diskTotal;
}
setBar("dash-disk-val", "dash-disk-bar", null, d.disk, "%", "disk");
},
(err) => {
// Firestore unreachable — show offline
const dot = document.getElementById("dash-status-dot");
if (dot) dot.className = "status-dot offline";
}
);
});
function setBar(valId, barId, detailId, value, suffix, barClass) {
const valEl = document.getElementById(valId);
const barEl = document.getElementById(barId);
if (valEl && value != null) {
valEl.innerHTML = value + '<span>' + suffix + '</span>';
}
if (barEl) {
barEl.style.width = Math.min(Math.max(value || 0, 0), 100) + "%";
barEl.className = "card-bar-fill " + barClass;
}
}
+107 -69
View File
@@ -1,119 +1,157 @@
/* ═══════════════════════════════════════════════════════════ /* ═══════════════════════════════════════════════════════════
YUUKA BOT DASHBOARD YUUKA BOT DASHBOARD — live system stats
═══════════════════════════════════════════════════════════ */ ═══════════════════════════════════════════════════════════ */
/* ── Yuuka Bot nav button override ────────────────────────── */ /* ── LAYOUT: edit these to change the grid ────────────────── */
#yuukabot-btn { :root {
background-color: #5b6fde; --dash-columns: 2; /* number of columns (2 = 2×2, 3 = 3-wide, etc.) */
color: #fff; --dash-gap: 24px; /* space between boxes */
border: none; --dash-min-card-height: 220px;/* minimum height of each box */
padding: 12px 24px; --dash-max-width: 1100px; /* max width of the whole grid */
border-radius: 8px; --dash-padding: 120px 40px 60px; /* top right/left bottom */
cursor: pointer;
transition: box-shadow 0.3s ease, transform 0.2s;
} }
#yuukabot-btn:hover { /* To make boxes take different amounts of space, add a class
box-shadow: 0 0 18px rgba(91, 111, 222, 0.8); to the HTML like "wide" or "tall" and define it here:
transform: scale(1.03); .dash-card.wide { grid-column: span 2; }
} .dash-card.tall { grid-row: span 2; } */
/* ── Dashboard header ─────────────────────────────────────── */ /* ── Tab header ───────────────────────────────────────────── */
.dash-header { .dash-header {
padding: 120px 20px 30px; padding: 120px 20px 30px;
text-align: center; text-align: center;
} }
.dash-header h1 { .dash-header h1 {
font-size: 3rem; font-size: 2.8rem;
color: #fff; color: #fff;
margin: 0 0 8px; margin: 0 0 6px;
text-shadow: 0 0 30px rgba(91, 111, 222, 0.6); text-shadow: 0 0 30px rgba(91, 111, 222, 0.5);
} }
.dash-header .status-dot {
.dash-header p { display: inline-block;
font-size: 1.1rem; width: 14px; height: 14px;
color: rgba(255, 255, 255, 0.6); border-radius: 50%;
margin: 0; background: #22c55e;
margin-right: 8px;
box-shadow: 0 0 12px #22c55e;
animation: pulse 2s infinite;
} }
@keyframes pulse {
0%, 100% { box-shadow: 0 0 8px #22c55e; }
50% { box-shadow: 0 0 20px #22c55e, 0 0 40px rgba(34,197,94,0.4); }
}
.dash-header .offline { background: #ef4444; box-shadow: 0 0 12px #ef4444; animation: none; }
/* ── Card grid ────────────────────────────────────────────── */ /* ── Card grid ────────────────────────────────────────────── */
.dash-grid { .dash-grid {
display: grid; display: grid;
grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); grid-template-columns: repeat(var(--dash-columns), 1fr);
gap: 24px; gap: var(--dash-gap);
max-width: 1100px; max-width: var(--dash-max-width);
margin: 0 auto; margin: 0 auto;
padding: 20px 40px 60px; padding: 0 40px 60px;
} }
/* ── Individual card ──────────────────────────────────────── */ /* ── Glass card ───────────────────────────────────────────── */
.dash-card { .dash-card {
background: rgba(20, 20, 35, 0.75); background: rgba(15, 15, 35, 0.55);
backdrop-filter: blur(12px); backdrop-filter: blur(16px);
-webkit-backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(16px);
border: 1px solid rgba(91, 111, 222, 0.25); border: 1px solid rgba(91, 111, 222, 0.2);
border-radius: 14px; border-radius: 16px;
padding: 28px 24px; padding: 28px 30px;
min-height: var(--dash-min-card-height);
display: flex; display: flex;
align-items: flex-start; flex-direction: column;
gap: 18px; justify-content: space-between;
transition: border-color 0.3s, box-shadow 0.3s, transform 0.2s; transition: border-color 0.3s, box-shadow 0.3s;
} }
.dash-card:hover { .dash-card:hover {
border-color: rgba(91, 111, 222, 0.6); border-color: rgba(91, 111, 222, 0.5);
box-shadow: 0 8px 32px rgba(91, 111, 222, 0.15); box-shadow: 0 6px 28px rgba(91, 111, 222, 0.12);
transform: translateY(-2px);
} }
.card-icon { /* ── Card header (icon + label) ───────────────────────────── */
font-size: 2.2rem; .card-top {
flex-shrink: 0;
width: 52px;
height: 52px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; gap: 12px;
background: rgba(91, 111, 222, 0.15);
border-radius: 12px;
} }
.card-icon {
.card-body h3 { font-size: 1.6rem;
margin: 0 0 8px; width: 44px; height: 44px;
font-size: 0.85rem; display: flex; align-items: center; justify-content: center;
background: rgba(91, 111, 222, 0.12);
border-radius: 10px;
}
.card-label {
font-size: 0.8rem;
text-transform: uppercase; text-transform: uppercase;
letter-spacing: 1px; letter-spacing: 1.5px;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.45);
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
/* ── Card value ───────────────────────────────────────────── */
.card-value { .card-value {
font-size: 2rem; font-size: 3rem;
font-weight: bold; font-weight: bold;
color: #fff; color: #fff;
margin: 0 0 4px; margin: 0;
line-height: 1.2; line-height: 1;
}
.card-value span {
font-size: 1.2rem;
color: rgba(255, 255, 255, 0.4);
font-weight: 400;
} }
.card-label { /* ── Progress bar (CPU / RAM / Disk) ──────────────────────── */
.card-bar-wrap {
width: 100%;
height: 8px;
background: rgba(255, 255, 255, 0.08);
border-radius: 4px;
overflow: hidden;
margin-top: 12px;
}
.card-bar-fill {
height: 100%;
border-radius: 4px;
transition: width 0.8s ease;
}
.card-bar-fill.cpu { background: linear-gradient(90deg, #5b6fde, #818cf8); }
.card-bar-fill.ram { background: linear-gradient(90deg, #a78bfa, #c4b5fd); }
.card-bar-fill.disk { background: linear-gradient(90deg, #34d399, #6ee7b7); }
/* ── Detail text (used / total) ───────────────────────────── */
.card-detail {
font-size: 0.78rem; font-size: 0.78rem;
color: rgba(255, 255, 255, 0.35); color: rgba(255, 255, 255, 0.3);
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
margin-top: 6px;
} }
/* ── Footer ───────────────────────────────────────────────── */ /* ── Footer ───────────────────────────────────────────────── */
.dash-footer { .dash-footer {
text-align: center; text-align: center;
color: rgba(255, 255, 255, 0.25); color: rgba(255, 255, 255, 0.2);
font-size: 0.75rem; font-size: 0.7rem;
padding-bottom: 40px; padding-bottom: 50px;
font-family: Arial, Helvetica, sans-serif; font-family: Arial, Helvetica, sans-serif;
} }
.dash-footer code { /* ── Yuuka Bot nav button ─────────────────────────────────── */
background: rgba(255, 255, 255, 0.08); #yuukabot-btn {
padding: 2px 6px; background-color: #5b6fde;
border-radius: 3px; color: #fff;
font-size: 0.75rem; border: none !important;
padding: 12px 24px;
border-radius: 8px;
cursor: pointer;
transition: box-shadow 0.3s, transform 0.2s;
}
#yuukabot-btn:hover {
box-shadow: 0 0 20px rgba(91, 111, 222, 0.8);
transform: scale(1.03);
} }