feat: 参考原型图 ui优化提交 个人端-用户中心 相关的页面
This commit is contained in:
@@ -61,7 +61,9 @@ const AuthCardHeader = ({
|
||||
<h4 className='text-xl font-bold text-gray-800 dark:text-white tracking-tight mb-0.5'>
|
||||
{title}
|
||||
</h4>
|
||||
<p className='text-gray-500 dark:text-gray-400 text-xs'>{subtitle}</p>
|
||||
<p className='auth-card-subtitle text-gray-500 dark:text-gray-400 text-xs'>
|
||||
{subtitle}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import React, { useState, useEffect } from 'react';
|
||||
import { Avatar } from '@douyinfe/semi-ui';
|
||||
import { Avatar } from '@/components/ui';
|
||||
import { MessageCircle, ScanLine } from 'lucide-react';
|
||||
import { API } from '../../helpers';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -18,6 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Button } from 'antd';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
@@ -28,7 +29,7 @@ import { useTranslation } from 'react-i18next';
|
||||
* active:当前页归属('personal' | 'enterprise'),高亮且不重复跳转。
|
||||
*
|
||||
* 浮于玻璃卡片之外、之上:自带玻璃壳(backdrop-blur + 半透白底 + ring/border),
|
||||
* 在背景上保持可读并与下方卡片呼应;激活态用品牌渐变强化「当前入口」的辨识度。
|
||||
* 在背景上保持可读并与下方卡片呼应;激活态沿用 Ant Design 主题主色。
|
||||
*/
|
||||
const AuthLoginTabs = ({ active = 'personal', mode = 'login' }) => {
|
||||
const { t } = useTranslation();
|
||||
@@ -47,25 +48,21 @@ const AuthLoginTabs = ({ active = 'personal', mode = 'login' }) => {
|
||||
];
|
||||
|
||||
return (
|
||||
<div className='relative z-20 flex p-1 gap-1 rounded-2xl backdrop-blur-2xl bg-white/45 dark:bg-neutral-900/55 ring-1 ring-white/50 dark:ring-white/[0.06] border border-white/30 dark:border-white/[0.05] shadow-[0_12px_32px_-16px_rgb(var(--brand-primary-rgb)/0.45)]'>
|
||||
<div className='auth-login-tabs relative z-20 flex p-1 gap-1 rounded-xl backdrop-blur-2xl bg-white/45 dark:bg-neutral-900/55 ring-1 ring-white/50 dark:ring-white/[0.06] border border-white/30 dark:border-white/[0.05]'>
|
||||
{tabs.map((tab) => {
|
||||
const isActive = tab.key === active;
|
||||
return (
|
||||
<button
|
||||
<Button
|
||||
key={tab.key}
|
||||
type='button'
|
||||
type={isActive ? 'primary' : 'text'}
|
||||
aria-pressed={isActive}
|
||||
onClick={() => {
|
||||
if (!isActive) navigate(tab.to);
|
||||
}}
|
||||
className={`flex-1 h-10 rounded-xl text-sm font-medium transition-all duration-200 ${
|
||||
isActive
|
||||
? 'bg-gradient-to-r from-brand-from to-brand-to text-white shadow-md shadow-brand/25'
|
||||
: 'text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200 hover:bg-white/40 dark:hover:bg-white/[0.05]'
|
||||
}`}
|
||||
className='flex-1 font-medium'
|
||||
>
|
||||
{tab.label}
|
||||
</button>
|
||||
</Button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
|
||||
@@ -82,7 +82,7 @@ export const GlassCardStyles = () => (
|
||||
/* 认证页 Semi 输入框玻璃风格:容器挂 .auth-glass-form 后,四个认证页
|
||||
(登录/注册/企业登录/企业注册)的输入框共享同一套观感 ——
|
||||
半透白玻璃底 + 圆角、hover 提亮、聚焦品牌色边框 + 柔和光环、错误态沿用语义色 */
|
||||
.auth-glass-form .semi-input-wrapper {
|
||||
.auth-glass-form .ant-input-affix-wrapper {
|
||||
background: rgba(255, 255, 255, 0.6);
|
||||
border: 1px solid rgba(229, 231, 235, 0.8);
|
||||
border-radius: 0.75rem;
|
||||
@@ -93,64 +93,64 @@ export const GlassCardStyles = () => (
|
||||
background-color 0.2s ease,
|
||||
box-shadow 0.2s ease;
|
||||
}
|
||||
.auth-glass-form .semi-input-wrapper:hover {
|
||||
.auth-glass-form .ant-input-affix-wrapper:hover {
|
||||
background: rgba(255, 255, 255, 0.78);
|
||||
border-color: rgba(209, 213, 219, 1);
|
||||
}
|
||||
.auth-glass-form .semi-input-wrapper-focus,
|
||||
.auth-glass-form .semi-input-wrapper-focus:hover {
|
||||
.auth-glass-form .ant-input-affix-wrapper-focus,
|
||||
.auth-glass-form .ant-input-affix-wrapper-focus:hover {
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
border-color: rgb(var(--brand-primary-rgb));
|
||||
box-shadow: 0 0 0 3px rgb(var(--brand-primary-rgb) / 0.14);
|
||||
}
|
||||
.dark .auth-glass-form .semi-input-wrapper {
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper {
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
border-color: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
.dark .auth-glass-form .semi-input-wrapper:hover {
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper:hover {
|
||||
background: rgba(255, 255, 255, 0.09);
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
.dark .auth-glass-form .semi-input-wrapper-focus,
|
||||
.dark .auth-glass-form .semi-input-wrapper-focus:hover {
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper-focus,
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper-focus:hover {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
border-color: rgb(var(--brand-primary-rgb));
|
||||
box-shadow: 0 0 0 3px rgb(var(--brand-primary-rgb) / 0.22);
|
||||
}
|
||||
/* 校验失败:边框与光环改用语义 danger 色,保持玻璃底不变 */
|
||||
.auth-glass-form .semi-input-wrapper-error,
|
||||
.auth-glass-form .semi-input-wrapper-error:hover,
|
||||
.auth-glass-form .semi-input-wrapper-error.semi-input-wrapper-focus {
|
||||
border-color: var(--semi-color-danger);
|
||||
.auth-glass-form .ant-input-affix-wrapper-error,
|
||||
.auth-glass-form .ant-input-affix-wrapper-error:hover,
|
||||
.auth-glass-form .ant-input-affix-wrapper-error.ant-input-affix-wrapper-focus {
|
||||
border-color: var(--ui-color-danger);
|
||||
box-shadow: none;
|
||||
}
|
||||
/* 前缀图标与内建功能钮(密码眼睛/清除)默认弱化;
|
||||
只针对这三处染色,避免误染 suffix 里自定义按钮(如「获取验证码」)的 loading 图标 */
|
||||
.auth-glass-form .semi-input-wrapper .semi-input-prefix .semi-icon,
|
||||
.auth-glass-form .semi-input-wrapper .semi-input-clearbtn .semi-icon,
|
||||
.auth-glass-form .semi-input-wrapper .semi-input-modebtn .semi-icon {
|
||||
.auth-glass-form .ant-input-affix-wrapper .ant-input-prefix .anticon,
|
||||
.auth-glass-form .ant-input-affix-wrapper .ant-input-clearbtn .anticon,
|
||||
.auth-glass-form .ant-input-affix-wrapper .ant-input-modebtn .anticon {
|
||||
color: rgba(156, 163, 175, 1);
|
||||
transition: color 0.2s ease;
|
||||
}
|
||||
.dark .auth-glass-form .semi-input-wrapper .semi-input-prefix .semi-icon,
|
||||
.dark .auth-glass-form .semi-input-wrapper .semi-input-clearbtn .semi-icon,
|
||||
.dark .auth-glass-form .semi-input-wrapper .semi-input-modebtn .semi-icon {
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper .ant-input-prefix .anticon,
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper .ant-input-clearbtn .anticon,
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper .ant-input-modebtn .anticon {
|
||||
color: rgba(107, 114, 128, 1);
|
||||
}
|
||||
/* 密码眼睛/清除按钮 hover 加深,给出可点击反馈 */
|
||||
.auth-glass-form .semi-input-wrapper .semi-input-clearbtn:hover .semi-icon,
|
||||
.auth-glass-form .semi-input-wrapper .semi-input-modebtn:hover .semi-icon {
|
||||
.auth-glass-form .ant-input-affix-wrapper .ant-input-clearbtn:hover .anticon,
|
||||
.auth-glass-form .ant-input-affix-wrapper .ant-input-modebtn:hover .anticon {
|
||||
color: rgba(75, 85, 99, 1);
|
||||
}
|
||||
.dark .auth-glass-form .semi-input-wrapper .semi-input-clearbtn:hover .semi-icon,
|
||||
.dark .auth-glass-form .semi-input-wrapper .semi-input-modebtn:hover .semi-icon {
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper .ant-input-clearbtn:hover .anticon,
|
||||
.dark .auth-glass-form .ant-input-affix-wrapper .ant-input-modebtn:hover .anticon {
|
||||
color: rgba(209, 213, 219, 1);
|
||||
}
|
||||
/* 聚焦时前缀图标点亮为品牌色,给出清晰的焦点反馈 */
|
||||
.auth-glass-form .semi-input-wrapper-focus .semi-input-prefix .semi-icon {
|
||||
.auth-glass-form .ant-input-affix-wrapper-focus .ant-input-prefix .anticon {
|
||||
color: rgb(var(--brand-primary-rgb));
|
||||
}
|
||||
.dark .auth-glass-form .semi-input::placeholder {
|
||||
.dark .auth-glass-form .ant-input::placeholder {
|
||||
color: rgba(255, 255, 255, 0.35);
|
||||
}
|
||||
/* 移动端降级 backdrop-filter,减轻 GPU 负担 */
|
||||
@@ -220,10 +220,10 @@ const GlassCard = ({
|
||||
)}
|
||||
|
||||
{/* 顶部品牌渐变线 */}
|
||||
<div className='absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-brand-from via-brand-via to-brand-to opacity-90' />
|
||||
<div className='login-card-top-accent absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-brand-from via-brand-via to-brand-to opacity-90' />
|
||||
|
||||
{/* 顶部 1px 白色反光 - 紧贴品牌线下方 */}
|
||||
<div className='absolute top-0.5 left-[15%] right-[15%] h-px bg-gradient-to-r from-transparent via-white/90 dark:via-white/40 to-transparent pointer-events-none' />
|
||||
<div className='login-card-top-reflection absolute top-0.5 left-[15%] right-[15%] h-px bg-gradient-to-r from-transparent via-white/90 dark:via-white/40 to-transparent pointer-events-none' />
|
||||
|
||||
{children}
|
||||
</div>
|
||||
|
||||
@@ -48,16 +48,16 @@ import {
|
||||
isPasskeySupported,
|
||||
} from '../../helpers';
|
||||
import Turnstile from 'react-turnstile';
|
||||
import { Button, Checkbox, Form, Icon, Modal } from '@douyinfe/semi-ui';
|
||||
import { Button, Checkbox, Form, Icon, Modal } from '@/components/ui';
|
||||
|
||||
import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
||||
import { Text } from '@/components/ui';
|
||||
|
||||
import {
|
||||
IconGithubLogo,
|
||||
IconMail,
|
||||
IconLock,
|
||||
IconKey,
|
||||
} from '@douyinfe/semi-icons';
|
||||
} from '@/components/ui/icons';
|
||||
import OIDCIcon from '../common/logo/OIDCIcon';
|
||||
import WeChatIcon from '../common/logo/WeChatIcon';
|
||||
import LinuxDoIcon from '../common/logo/LinuxDoIcon';
|
||||
@@ -846,15 +846,13 @@ const LoginForm = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<style>{`
|
||||
.login-compact-form .semi-form-field { margin-bottom: 0; }
|
||||
.login-compact-form .semi-form-field-username { padding-bottom: 4px; }
|
||||
.login-compact-form .semi-form-field-password { padding-top: 4px; }
|
||||
`}</style>
|
||||
<Form className='login-compact-form auth-glass-form'>
|
||||
{/* 用户名输入框 —— 玻璃观感统一由 .auth-glass-form(GlassCard 内置样式)驱动 */}
|
||||
<Form className='auth-login-form' onSubmit={handleSubmit}>
|
||||
<Form.Input
|
||||
field='username'
|
||||
className='auth-login-required-field'
|
||||
rules={[{ required: true, message: t('请输入用户名或邮箱') }]}
|
||||
required
|
||||
aria-required='true'
|
||||
label={
|
||||
<span className='text-xs font-medium text-gray-600 dark:text-gray-300'>
|
||||
{t('用户名/邮箱')}
|
||||
@@ -862,7 +860,7 @@ const LoginForm = () => {
|
||||
}
|
||||
placeholder={t('请输入用户名或邮箱')}
|
||||
name='username'
|
||||
size='large'
|
||||
size='default'
|
||||
autoComplete='username'
|
||||
onChange={(value) => handleChange('username', value)}
|
||||
prefix={<IconMail size='small' />}
|
||||
@@ -871,6 +869,10 @@ const LoginForm = () => {
|
||||
{/* 密码输入框 */}
|
||||
<Form.Input
|
||||
field='password'
|
||||
className='auth-login-required-field'
|
||||
rules={[{ required: true, message: t('请输入密码') }]}
|
||||
required
|
||||
aria-required='true'
|
||||
label={
|
||||
<span className='text-xs font-medium text-gray-600 dark:text-gray-300'>
|
||||
{t('密码')}
|
||||
@@ -879,7 +881,7 @@ const LoginForm = () => {
|
||||
placeholder={t('请输入密码')}
|
||||
name='password'
|
||||
mode='password'
|
||||
size='large'
|
||||
size='default'
|
||||
autoComplete='current-password'
|
||||
onChange={(value) => handleChange('password', value)}
|
||||
prefix={<IconLock size='small' />}
|
||||
@@ -921,40 +923,28 @@ const LoginForm = () => {
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className='space-y-1.5 pt-3'>
|
||||
<div className='auth-login-actions'>
|
||||
{/* 登录按钮 */}
|
||||
<button
|
||||
type='submit'
|
||||
onClick={handleSubmit}
|
||||
<Button
|
||||
theme='solid'
|
||||
htmlType='submit'
|
||||
loading={loginLoading}
|
||||
block
|
||||
disabled={
|
||||
loginLoading ||
|
||||
((hasUserAgreement || hasPrivacyPolicy) && !agreedToTerms)
|
||||
}
|
||||
className='group relative w-full h-10 flex items-center justify-center gap-2 bg-gradient-to-r from-brand-from to-brand-to hover:from-brand-from hover:to-brand-to disabled:from-gray-400 disabled:to-gray-500 text-white rounded-xl shadow-md shadow-brand/25 dark:shadow-brand/15 hover:shadow-lg hover:shadow-brand/30 hover:-translate-y-0.5 active:translate-y-0 transition-all duration-200 disabled:cursor-not-allowed disabled:hover:translate-y-0 overflow-hidden'
|
||||
className='auth-login-submit'
|
||||
>
|
||||
{/* 闪光效果 */}
|
||||
<div className='absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-500' />
|
||||
|
||||
{loginLoading ? (
|
||||
<div className='w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin' />
|
||||
) : (
|
||||
<>
|
||||
<span className='relative z-10 font-semibold'>
|
||||
{t('登 录')}
|
||||
</span>
|
||||
<ArrowRight
|
||||
size={16}
|
||||
className='relative z-10 group-hover:translate-x-1 transition-transform'
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</button>
|
||||
<span className='font-semibold'>{t('登 录')}</span>
|
||||
<ArrowRight size={16} />
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
theme='borderless'
|
||||
type='tertiary'
|
||||
size='small'
|
||||
className='w-full !text-gray-500 hover:!text-brand-deep dark:!text-gray-500 dark:hover:!text-brand-from !text-xs'
|
||||
className='auth-login-forgot'
|
||||
onClick={handleResetPasswordClick}
|
||||
>
|
||||
{t('忘记密码?')}
|
||||
@@ -991,7 +981,7 @@ const LoginForm = () => {
|
||||
)}
|
||||
|
||||
{!status.self_use_mode_enabled && (
|
||||
<div className='mt-3 text-center'>
|
||||
<div className='auth-login-register text-center'>
|
||||
<Text className='text-gray-500 dark:text-gray-400 text-xs'>
|
||||
{t('没有账户?')}{' '}
|
||||
<Link
|
||||
@@ -1234,7 +1224,7 @@ const LoginForm = () => {
|
||||
|
||||
return (
|
||||
<div
|
||||
className='relative overflow-hidden flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8'
|
||||
className='auth-login-page relative overflow-hidden flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8'
|
||||
// 抵扣 PageLayout 跑马灯占位高度,保证占位+容器恰为一屏,避免幽灵滚动
|
||||
style={{ minHeight: 'calc(100vh - var(--content-top-offset, 0px))' }}
|
||||
>
|
||||
|
||||
@@ -19,7 +19,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Button, Toast, Banner } from '@douyinfe/semi-ui';
|
||||
import { Button, Toast, Banner } from '@/components/ui';
|
||||
import { Copy } from 'lucide-react';
|
||||
import { copy as copyText } from '../../helpers/utils';
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import {
|
||||
getSystemName,
|
||||
} from '../../helpers';
|
||||
import { useSearchParams, Link } from 'react-router-dom';
|
||||
import { Button, Card, Form, Typography, Banner } from '@douyinfe/semi-ui';
|
||||
import { IconMail, IconLock, IconCopy } from '@douyinfe/semi-icons';
|
||||
import { Button, Card, Form, Typography, Banner } from '@/components/ui';
|
||||
import { IconMail, IconLock, IconCopy } from '@/components/ui/icons';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const { Text, Title } = Typography;
|
||||
|
||||
@@ -27,8 +27,8 @@ import {
|
||||
getSystemName,
|
||||
} from '../../helpers';
|
||||
import Turnstile from 'react-turnstile';
|
||||
import { Button, Card, Form, Typography } from '@douyinfe/semi-ui';
|
||||
import { IconMail } from '@douyinfe/semi-icons';
|
||||
import { Button, Card, Form, Typography } from '@/components/ui';
|
||||
import { IconMail } from '@/components/ui/icons';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
||||
@@ -42,16 +42,16 @@ import {
|
||||
onWeChatOpenOAuthClicked,
|
||||
} from '../../helpers';
|
||||
import Turnstile from 'react-turnstile';
|
||||
import { Button, Checkbox, Form, Icon, Modal } from '@douyinfe/semi-ui';
|
||||
import { Button, Checkbox, Form, Icon, Modal } from '@/components/ui';
|
||||
|
||||
import Text from '@douyinfe/semi-ui/lib/es/typography/text';
|
||||
import { Text } from '@/components/ui';
|
||||
import {
|
||||
IconGithubLogo,
|
||||
IconMail,
|
||||
IconUser,
|
||||
IconLock,
|
||||
IconKey,
|
||||
} from '@douyinfe/semi-icons';
|
||||
} from '@/components/ui/icons';
|
||||
import OIDCIcon from '../common/logo/OIDCIcon';
|
||||
import LinuxDoIcon from '../common/logo/LinuxDoIcon';
|
||||
import WeChatIcon from '../common/logo/WeChatIcon';
|
||||
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
Divider,
|
||||
Form,
|
||||
Typography,
|
||||
} from '@douyinfe/semi-ui';
|
||||
} from '@/components/ui';
|
||||
import React, { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user