feat(web): unify site branding across pages

go
codex 4 weeks ago
parent 06faa2dc30
commit e118365157

@ -1355,7 +1355,6 @@ body.venix-auth .auth-legal-consent a:hover { text-decoration: underline; }
}
body.venix-auth .auth-site-nav { min-height: 68px; padding: 13px 16px; }
body.venix-auth .auth-site-nav .home-brand { font-size: 17px; }
body.venix-auth .auth-site-nav .brand-mark { width: 30px; height: 30px; }
body.venix-auth .auth-site-nav nav a { padding: 7px 8px; font-size: 12px; }
body.venix-auth .auth-shell { align-items: start; padding: 28px 14px; }
body.venix-auth .auth-panel { padding: 26px 20px; border-radius: 15px; }

@ -10,7 +10,6 @@
.panel-sidebar-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 9px; }
.sidebar a.sidebar-brand { min-width: 0; max-width: 100%; overflow: hidden; text-decoration: none; }
.sidebar-brand > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-brand small { overflow: hidden; text-overflow: ellipsis; }
.panel-nav-toggle { display: none; min-height: 36px; align-items: center; gap: 6px; padding: 7px 9px; border: 1px solid #294255; border-radius: 8px; background: #172c3e; color: #b9ccd8; font-size: 11px; font-weight: 700; }
.cloud-sidebar-nav .sidebar-section-label:not(:first-child) { margin-top: 25px; }
.cloud-sidebar-nav .sidebar-link { width: 100%; text-decoration: none; }

@ -8,10 +8,6 @@ button:disabled{cursor:not-allowed;opacity:.52}
input,select{outline:none}
input:focus,select:focus,button:focus-visible{outline:3px solid rgba(18,166,176,.22);outline-offset:2px}
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.brand-mark{display:inline-flex;width:34px;height:34px;align-items:center;justify-content:center;border-radius:10px;background:#2ac6ca;box-shadow:0 7px 17px rgba(16,172,184,.18);flex:none}
.brand-mark:before,.brand-mark span{content:"";display:block;width:11px;height:17px;border:3px solid #0c2a3f;transform:skewY(-22deg);border-radius:2px}
.brand-mark:before{border-right:0;margin-right:-1px}
.brand-mark span{border-left:0;margin-left:-1px}
.boot-screen{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;gap:13px;background:#f4f7fb;color:#607087;font-size:14px;z-index:50}
.login-layout{min-height:100vh;display:grid;grid-template-columns:minmax(390px,48%) 1fr;background:#fff}
.login-art{position:relative;min-height:650px;overflow:hidden;background:radial-gradient(circle at 78% 44%,#174c64 0,#122d44 36%,#0d1d31 75%);color:#fff}
@ -79,7 +75,6 @@ input:focus,select:focus,button:focus-visible{outline:3px solid rgba(18,166,176,
.dashboard{min-height:100vh;display:grid;grid-template-columns:244px minmax(0,1fr)}
.sidebar{position:sticky;top:0;height:100vh;background:#101d2c;color:#d2dce6;padding:32px 15px 22px;display:flex;flex-direction:column}
.sidebar-brand{display:flex;align-items:center;gap:11px;padding:0 13px 46px;font-size:19px;color:#fff;letter-spacing:-.3px;font-weight:800}
.sidebar-brand small{display:block;color:#668197;font-size:8px;letter-spacing:.2em;margin-top:2px}
.sidebar-section-label{color:#64798f;text-transform:uppercase;letter-spacing:.14em;font-size:10px;font-weight:800;margin:0 15px 16px}
.sidebar-link{height:43px;display:flex;align-items:center;gap:13px;padding:0 14px;border-radius:9px;color:#8da2b6;font-size:13px;font-weight:700}
.sidebar-button{width:100%;border:0;background:transparent;text-align:left;font:inherit;cursor:pointer}.sidebar-button:hover{background:#1a3445;color:#d0eeee}

@ -85,6 +85,28 @@
gap: 10px;
}
.admin-template .logo .admin-site-brand {
max-width: 205px;
display: flex;
align-items: center;
gap: 11px;
color: #fff;
font-size: 18px;
font-weight: 850;
letter-spacing: -.03em;
line-height: 1;
}
.admin-template .logo .admin-site-brand > span:last-child {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.admin-template .logo .logo-sm {
line-height: 1;
}
.admin-template .logo-dark {
display: none;
}

@ -60,23 +60,6 @@ body.venix-home ::selection { color: #04191b; background: var(--landing-teal-bri
text-decoration: none;
white-space: nowrap;
}
.landing-brand-mark {
position: relative;
width: 31px;
height: 31px;
display: inline-block;
flex: 0 0 auto;
color: var(--landing-teal-bright);
transform: rotate(45deg);
}
.landing-brand-mark i {
position: absolute;
display: block;
border: 6px solid currentColor;
border-radius: 4px;
}
.landing-brand-mark i:first-child { inset: 2px 11px 11px 2px; }
.landing-brand-mark i:last-child { inset: 11px 2px 2px 11px; opacity: .58; }
.landing-main-nav { margin-left: auto; display: flex; align-items: center; justify-content: flex-end; gap: 34px; }
.landing-main-nav a {
position: relative;
@ -395,7 +378,6 @@ body.venix-home > main.home-error { width: 100%; min-height: 100vh; min-height:
.landing-site-header { min-height: 76px; }
.landing-site-header::before { height: 76px; }
.landing-brand { font-size: 16px; }
.landing-brand-mark { width: 27px; height: 27px; }
.landing-hero { min-height: auto; padding: 126px 18px 66px; }
.landing-hero h1 { font-size: clamp(43px, 13vw, 63px); }
.landing-hero-copy > p { font-size: 14px; line-height: 1.75; }

@ -0,0 +1,21 @@
/* Canonical site mark shared by public, authentication, user and admin pages. */
.site-brand-mark {
position: relative;
width: 31px;
height: 31px;
display: inline-block;
flex: 0 0 auto;
color: #2de2c2;
transform: rotate(45deg);
}
.site-brand-mark i {
position: absolute;
display: block;
border: 6px solid currentColor;
border-radius: 4px;
box-sizing: border-box;
}
.site-brand-mark i:first-child { inset: 2px 11px 11px 2px; }
.site-brand-mark i:last-child { inset: 11px 2px 2px 11px; opacity: .58; }

@ -10,6 +10,7 @@
<link href="{$cdn}/theme/venix/css/app.min.css?v={$venix_asset_version}" rel="stylesheet" type="text/css">
<link href="{$cdn}/theme/venix/css/icons.min.css?v={$venix_asset_version}" rel="stylesheet" type="text/css">
<link href="{$cdn}/theme/venix/css/admin-home.css?v={$venix_asset_version}" rel="stylesheet" type="text/css">
<link href="/theme/venix/css/site-brand.css?v={$venix_asset_version}" rel="stylesheet" type="text/css">
{if isset($admin_extra_css)}{$admin_extra_css}{/if}
<script>window.ADMIN_CSRF_TOKEN = '{$admin_csrf_token|default:''|escape:"javascript"}';</script>
<script src="/theme/venix/js/admin-csrf.js?v={$venix_asset_version}"></script>
@ -122,13 +123,13 @@
<div class="h-100">
<div id="sidebar-menu">
<div class="logo-box">
<a href="/admin" class="logo logo-light">
<span class="logo-sm"><img src="{$cdn}/theme/venix/images/logo-sm.png" alt="" height="24"></span>
<span class="logo-lg"><img src="{$cdn}/theme/venix/images/logo-light.png" alt="" height="28"></span>
<a href="/admin" class="logo logo-light" aria-label="{$config["appName"]|escape:"html"}管理后台">
<span class="logo-sm">{include file='components/site_brand_mark.tpl'}</span>
<span class="logo-lg admin-site-brand">{include file='components/site_brand_mark.tpl'}<span>{$config["appName"]|escape:"html"}</span></span>
</a>
<a href="/admin" class="logo logo-dark">
<span class="logo-sm"><img src="{$cdn}/theme/venix/images/logo-sm.png" alt="" height="24"></span>
<span class="logo-lg"><img src="{$cdn}/theme/venix/images/logo-dark.png" alt="" height="28"></span>
<a href="/admin" class="logo logo-dark" aria-label="{$config["appName"]|escape:"html"}管理后台">
<span class="logo-sm">{include file='components/site_brand_mark.tpl'}</span>
<span class="logo-lg admin-site-brand">{include file='components/site_brand_mark.tpl'}<span>{$config["appName"]|escape:"html"}</span></span>
</a>
</div>

@ -12,11 +12,12 @@
<link href="{$cdn}/theme/venix/css/icons.min.css?v={$venix_asset_version}" rel="stylesheet">
<link href="/cloud/styles.css?v={$venix_asset_version}" rel="stylesheet">
<link href="/cloud/account.css?v={$venix_asset_version}" rel="stylesheet">
<link href="/theme/venix/css/site-brand.css?v={$venix_asset_version}" rel="stylesheet">
</head>
<body class="venix-auth{if isset($auth_page)} virsh-auth{/if}"{if isset($auth_page)} data-auth-page="{$auth_page|escape:'html'}"{/if}>
<header class="auth-site-nav">
<a class="home-brand" href="/" aria-label="{$auth_app_name|escape:"html"}{if $language == 'true'} home{else}首页{/if}">
<span class="brand-mark" aria-hidden="true"><span></span></span>
{include file='components/site_brand_mark.tpl'}
<span>{$auth_app_name|escape:"html"}</span>
</a>
<nav aria-label="{if $language == 'true'}Account navigation{else}账户导航{/if}">

@ -9,6 +9,7 @@
<link rel="stylesheet" href="/theme/venix/css/icons.min.css?v={$venix_asset_version}"/>
<link rel="stylesheet" href="/cloud/styles.css?v={$venix_asset_version}"/>
<link rel="stylesheet" href="/cloud/client.css?v={$venix_asset_version}"/>
<link rel="stylesheet" href="/theme/venix/css/site-brand.css?v={$venix_asset_version}"/>
</head>
<body data-cloud-page="{$cloud_page|escape:"html"}" data-asset-version="{$venix_asset_version|escape:"html"}"{if $cloud_vm_id != ''} data-vm-id="{$cloud_vm_id|escape:"html"}"{/if}{if $cloud_invoice_id != ''} data-invoice-id="{$cloud_invoice_id|escape:"html"}"{/if}>
<div id="dashboard-view" class="dashboard user-dashboard">

@ -0,0 +1 @@
<span class="site-brand-mark" aria-hidden="true"><i></i><i></i></span>

@ -13,6 +13,7 @@
<link href="{$cdn}/theme/venix/css/app.min.css?v={$venix_asset_version}" rel="stylesheet">
<link href="{$cdn}/theme/venix/css/icons.min.css?v={$venix_asset_version}" rel="stylesheet">
<link href="{$cdn}/theme/venix/css/home.css?v={$venix_asset_version}" rel="stylesheet">
<link href="/theme/venix/css/site-brand.css?v={$venix_asset_version}" rel="stylesheet">
{if $home_is_error}<link href="{$cdn}/theme/venix/css/home-error.css?v={$venix_asset_version}" rel="stylesheet">{/if}
</head>
<body class="venix-home{$home_body_class|default:''|escape:'html'}">

@ -1,7 +1,7 @@
<footer class="landing-site-footer">
<div class="landing-footer-brand">
<a class="landing-brand" href="/">
<span class="landing-brand-mark" aria-hidden="true"><i></i><i></i></span>
{include file='components/site_brand_mark.tpl'}
<span>{$appName|escape:'html'}</span>
</a>
<p>{if $language == 'true'}A clear, reliable way to manage cloud servers.{else}清晰、可靠的云服务器管理体验。{/if}</p>

@ -1,6 +1,6 @@
<header class="landing-site-header" data-site-header>
<a class="landing-brand" href="/" aria-label="{$appName|escape:'html'}{if $language == 'true'} home{else}首页{/if}">
<span class="landing-brand-mark" aria-hidden="true"><i></i><i></i></span>
{include file='components/site_brand_mark.tpl'}
<span>{$appName|escape:'html'}</span>
</a>
<nav class="landing-main-nav" id="landing-main-nav" aria-label="{if $language == 'true'}Main navigation{else}主导航{/if}">

@ -1,2 +1,2 @@
{* Shared Venix CSS/JS cache key. Increment whenever a shared browser asset changes. *}
{assign var=venix_asset_version value='2026102416' scope='global'}
{assign var=venix_asset_version value='2026102417' scope='global'}

@ -2,8 +2,8 @@
<main class="vu-disabled-page">
<section class="vu-disabled-card">
<div class="vu-disabled-brand">
<img src="/theme/venix/images/logo-sm.png" alt="">
<span>{$config["appName"]}</span>
{include file='components/site_brand_mark.tpl'}
<span>{$config["appName"]|escape:"html"}</span>
</div>
<div class="vu-disabled-mark">

@ -15,6 +15,7 @@
<link href="/cloud/styles.css?v={$vu_asset_version}" rel="stylesheet">
<link href="/cloud/client.css?v={$vu_asset_version}" rel="stylesheet">
<link href="/cloud/account.css?v={$vu_asset_version}" rel="stylesheet">
<link href="/theme/venix/css/site-brand.css?v={$vu_asset_version}" rel="stylesheet">
</head>
<body class="vu-body{if !empty($smarty.get.drawer)} vu-embedded{/if}">
<div class="dashboard user-dashboard">

@ -24,5 +24,6 @@
<link href="{$cdn}/theme/venix/css/icons.min.css?v={$vu_asset_version}" rel="stylesheet">
<link href="/cloud/styles.css?v={$vu_asset_version}" rel="stylesheet">
<link href="/cloud/account.css?v={$vu_asset_version}" rel="stylesheet">
<link href="/theme/venix/css/site-brand.css?v={$vu_asset_version}" rel="stylesheet">
</head>
<body class="vu-body">

@ -4,8 +4,8 @@
<aside class="sidebar panel-sidebar" aria-label="用户中心侧栏">
<div class="panel-sidebar-header">
<a class="sidebar-brand" href="/user/cloud/instances" aria-label="{$config["appName"]|escape:"html"}用户中心">
<span class="brand-mark" aria-hidden="true"><span></span></span>
<span>{$config["appName"]|escape:"html"}<small>CONTROL PANEL</small></span>
{include file='components/site_brand_mark.tpl'}
<span>{$config["appName"]|escape:"html"}</span>
</a>
<button class="panel-nav-toggle" type="button" aria-controls="panel-user-navigation" aria-expanded="false" aria-label="展开用户中心导航">
<i class="mdi mdi-menu" aria-hidden="true"></i><span>导航</span>

@ -73,7 +73,7 @@ $assert(str_contains($auth, "Config::get('tos_reg') === 'true'")
'Legal consent is only client-side and can be bypassed.');
$assets = $read('web/resources/views/venix/layout_assets.tpl');
$assert(str_contains($assets, "value='2026102416'")
$assert(str_contains($assets, "value='2026102417'")
&& str_contains($admin, '?v={$venix_asset_version}')
&& str_contains($read('web/resources/views/venix/home/layout_header.tpl'), '?v={$venix_asset_version}'),
'Shared browser asset version was not coupled to the new assets.');

@ -0,0 +1,74 @@
<?php
$root = dirname(__DIR__, 2);
$read = static function (string $path) use ($root): string {
$content = file_get_contents($root . '/' . $path);
if ($content === false) {
throw new RuntimeException('Cannot read ' . $path);
}
return $content;
};
$assert = static function (bool $condition, string $message): void {
if (!$condition) {
throw new RuntimeException($message);
}
};
$partialPath = 'web/resources/views/venix/components/site_brand_mark.tpl';
$partial = $read($partialPath);
$style = $read('web/public/theme/venix/css/site-brand.css');
$assert(str_contains($partial, 'class="site-brand-mark"')
&& substr_count($partial, '<i></i>') === 2,
'The shared site-brand partial is not the approved two-square mark.');
$assert(str_contains($style, 'transform: rotate(45deg)')
&& str_contains($style, 'border: 6px solid currentColor')
&& str_contains($style, 'color: #2de2c2'),
'The shared site-brand style drifted from the landing-page mark.');
$layouts = [
'web/resources/views/venix/home/layout_header.tpl',
'web/resources/views/venix/auth/layout_header.tpl',
'web/resources/views/venix/user/layout_header.tpl',
'web/resources/views/venix/user/layout_plain_header.tpl',
'web/resources/views/venix/cloud/page.tpl',
'web/resources/views/venix/admin/static_header.tpl',
];
foreach ($layouts as $layout) {
$assert(str_contains($read($layout), '/theme/venix/css/site-brand.css?v='),
$layout . ' does not load the canonical site-brand stylesheet.');
}
$presenters = [
'web/resources/views/venix/home/site_header.tpl' => 1,
'web/resources/views/venix/home/site_footer.tpl' => 1,
'web/resources/views/venix/auth/layout_header.tpl' => 1,
'web/resources/views/venix/user/panel_sidebar.tpl' => 1,
'web/resources/views/venix/user/disable.tpl' => 1,
'web/resources/views/venix/admin/static_header.tpl' => 4,
];
foreach ($presenters as $template => $expectedIncludes) {
$assert(substr_count($read($template), "include file='components/site_brand_mark.tpl'") === $expectedIncludes,
$template . ' does not render the canonical site-brand mark.');
}
$templates = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
$root . '/web/resources/views/venix',
FilesystemIterator::SKIP_DOTS
));
foreach ($templates as $template) {
if (!$template->isFile() || $template->getExtension() !== 'tpl') {
continue;
}
$content = file_get_contents($template->getPathname());
$assert($content !== false, 'Cannot read ' . $template->getPathname());
$assert(!str_contains($content, 'class="brand-mark"')
&& !str_contains($content, 'landing-brand-mark')
&& !preg_match('/logo-(?:sm|light|dark)\.png/', $content),
'A legacy visible site logo remains in ' . $template->getPathname());
}
$assets = $read('web/resources/views/venix/layout_assets.tpl');
$assert(str_contains($assets, "value='2026102417'"),
'The shared asset version was not updated for the canonical logo.');
echo "Shared site-brand contract passed across public, auth, user, cloud and admin layouts.\n";
Loading…
Cancel
Save