feat(auth): restore virsh-cloud login styling

go
codex 4 weeks ago
parent a18e4bd27f
commit b602a4ccc1

@ -1951,3 +1951,394 @@ body.vu-body .vu-toast-actions .vu-btn { min-width: 64px; min-height: 32px; padd
body.vu-body .vu-support-upload-head { align-items: flex-start; flex-direction: column; gap: 3px; }
body.vu-body .vu-support-upload-limit { font-size: 10px; }
}
/* The login and registration pages intentionally reuse the original
virsh-cloud split-screen visual language. Authentication behavior remains
in the current PHP templates and VenixAuth runtime. */
body.venix-auth.virsh-auth {
min-width: 320px;
min-height: 100vh;
min-height: 100svh;
display: block;
overflow-x: hidden;
color: #15243a;
background: #fff;
}
body.venix-auth.virsh-auth .auth-site-nav {
position: absolute;
top: 0;
right: 0;
left: 0;
z-index: 20;
width: 100%;
min-height: 86px;
padding: 24px clamp(32px, 5vw, 88px);
background: transparent;
border: 0;
backdrop-filter: none;
}
body.venix-auth.virsh-auth .auth-site-nav .home-brand {
max-width: min(40vw, 520px);
color: #fff;
font-size: 23px;
letter-spacing: -.6px;
}
body.venix-auth.virsh-auth .auth-site-nav nav {
margin-left: auto;
}
body.venix-auth.virsh-auth .auth-site-nav nav a {
color: #526276;
}
body.venix-auth.virsh-auth .auth-site-nav nav a:hover,
body.venix-auth.virsh-auth .auth-site-nav nav a[aria-current="page"] {
color: #0f8f9a;
background: #e7f7f8;
}
body.venix-auth.virsh-auth .auth-site-nav .home-nav-button,
body.venix-auth.virsh-auth .auth-site-nav .home-nav-button:hover,
body.venix-auth.virsh-auth .auth-site-nav .home-nav-button[aria-current="page"] {
color: #fff;
background: #0f9eaa;
}
body.venix-auth.virsh-auth .auth-shell-virsh {
width: 100%;
min-height: 100vh;
min-height: 100svh;
display: grid;
grid-template-columns: minmax(390px, 48%) minmax(0, 1fr);
place-items: stretch;
padding: 0;
}
body.venix-auth.virsh-auth .auth-story-virsh {
position: relative;
min-height: 650px;
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 150px clamp(38px, 5vw, 90px) 43px;
overflow: hidden;
color: #fff;
background: radial-gradient(circle at 78% 44%, #174c64 0, #122d44 36%, #0d1d31 75%);
}
body.venix-auth.virsh-auth .virsh-auth-art-grid {
position: absolute;
inset: 0;
background-image:
linear-gradient(rgba(143, 221, 226, .065) 1px, transparent 1px),
linear-gradient(90deg, rgba(143, 221, 226, .065) 1px, transparent 1px);
background-size: 50px 50px;
mask-image: linear-gradient(90deg, transparent, #000);
pointer-events: none;
}
body.venix-auth.virsh-auth .auth-story-main {
position: relative;
z-index: 2;
max-width: 500px;
margin: auto 0;
}
body.venix-auth.virsh-auth .auth-kicker,
body.venix-auth.virsh-auth .auth-eyebrow {
display: inline-block;
color: #159da9;
font-size: 11px;
font-weight: 800;
letter-spacing: .14em;
line-height: 1.4;
text-transform: uppercase;
}
body.venix-auth.virsh-auth .auth-story-main .auth-kicker {
color: #53dce0;
}
body.venix-auth.virsh-auth .auth-story-main h1 {
max-width: 530px;
margin: 20px 0 19px;
color: #fff;
font-size: clamp(38px, 4vw, 62px);
font-weight: 750;
line-height: 1.25;
letter-spacing: -1.8px;
}
body.venix-auth.virsh-auth .auth-story-copy {
max-width: 390px;
margin: 0;
color: #bbd1dc;
font-size: 16px;
line-height: 1.85;
}
body.venix-auth.virsh-auth .virsh-auth-status {
position: relative;
z-index: 2;
display: flex;
align-items: center;
gap: 10px;
color: #bed5dc;
font-size: 12px;
letter-spacing: .04em;
}
body.venix-auth.virsh-auth .virsh-auth-online-dot {
width: 8px;
height: 8px;
display: inline-block;
flex: 0 0 auto;
border-radius: 50%;
background: #35d49b;
box-shadow: 0 0 0 4px rgba(53, 212, 155, .12);
}
body.venix-auth.virsh-auth .virsh-auth-orbit {
position: absolute;
width: 560px;
height: 560px;
top: 20%;
right: -220px;
border: 1px solid rgba(90, 220, 220, .19);
border-radius: 50%;
transform: rotate(-28deg);
pointer-events: none;
}
body.venix-auth.virsh-auth .virsh-auth-orbit-two {
width: 390px;
height: 390px;
top: 29%;
right: -135px;
border-color: rgba(90, 220, 220, .27);
}
body.venix-auth.virsh-auth .virsh-auth-core {
position: absolute;
top: 40%;
right: 5%;
width: 240px;
height: 240px;
opacity: .72;
transform: rotate(-22deg);
pointer-events: none;
}
body.venix-auth.virsh-auth .virsh-auth-core span {
position: absolute;
width: 140px;
height: 140px;
display: block;
border: 1px solid rgba(82, 220, 224, .3);
border-radius: 23px;
background: linear-gradient(135deg, rgba(75, 205, 213, .2), rgba(13, 35, 57, .1));
box-shadow: 0 25px 55px rgba(0, 0, 0, .18);
}
body.venix-auth.virsh-auth .virsh-auth-core span:nth-child(2) { top: 43px; left: 38px; }
body.venix-auth.virsh-auth .virsh-auth-core span:nth-child(3) {
top: 86px;
left: 76px;
background: linear-gradient(135deg, rgba(62, 210, 210, .42), rgba(9, 46, 67, .45));
}
body.venix-auth.virsh-auth .auth-panel-wrap {
width: auto;
display: flex;
align-items: center;
justify-content: center;
padding: 118px clamp(30px, 6vw, 96px) 54px;
background: #fff;
}
body.venix-auth.virsh-auth .auth-panel,
body.venix-auth.virsh-auth .auth-panel-wide {
width: min(100%, 430px);
max-width: 430px;
margin: 0;
padding: 0;
color: #15243a;
background: transparent;
border: 0;
border-radius: 0;
box-shadow: none;
transform: none;
}
body.venix-auth.virsh-auth .auth-title {
margin: 14px 0 8px;
color: #15243a;
font-size: 34px;
font-weight: 750;
line-height: 1.2;
letter-spacing: -1px;
}
body.venix-auth.virsh-auth .auth-subtitle {
margin: 0 0 32px;
color: #7a8798;
font-size: 14px;
line-height: 1.7;
}
body.venix-auth.virsh-auth .auth-form {
display: flex;
flex-direction: column;
gap: 17px;
}
body.venix-auth.virsh-auth .auth-panel-wide .auth-row:not(.auth-row-inline) {
align-items: stretch;
flex-direction: column;
gap: 17px;
}
body.venix-auth.virsh-auth .auth-field {
gap: 9px;
}
body.venix-auth.virsh-auth .auth-field label {
color: #34445a;
font-size: 13px;
font-weight: 700;
}
body.venix-auth.virsh-auth .auth-field :where(input, select, textarea) {
min-height: 46px;
padding: 10px 13px;
color: #15243a;
background: #fff;
border-color: #dce4eb;
border-radius: 9px;
}
body.venix-auth.virsh-auth .auth-field :where(input, select, textarea):focus {
border-color: #35b9c0;
box-shadow: 0 0 0 4px rgba(25, 179, 187, .1);
}
body.venix-auth.virsh-auth .auth-field :where(input, textarea)::placeholder {
color: #a6b1be;
}
body.venix-auth.virsh-auth .auth-actions {
display: grid;
grid-template-columns: 1fr;
align-items: stretch;
gap: 12px;
margin-top: 1px;
}
body.venix-auth.virsh-auth .auth-link {
justify-self: end;
padding: 0;
color: #0f8f9a;
font-size: 12px;
font-weight: 800;
}
body.venix-auth.virsh-auth .auth-link:hover {
color: #0b7d87;
background: transparent;
text-decoration: underline;
}
body.venix-auth.virsh-auth .auth-actions .auth-button,
body.venix-auth.virsh-auth .auth-button-block {
width: 100%;
min-height: 48px;
margin-top: 2px;
font-size: 14px;
}
body.venix-auth.virsh-auth .auth-row-inline .auth-button {
min-height: 46px;
margin: 0;
}
body.venix-auth.virsh-auth .auth-row-inline .auth-button-secondary {
color: #445368;
background: #fff;
border-color: #d7e0e8;
box-shadow: none;
}
body.venix-auth.virsh-auth .auth-row-inline .auth-button-secondary:not(:disabled):hover {
color: #304158;
background: #f8fbfc;
border-color: #aebfc8;
box-shadow: none;
}
body.venix-auth.virsh-auth .auth-switch {
margin: 20px 0 0;
color: #708093;
font-size: 12px;
line-height: 1.6;
}
body.venix-auth.virsh-auth .auth-switch a {
color: #0f8f9a;
font-weight: 800;
text-decoration: none;
}
body.venix-auth.virsh-auth .auth-switch a:hover { text-decoration: underline; }
body.venix-auth.virsh-auth .auth-security-hint {
margin: 25px 0 0;
color: #9aa5b2;
font-size: 12px;
line-height: 1.7;
}
@media (max-width: 740px) {
body.venix-auth.virsh-auth .auth-site-nav {
position: relative;
min-height: 68px;
padding: 13px 18px;
background: #fff;
border-bottom: 1px solid #e7edf2;
}
body.venix-auth.virsh-auth .auth-site-nav .home-brand {
max-width: 52vw;
color: #15243a;
font-size: 18px;
}
body.venix-auth.virsh-auth .auth-shell-virsh {
min-height: calc(100vh - 68px);
min-height: calc(100svh - 68px);
display: block;
}
body.venix-auth.virsh-auth .auth-story-virsh { display: none; }
body.venix-auth.virsh-auth .auth-panel-wrap {
min-height: calc(100vh - 68px);
min-height: calc(100svh - 68px);
align-items: flex-start;
padding: 46px 25px 64px;
}
body.venix-auth.virsh-auth .auth-title { font-size: 29px; }
}
@media (max-width: 420px) {
body.venix-auth.virsh-auth .auth-panel-wrap { padding: 38px 20px 54px; }
body.venix-auth.virsh-auth .auth-site-nav nav { gap: 2px; }
body.venix-auth.virsh-auth .auth-site-nav nav a { padding: 7px 8px; font-size: 12px; }
body.venix-auth.virsh-auth .auth-row-inline { flex-wrap: wrap; }
body.venix-auth.virsh-auth .auth-row-inline > input { flex-basis: 100%; }
body.venix-auth.virsh-auth .auth-row-inline .auth-button,
body.venix-auth.virsh-auth .auth-row-inline .auth-captcha { width: 100%; }
}

@ -13,7 +13,7 @@
<link href="/cloud/styles.css?v={$venix_asset_version}" rel="stylesheet">
<link href="/cloud/account.css?v={$venix_asset_version}" rel="stylesheet">
</head>
<body class="venix-auth">
<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>

@ -1,9 +1,13 @@
{if $language == 'true'}{assign var=auth_title value='Log in'}{else}{assign var=auth_title value='登录'}{/if}
{include file='auth/layout_header.tpl' auth_title=$auth_title auth_app_name=$appName}
<main class="auth-shell">
{assign var=auth_page value='login'}
{include file='auth/layout_header.tpl' auth_title=$auth_title auth_app_name=$appName auth_page=$auth_page}
<main class="auth-shell auth-shell-virsh">
{include file='auth/virsh_story.tpl' auth_app_name=$appName auth_page=$auth_page}
<section class="auth-panel-wrap">
<div class="auth-panel">
<h2 class="auth-title">{if $language == 'true'}Log in{else}登录{/if}</h2>
<span class="auth-eyebrow">{if $language == 'true'}WELCOME BACK{else}欢迎回来{/if}</span>
<h2 class="auth-title">{if $language == 'true'}Log in to your account{else}登录账户{/if}</h2>
<p class="auth-subtitle">{if $language == 'true'}Use your account to access the cloud control panel.{else}使用你的账户进入云服务器控制台。{/if}</p>
<form class="auth-form" id="loginForm" autocomplete="on">
<div class="auth-message" data-auth-message></div>
@ -48,6 +52,9 @@
<button type="submit" class="auth-button" id="login">{if $language == 'true'}Log in{else}登录{/if}</button>
</div>
</form>
<p class="auth-switch">{if $language == 'true'}No account yet?{else}还没有账户?{/if} <a href="/auth/register">{if $language == 'true'}Create one{else}立即注册{/if}</a></p>
<p class="auth-security-hint">{if $language == 'true'}Use an HTTPS connection to protect your account credentials.{else}请通过 HTTPS 安全连接,保护你的账户凭据。{/if}</p>
</div>
</section>
</main>

@ -1,9 +1,13 @@
{if $language == 'true'}{assign var=auth_title value='Register'}{else}{assign var=auth_title value='注册'}{/if}
{include file='auth/layout_header.tpl' auth_title=$auth_title auth_app_name=$appName}
<main class="auth-shell">
{assign var=auth_page value='register'}
{include file='auth/layout_header.tpl' auth_title=$auth_title auth_app_name=$appName auth_page=$auth_page}
<main class="auth-shell auth-shell-virsh">
{include file='auth/virsh_story.tpl' auth_app_name=$appName auth_page=$auth_page}
<section class="auth-panel-wrap">
<div class="auth-panel auth-panel-wide">
<h2 class="auth-title">{if $language == 'true'}Register{else}注册{/if}</h2>
<span class="auth-eyebrow">{if $language == 'true'}CREATE ACCOUNT{else}创建账户{/if}</span>
<h2 class="auth-title">{if $language == 'true'}Create your account{else}注册新账户{/if}</h2>
<p class="auth-subtitle">{if $language == 'true'}Complete the details below to start using the cloud control panel.{else}填写以下信息,开始使用云服务器控制台。{/if}</p>
<form class="auth-form" id="registerForm" autocomplete="on">
<div class="auth-message" data-auth-message></div>
@ -62,6 +66,9 @@
{if $language == 'true'}Create account{else}创建账户{/if}
</button>
</form>
<p class="auth-switch">{if $language == 'true'}Already have an account?{else}已经有账户?{/if} <a href="/auth/login">{if $language == 'true'}Return to login{else}返回登录{/if}</a></p>
<p class="auth-security-hint">{if $language == 'true'}Your password and verification code are never stored in browser storage.{else}密码和验证码不会写入浏览器存储。{/if}</p>
</div>
</section>
</main>

@ -0,0 +1,15 @@
<section class="auth-story auth-story-virsh" aria-hidden="true">
<div class="virsh-auth-art-grid"></div>
<div class="auth-story-main">
<span class="auth-kicker">{if $language == 'true'}VIRTUALIZATION CONTROL CENTER{else}虚拟化控制中心{/if}</span>
<h1>{if $language == 'true'}Keep every cloud server under control.{else}让每一台云服务器<br>都尽在掌控。{/if}</h1>
<p class="auth-story-copy">{if $language == 'true'}Deploy and manage your cloud servers from one secure, focused workspace.{else}从一个安全、清晰的界面,部署并管理你的云服务器。{/if}</p>
</div>
<div class="virsh-auth-status">
<span class="virsh-auth-online-dot"></span>
<span>{$auth_app_name|escape:"html"}</span>
</div>
<div class="virsh-auth-orbit virsh-auth-orbit-one"></div>
<div class="virsh-auth-orbit virsh-auth-orbit-two"></div>
<div class="virsh-auth-core"><span></span><span></span><span></span></div>
</section>

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

@ -0,0 +1,44 @@
<?php
$root = dirname(__DIR__);
$views = $root . '/resources/views/venix';
$assert = static function ($condition, $message) {
if (!$condition) throw new RuntimeException($message);
};
$login = file_get_contents($views . '/auth/login.tpl');
$register = file_get_contents($views . '/auth/register.tpl');
$layout = file_get_contents($views . '/auth/layout_header.tpl');
$story = file_get_contents($views . '/auth/virsh_story.tpl');
$styles = file_get_contents($root . '/public/cloud/account.css');
$assets = file_get_contents($views . '/layout_assets.tpl');
foreach ([$login, $register] as $template) {
$assert(str_contains($template, 'auth-shell auth-shell-virsh'),
'Authentication page is missing the virsh-cloud shell.');
$assert(str_contains($template, "include file='auth/virsh_story.tpl'"),
'Authentication page is missing the shared virsh-cloud artwork.');
$assert(str_contains($template, 'class="auth-security-hint"'),
'Authentication page is missing the secure-access hint.');
}
$assert(str_contains($layout, 'venix-auth{if isset($auth_page)} virsh-auth{/if}'),
'Authentication layout does not scope the migrated visual treatment.');
$assert(str_contains($story, '{$auth_app_name|escape:"html"}')
&& !str_contains($story, 'VirtPilot'),
'Virsh-cloud artwork must use the configured site name.');
$assert(str_contains($styles, 'grid-template-columns: minmax(390px, 48%) minmax(0, 1fr);')
&& str_contains($styles, '.auth-story-virsh')
&& str_contains($styles, '.virsh-auth-art-grid')
&& str_contains($styles, '@media (max-width: 740px)')
&& str_contains($styles, '.auth-story-virsh { display: none; }'),
'Responsive virsh-cloud authentication styles are incomplete.');
$assert(str_contains($login, "VenixAuth.post('/auth/login'")
&& str_contains($register, "VenixAuth.post('/auth/register'"),
'Authentication endpoints changed while migrating visual styles.');
$assert(preg_match("/venix_asset_version value='([0-9]+)'/", $assets, $version) === 1
&& (int) $version[1] >= 2026102413,
'Shared asset version was not advanced for the authentication stylesheet.');
echo "Auth visual contract passed.\n";
Loading…
Cancel
Save