current branding

This commit is contained in:
Raven Scott
2026-05-30 21:01:31 -04:00
parent 841d814f13
commit 416c678471
101 changed files with 689 additions and 121 deletions
+13 -10
View File
@@ -32,7 +32,7 @@ async function serveFile(filePath, res) {
}
async function serveAdminFrontendAsset(urlPath, res) {
if (!/^\/(?:ui\/[\w.-]+\.js|[\w.-]+\.(?:css|js|svg|ico|png|json|webmanifest))$/.test(urlPath)) {
if (!/^\/(?:ui\/[\w.-]+\.js|branding\/[\w.-]+\.png|[\w.-]+\.(?:css|js|svg|ico|png|json|webmanifest))$/.test(urlPath)) {
return false;
}
@@ -90,16 +90,12 @@ async function handleStaticRoutes(req, res) {
return true;
}
if (method === 'GET') {
const served = await serveAdminFrontendAsset(urlPath, res);
if (served) {
return true;
}
}
if (method === 'GET' && urlPath === '/favicon.ico') {
if (method === 'GET' && (urlPath === '/favicon.ico' || urlPath === '/apple-touch-icon.png')) {
const faviconFile = urlPath === '/favicon.ico'
? pathModule.join(ADMIN_FRONTEND_DIR, 'favicon.ico')
: pathModule.join(ADMIN_FRONTEND_DIR, 'branding', 'p2ns-favicon-192.png');
try {
await serveFile(pathModule.join(ADMIN_FRONTEND_DIR, 'favicon.svg'), res);
await serveFile(faviconFile, res);
} catch (err) {
res.writeHead(404, { 'Content-Type': 'text/plain; charset=utf-8' });
res.end('Not Found');
@@ -107,6 +103,13 @@ async function handleStaticRoutes(req, res) {
return true;
}
if (method === 'GET') {
const served = await serveAdminFrontendAsset(urlPath, res);
if (served) {
return true;
}
}
return false;
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@@ -1,5 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" role="img" aria-label="P2NS">
<rect width="32" height="32" rx="6" fill="#0f1419"/>
<rect x="4" y="4" width="24" height="24" rx="4" fill="#6366f1"/>
<path fill="#f1f5f9" d="M9 21V11h3.2c2.4 0 3.9 1.2 3.9 3.1 0 1.3-.7 2.3-1.9 2.8L18 21h-2.6l-2.8-3.5H11.4V21H9zm2.4-5.6h.8c1.1 0 1.7-.5 1.7-1.4s-.6-1.3-1.7-1.3h-.8v2.7zM19.2 21V11h2.4v10h-2.4z"/>
</svg>

Before

Width:  |  Height:  |  Size: 416 B

+9 -2
View File
@@ -5,7 +5,11 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="theme-color" content="#0a0e1a">
<title>P2NS Admin Panel</title>
<link rel="icon" href="/favicon.svg" type="image/svg+xml">
<link rel="icon" href="/favicon.ico" sizes="32x32">
<link rel="icon" href="/branding/p2ns-favicon-32.png" type="image/png" sizes="32x32">
<link rel="icon" href="/branding/p2ns-favicon-192.png" type="image/png" sizes="192x192">
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
@@ -36,7 +40,10 @@
<div class="admin-shell">
<aside id="admin-sidebar" class="admin-sidebar" aria-label="Main navigation">
<div class="admin-sidebar-brand">
<span class="admin-sidebar-brand-title">P2NS</span>
<a href="/" class="admin-sidebar-brand-link" aria-label="P2NS Admin home">
<img src="/branding/p2ns-icon.png" alt="" class="admin-sidebar-brand-logo" width="28" height="28">
<span class="admin-sidebar-brand-title">P2NS</span>
</a>
</div>
<nav class="admin-sidebar-nav">
<div class="admin-nav-section">
@@ -0,0 +1,25 @@
{
"name": "P2NS Admin",
"short_name": "P2NS",
"description": "P2NS network administration panel",
"icons": [
{
"src": "/favicon.ico",
"sizes": "32x32",
"type": "image/png"
},
{
"src": "/branding/p2ns-favicon-192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/branding/p2ns-favicon-512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#0a0e1a",
"background_color": "#0a0e1a",
"display": "standalone"
}
+20
View File
@@ -1484,6 +1484,26 @@ dialog > .dialog-notifications > * {
border-bottom: 1px solid var(--admin-sidebar-border);
}
.admin-sidebar-brand-link {
display: flex;
align-items: center;
gap: 0.625rem;
min-width: 0;
text-decoration: none;
color: inherit;
}
.admin-sidebar-brand-link:hover .admin-sidebar-brand-title {
color: var(--admin-sidebar-fg);
}
.admin-sidebar-brand-logo {
width: 1.75rem;
height: 1.75rem;
flex-shrink: 0;
object-fit: contain;
}
.admin-sidebar-brand-title {
font-size: 0.9375rem;
font-weight: 600;