diff --git a/web/src/pages/login-next/bg.tsx b/web/src/pages/login-next/bg.tsx new file mode 100644 index 000000000..c9b016c5c --- /dev/null +++ b/web/src/pages/login-next/bg.tsx @@ -0,0 +1,159 @@ +import './index.less'; +const aspectRatio = { + top: 240, + middle: 466, + bottom: 704, +}; + +export const BgSvg = () => { + const def = ( + path: string, + id: number | string = '', + type: keyof typeof aspectRatio, + ) => { + return ( + + ); + }; + return ( +
- {JSON.stringify(data, null, 2)}
-
- ),
- });
- }
-
- return (
-
-
- );
-}
-
-export function SignInForm() {
- const { t } = useTranslate('login');
-
- const FormSchema = z.object({
- email: z.string().email({
- message: t('emailPlaceholder'),
- }),
- password: z.string({ required_error: t('passwordPlaceholder') }),
- });
-
- const form = useForm
- {JSON.stringify(data, null, 2)}
-
- ),
- });
- }
-
- return (
-
-
- );
-}
-
-export function VerifyEmailForm() {
- const FormSchema = z.object({
- pin: z.string().min(6, {
- message: 'Your one-time password must be 6 characters.',
- }),
- });
-
- const form = useForm
- {JSON.stringify(data, null, 2)}
-
- ),
- });
- }
-
- return (
-
-
- );
-}
diff --git a/web/src/pages/login-next/hooks.ts b/web/src/pages/login-next/hooks.ts
deleted file mode 100644
index 2641a34b3..000000000
--- a/web/src/pages/login-next/hooks.ts
+++ /dev/null
@@ -1,20 +0,0 @@
-import { useCallback } from 'react';
-import { useSearchParams } from 'umi';
-
-export enum Step {
- SignIn,
- SignUp,
- ForgotPassword,
- ResetPassword,
- VerifyEmail,
-}
-
-export const useSwitchStep = (step: Step) => {
- const [_, setSearchParams] = useSearchParams();
- console.log('🚀 ~ useSwitchStep ~ _:', _);
- const switchStep = useCallback(() => {
- setSearchParams(new URLSearchParams({ step: step.toString() }));
- }, [setSearchParams, step]);
-
- return { switchStep };
-};
diff --git a/web/src/pages/login-next/index.less b/web/src/pages/login-next/index.less
new file mode 100644
index 000000000..2322be352
--- /dev/null
+++ b/web/src/pages/login-next/index.less
@@ -0,0 +1,42 @@
+.animate-glow {
+ animation: glow 16s infinite linear;
+}
+.mask-path {
+ stroke-width: 8;
+ ::after {
+ content: '';
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ stroke-dasharray: 660;
+ stroke-dashoffset: 0;
+ stroke: #d11818;
+ stroke-width: 8;
+ fill: none;
+ }
+}
+@keyframes glow {
+ 0% {
+ stroke-dashoffset: 0;
+ }
+ 100% {
+ stroke-dashoffset: -650;
+ }
+}
+
+@keyframes highlight-flow {
+ 0% {
+ stroke-dashoffset: 50;
+ }
+ 100% {
+ stroke-dashoffset: -600;
+ } /* 15+300-30=285 */
+}
+
+.animate-highlight {
+ animation: highlight-flow 16s linear infinite;
+}
+
+//////////////////////////////////////////////////////////////////////////
diff --git a/web/src/pages/login-next/index.tsx b/web/src/pages/login-next/index.tsx
index a06d29987..35e3e76b4 100644
--- a/web/src/pages/login-next/index.tsx
+++ b/web/src/pages/login-next/index.tsx
@@ -1,107 +1,305 @@
-import { Button } from '@/components/ui/button';
-import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
-import { Separator } from '@/components/ui/separator';
-import { useTranslate } from '@/hooks/common-hooks';
-import { DiscordLogoIcon, GitHubLogoIcon } from '@radix-ui/react-icons';
-import { useSearchParams } from 'umi';
-import { SignInForm, SignUpForm, VerifyEmailForm } from './form';
-import { Step, useSwitchStep } from './hooks';
+import SvgIcon from '@/components/svg-icon';
+import { useAuth } from '@/hooks/auth-hooks';
+import {
+ useLogin,
+ useLoginChannels,
+ useLoginWithChannel,
+ useRegister,
+} from '@/hooks/login-hooks';
+import { useSystemConfig } from '@/hooks/system-hooks';
+import { rsaPsw } from '@/utils';
+import { useEffect, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useNavigate } from 'umi';
-function LoginFooter() {
- return (
- or continue with
-- We’ve sent a 6-digit code to -
-yifanwu92@gmail.com.
-+ {t('signInTip')} + +
++ {t('signUpTip')} + +
+