From b602a4ccc19fc570383f3e279b04e17af40f1f6e Mon Sep 17 00:00:00 2001 From: codex Date: Sat, 24 Oct 2026 15:39:50 +0800 Subject: [PATCH] feat(auth): restore virsh-cloud login styling --- web/public/cloud/account.css | 391 ++++++++++++++++++ .../views/venix/auth/layout_header.tpl | 2 +- web/resources/views/venix/auth/login.tpl | 13 +- web/resources/views/venix/auth/register.tpl | 13 +- .../views/venix/auth/virsh_story.tpl | 15 + web/resources/views/venix/layout_assets.tpl | 2 +- web/tests/AuthVisualContractTest.php | 44 ++ 7 files changed, 472 insertions(+), 8 deletions(-) create mode 100644 web/resources/views/venix/auth/virsh_story.tpl create mode 100644 web/tests/AuthVisualContractTest.php diff --git a/web/public/cloud/account.css b/web/public/cloud/account.css index f080c1cb..22dcf833 100644 --- a/web/public/cloud/account.css +++ b/web/public/cloud/account.css @@ -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%; } +} diff --git a/web/resources/views/venix/auth/layout_header.tpl b/web/resources/views/venix/auth/layout_header.tpl index 309a827b..e1f15e02 100644 --- a/web/resources/views/venix/auth/layout_header.tpl +++ b/web/resources/views/venix/auth/layout_header.tpl @@ -13,7 +13,7 @@ - +
diff --git a/web/resources/views/venix/auth/login.tpl b/web/resources/views/venix/auth/login.tpl index cab764b3..66cbdbe0 100644 --- a/web/resources/views/venix/auth/login.tpl +++ b/web/resources/views/venix/auth/login.tpl @@ -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} -
+{assign var=auth_page value='login'} +{include file='auth/layout_header.tpl' auth_title=$auth_title auth_app_name=$appName auth_page=$auth_page} +
+ {include file='auth/virsh_story.tpl' auth_app_name=$appName auth_page=$auth_page}
-

{if $language == 'true'}Log in{else}登录{/if}

+ {if $language == 'true'}WELCOME BACK{else}欢迎回来{/if} +

{if $language == 'true'}Log in to your account{else}登录账户{/if}

+

{if $language == 'true'}Use your account to access the cloud control panel.{else}使用你的账户进入云服务器控制台。{/if}

@@ -48,6 +52,9 @@
+ +

{if $language == 'true'}No account yet?{else}还没有账户?{/if} {if $language == 'true'}Create one{else}立即注册{/if}

+

{if $language == 'true'}Use an HTTPS connection to protect your account credentials.{else}请通过 HTTPS 安全连接,保护你的账户凭据。{/if}

diff --git a/web/resources/views/venix/auth/register.tpl b/web/resources/views/venix/auth/register.tpl index f5d3fb3b..7805fd8e 100644 --- a/web/resources/views/venix/auth/register.tpl +++ b/web/resources/views/venix/auth/register.tpl @@ -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} -
+{assign var=auth_page value='register'} +{include file='auth/layout_header.tpl' auth_title=$auth_title auth_app_name=$appName auth_page=$auth_page} +
+ {include file='auth/virsh_story.tpl' auth_app_name=$appName auth_page=$auth_page}
-

{if $language == 'true'}Register{else}注册{/if}

+ {if $language == 'true'}CREATE ACCOUNT{else}创建账户{/if} +

{if $language == 'true'}Create your account{else}注册新账户{/if}

+

{if $language == 'true'}Complete the details below to start using the cloud control panel.{else}填写以下信息,开始使用云服务器控制台。{/if}

@@ -62,6 +66,9 @@ {if $language == 'true'}Create account{else}创建账户{/if}
+ +

{if $language == 'true'}Already have an account?{else}已经有账户?{/if} {if $language == 'true'}Return to login{else}返回登录{/if}

+

{if $language == 'true'}Your password and verification code are never stored in browser storage.{else}密码和验证码不会写入浏览器存储。{/if}

diff --git a/web/resources/views/venix/auth/virsh_story.tpl b/web/resources/views/venix/auth/virsh_story.tpl new file mode 100644 index 00000000..0057a1a3 --- /dev/null +++ b/web/resources/views/venix/auth/virsh_story.tpl @@ -0,0 +1,15 @@ + diff --git a/web/resources/views/venix/layout_assets.tpl b/web/resources/views/venix/layout_assets.tpl index 26a7d3a1..219efadd 100644 --- a/web/resources/views/venix/layout_assets.tpl +++ b/web/resources/views/venix/layout_assets.tpl @@ -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'} diff --git a/web/tests/AuthVisualContractTest.php b/web/tests/AuthVisualContractTest.php new file mode 100644 index 00000000..7dc85bee --- /dev/null +++ b/web/tests/AuthVisualContractTest.php @@ -0,0 +1,44 @@ += 2026102413, + 'Shared asset version was not advanced for the authentication stylesheet.'); + +echo "Auth visual contract passed.\n";