feat: 登录页采用杆塔立面风格
This commit is contained in:
@@ -5,6 +5,7 @@ import { NButton, NInput, NModal, NSpin } from "naive-ui";
|
||||
import { api, saveSession } from "../../shared/http";
|
||||
import { useToast } from "../../shared/toast";
|
||||
import ThemeButton from "../../shell/ThemeButton.vue";
|
||||
import "./login-gate.css";
|
||||
|
||||
const props = defineProps<{ purpose?: "login" | "pool" }>();
|
||||
const emit = defineEmits<{ done: [] }>();
|
||||
@@ -34,6 +35,7 @@ const countdown = ref(0);
|
||||
const busy = ref(false);
|
||||
const noticeVisible = ref(false);
|
||||
const noticePinned = ref(false);
|
||||
const accountHint = computed(() => (mode.value === "nqi" ? "大数据平台账号" : "管理员账号"));
|
||||
let countdownTimer = 0;
|
||||
let noticeTimer = 0;
|
||||
|
||||
@@ -295,28 +297,54 @@ async function finishNqi() {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :class="purpose === 'pool' ? '' : 'gate'">
|
||||
<ThemeButton v-if="purpose !== 'pool'" />
|
||||
<section :class="purpose === 'pool' ? 'lv-embed' : 'lv-side'">
|
||||
<div v-if="purpose !== 'pool'" class="lv-brand"><div class="lv-mark" aria-hidden="true">D</div><h1>DecomEval</h1></div>
|
||||
<section v-if="purpose === 'pool'" class="lv-embed">
|
||||
<p v-if="noticeVisible" class="lv-notice">请使用大数据平台账号登录</p>
|
||||
<form class="lv-fields" @submit.prevent="submitLogin">
|
||||
<label for="pool-account">账号</label>
|
||||
<n-input :input-props="{ id: 'pool-account', autocomplete: 'username' }" v-model:value="username" @keyup.enter="submitLogin" />
|
||||
<label for="pool-password">密码</label>
|
||||
<n-input :input-props="{ id: 'pool-password', autocomplete: 'current-password' }" v-model:value="password" type="password" show-password-on="click" @keyup.enter="submitLogin" />
|
||||
<label for="pool-captcha">验证码</label>
|
||||
<div class="lv-captcha">
|
||||
<n-input :input-props="{ id: 'pool-captcha', autocomplete: 'off' }" v-model:value="captcha" @keyup.enter="submitLogin" />
|
||||
<button type="button" class="lv-captcha-box" title="点击刷新" @click="refreshCaptcha">
|
||||
<n-spin v-if="captchaLoading" size="small" />
|
||||
<img v-else :src="captchaSrc" alt="验证码" @error="markCaptchaBroken" />
|
||||
</button>
|
||||
</div>
|
||||
<n-button class="lv-go" type="primary" attr-type="submit" :loading="busy">添加</n-button>
|
||||
</form>
|
||||
</section>
|
||||
<div v-else class="gate lv-tower">
|
||||
<ThemeButton />
|
||||
<div class="lv-mast" aria-hidden="true"><span /></div>
|
||||
<section class="lv-side">
|
||||
<div class="lv-brand">
|
||||
<h1>DecomEval</h1>
|
||||
<p class="lv-lede">杆塔立面标注</p>
|
||||
</div>
|
||||
<p v-if="noticeVisible" class="lv-notice">请使用大数据平台账号登录</p>
|
||||
<form class="lv-fields" @submit.prevent="submitLogin">
|
||||
<label for="login-account">账号</label>
|
||||
<n-input :input-props="{ id: 'login-account', autocomplete: 'username' }" v-model:value="username" @keyup.enter="submitLogin" />
|
||||
<input id="login-account" v-model="username" :placeholder="accountHint" autocomplete="username" @keyup.enter="submitLogin" />
|
||||
<label for="login-password">密码</label>
|
||||
<n-input :input-props="{ id: 'login-password', autocomplete: 'current-password' }" v-model:value="password" type="password" show-password-on="click" @keyup.enter="submitLogin" />
|
||||
<input id="login-password" v-model="password" type="password" placeholder="密码" autocomplete="current-password" @keyup.enter="submitLogin" />
|
||||
<template v-if="mode === 'nqi'">
|
||||
<label for="login-captcha">验证码</label>
|
||||
<div class="lv-captcha">
|
||||
<n-input :input-props="{ id: 'login-captcha', autocomplete: 'off' }" v-model:value="captcha" @keyup.enter="submitLogin" />
|
||||
<input id="login-captcha" v-model="captcha" placeholder="验证码" autocomplete="off" @keyup.enter="submitLogin" />
|
||||
<button type="button" class="lv-captcha-box" title="点击刷新" @click="refreshCaptcha">
|
||||
<n-spin v-if="captchaLoading" size="small" />
|
||||
<img v-else :src="captchaSrc" alt="验证码" @error="markCaptchaBroken" />
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
<n-button class="lv-go" type="primary" attr-type="submit" :loading="busy">{{ purpose === "pool" ? "添加" : "登录" }}</n-button>
|
||||
<button class="lv-go" type="submit" :disabled="busy">{{ busy ? "登录中" : "登录" }}</button>
|
||||
</form>
|
||||
<div class="lv-block">
|
||||
<b>图纸</b><span>立面</span>
|
||||
<b>比例</b><span>示意</span>
|
||||
</div>
|
||||
</section>
|
||||
<n-modal v-model:show="smsRequired" class="app-dialog" :mask-closable="false" preset="card" title="短信认证">
|
||||
<n-input v-model:value="smsCode" placeholder="请输入短信验证码" @keyup.enter="finishNqi" />
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
.gate.lv-tower {
|
||||
--paper: color-mix(in srgb, #ebe4d2 70%, #d7dce2);
|
||||
--ink-line: #2c3038;
|
||||
display: grid;
|
||||
grid-template-columns: 88px minmax(0, 1fr);
|
||||
align-items: stretch;
|
||||
justify-items: stretch;
|
||||
height: 100%;
|
||||
min-height: 0;
|
||||
padding: 0;
|
||||
overflow: hidden;
|
||||
background: var(--paper);
|
||||
color: var(--ink-line);
|
||||
font-family: SimSun, "Songti SC", serif;
|
||||
}
|
||||
.gate.lv-tower .theme-switch {
|
||||
position: absolute;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
color: var(--ink-line);
|
||||
}
|
||||
.gate.lv-tower .lv-mast {
|
||||
position: relative;
|
||||
align-self: stretch;
|
||||
min-height: 100%;
|
||||
border-right: 1px solid var(--ink-line);
|
||||
overflow: hidden;
|
||||
background:
|
||||
repeating-linear-gradient(180deg, var(--ink-line) 0 1px, transparent 1px 36px) 64% 12% / 18px 80% no-repeat,
|
||||
linear-gradient(var(--ink-line), var(--ink-line)) 50% 12% / 2px 80% no-repeat;
|
||||
}
|
||||
.gate.lv-tower .lv-mast span {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 8%;
|
||||
width: 2px;
|
||||
height: 84%;
|
||||
background: var(--ink-line);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.gate.lv-tower .lv-mast span::before,
|
||||
.gate.lv-tower .lv-mast span::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
width: 18px;
|
||||
height: 1px;
|
||||
background: var(--ink-line);
|
||||
transform: translateX(-50%);
|
||||
}
|
||||
.gate.lv-tower .lv-mast span::before {
|
||||
top: 12%;
|
||||
box-shadow: 0 48px var(--ink-line), 0 96px var(--ink-line), 0 144px var(--ink-line);
|
||||
}
|
||||
.gate.lv-tower .lv-mast span::after {
|
||||
top: 36%;
|
||||
width: 28px;
|
||||
}
|
||||
.gate.lv-tower .lv-side {
|
||||
width: min(460px, calc(100% - 48px));
|
||||
margin: auto;
|
||||
padding: 28px 0 32px;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
border-radius: 0;
|
||||
color: var(--ink-line);
|
||||
}
|
||||
.gate.lv-tower .lv-brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 4px;
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
.gate.lv-tower .lv-side h1 {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.18em;
|
||||
}
|
||||
.gate.lv-tower .lv-lede {
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
.gate.lv-tower .lv-notice,
|
||||
.gate.lv-tower .lv-brand + .lv-notice {
|
||||
margin: 0 0 16px;
|
||||
padding: 6px 0;
|
||||
border: 0;
|
||||
border-top: 1px solid var(--ink-line);
|
||||
border-bottom: 1px solid var(--ink-line);
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: var(--ink-line);
|
||||
text-align: left;
|
||||
font-size: 13px;
|
||||
}
|
||||
.gate.lv-tower .lv-fields {
|
||||
display: grid;
|
||||
grid-template-columns: 4.2em minmax(0, 1fr);
|
||||
column-gap: 12px;
|
||||
row-gap: 12px;
|
||||
align-items: center;
|
||||
padding: 8px 0 0;
|
||||
}
|
||||
.gate.lv-tower .lv-fields label {
|
||||
margin: 0;
|
||||
color: var(--ink-line);
|
||||
}
|
||||
.gate.lv-tower .lv-fields input {
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
height: 36px;
|
||||
padding: 0 8px;
|
||||
border: 1px solid var(--ink-line);
|
||||
border-radius: 0;
|
||||
background: color-mix(in srgb, var(--paper) 70%, #fff);
|
||||
color: var(--ink-line);
|
||||
font: inherit;
|
||||
outline: none;
|
||||
}
|
||||
.gate.lv-tower .lv-fields input:focus {
|
||||
box-shadow: inset 0 0 0 1px var(--ink-line);
|
||||
}
|
||||
.gate.lv-tower .lv-captcha,
|
||||
.gate.lv-tower .lv-go {
|
||||
grid-column: 2;
|
||||
}
|
||||
.gate.lv-tower .lv-captcha {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
.gate.lv-tower .lv-captcha input { flex: 1; }
|
||||
.gate.lv-tower .lv-captcha-box {
|
||||
width: 108px;
|
||||
height: 36px;
|
||||
padding: 0;
|
||||
border: 1px solid var(--ink-line);
|
||||
border-radius: 0;
|
||||
background: #fff;
|
||||
}
|
||||
.gate.lv-tower .lv-captcha-box:hover { border-color: var(--ink-line); }
|
||||
.gate.lv-tower .lv-go {
|
||||
justify-self: stretch;
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
margin-top: 8px;
|
||||
border: 1px solid var(--ink-line);
|
||||
border-radius: 0;
|
||||
background: var(--ink-line);
|
||||
color: var(--paper);
|
||||
font: inherit;
|
||||
font-size: 16px;
|
||||
letter-spacing: 0.3em;
|
||||
cursor: pointer;
|
||||
}
|
||||
.gate.lv-tower .lv-go:hover { filter: brightness(1.12); }
|
||||
.gate.lv-tower .lv-go:disabled { opacity: 0.6; cursor: default; filter: none; }
|
||||
.gate.lv-tower .lv-block {
|
||||
margin-top: 28px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
border: 1px solid var(--ink-line);
|
||||
font-size: 12px;
|
||||
}
|
||||
.gate.lv-tower .lv-block b,
|
||||
.gate.lv-tower .lv-block span {
|
||||
padding: 8px 10px;
|
||||
border-right: 1px solid var(--ink-line);
|
||||
border-bottom: 1px solid var(--ink-line);
|
||||
font-weight: 400;
|
||||
}
|
||||
.gate.lv-tower .lv-block :nth-child(2n) { border-right: 0; }
|
||||
.gate.lv-tower .lv-block :nth-last-child(-n + 2) { border-bottom: 0; }
|
||||
|
||||
@media (max-width: 720px) {
|
||||
.gate.lv-tower { grid-template-columns: 28px 1fr; }
|
||||
.gate.lv-tower .lv-side { width: calc(100% - 24px); padding: 24px 16px; }
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: no-preference) {
|
||||
.gate.lv-tower .lv-mast {
|
||||
clip-path: inset(8% 0 100% 0);
|
||||
animation: lv-mast 1.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes lv-mast {
|
||||
to { clip-path: inset(0 0 0 0); }
|
||||
}
|
||||
Reference in New Issue
Block a user