lint
This commit is contained in:
@@ -14,7 +14,7 @@ export default function Blog() {
|
|||||||
<div className="max-w-120 w-auto mx-auto my-10 flex flex-col gap-8">
|
<div className="max-w-120 w-auto mx-auto my-10 flex flex-col gap-8">
|
||||||
{
|
{
|
||||||
Array.from({ length: 10 }).map(() => (
|
Array.from({ length: 10 }).map(() => (
|
||||||
<div className="w-full px-5 cursor-default" >
|
<div className="w-full px-5 cursor-default" key={Math.random()}>
|
||||||
<a className="text-2xl font-medium cursor-pointer" target="_black">标题标题标题标题标题标题</a>
|
<a className="text-2xl font-medium cursor-pointer" target="_black">标题标题标题标题标题标题</a>
|
||||||
<p className="text-sm font-medium text-zinc-400">描述描asdjkasdas 就叫你健康你健康呢即可述描述描述描述描述描述描述描述描述,描述描述</p>
|
<p className="text-sm font-medium text-zinc-400">描述描asdjkasdas 就叫你健康你健康呢即可述描述描述描述描述描述描述描述描述,描述描述</p>
|
||||||
<p className="text-sm font-medium text-zinc-400 mt-3">{new Date().toLocaleString()} · {formatNumber(1090)} 次访问</p>
|
<p className="text-sm font-medium text-zinc-400 mt-3">{new Date().toLocaleString()} · {formatNumber(1090)} 次访问</p>
|
||||||
|
|||||||
@@ -13,7 +13,9 @@ async function handleCopy(text: string) {
|
|||||||
await navigator.clipboard.writeText(text);
|
await navigator.clipboard.writeText(text);
|
||||||
toast.success("复制成功");
|
toast.success("复制成功");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
toast.error("复制失败");
|
if (error instanceof Error) {
|
||||||
|
toast.error(`复制失败 ${error.message}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
import { LoginForm } from "@/components/login-form"
|
|
||||||
|
|
||||||
export default function LoginPage() {
|
|
||||||
return (
|
|
||||||
<div className="bg-muted flex min-h-svh flex-col items-center justify-center p-6 md:p-10">
|
|
||||||
<div className="w-full max-w-sm md:max-w-3xl">
|
|
||||||
<LoginForm />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@@ -1,10 +1,19 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import favicon from './favicon.ico';
|
import favicon from './favicon.ico';
|
||||||
|
import Image from 'next/image';
|
||||||
|
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
return (
|
return (
|
||||||
<div className="w-full flex-1 flex flex-col items-center justify-center">
|
<div className="w-full flex-1 flex flex-col items-center justify-center">
|
||||||
<img src={favicon.src} className="size-35 md:size-45 rounded-full duration-400" />
|
<Image
|
||||||
|
src={favicon.src}
|
||||||
|
alt="TONE's avatar"
|
||||||
|
width={180}
|
||||||
|
height={180}
|
||||||
|
className="rounded-full duration-400 size-35 md:size-45 select-none"
|
||||||
|
priority
|
||||||
|
quality={100}
|
||||||
|
/>
|
||||||
<h1 className='text-4xl md:text-5xl font-bold mt-5 md:mt-8 gradient-title duration-400 select-none'>特恩(TONE)</h1>
|
<h1 className='text-4xl md:text-5xl font-bold mt-5 md:mt-8 gradient-title duration-400 select-none'>特恩(TONE)</h1>
|
||||||
<h2 className='text-lg sm:text-xl md:text-2xl mt-3 font-medium text-zinc-400 duration-400 select-none'>一名啥都会一点点的程序员</h2>
|
<h2 className='text-lg sm:text-xl md:text-2xl mt-3 font-medium text-zinc-400 duration-400 select-none'>一名啥都会一点点的程序员</h2>
|
||||||
<div className='flex sm:flex-row flex-col gap-2 sm:gap-10 mt-5 md:mt-8 duration-400'>
|
<div className='flex sm:flex-row flex-col gap-2 sm:gap-10 mt-5 md:mt-8 duration-400'>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
export default function Resources() {
|
export default function Resources() {
|
||||||
return (
|
return (
|
||||||
@@ -14,12 +14,20 @@ export default function Resources() {
|
|||||||
|
|
||||||
<div className="mt-6 sm:mt-10 md:mt-15 w-full flex flex-col md:w-auto md:mx-auto md:grid grid-cols-2 2xl:gap-x-35 lg:gap-x-20 gap-x-10 lg:gap-y-10 gap-y-5 sm:mb-10 duration-300">
|
<div className="mt-6 sm:mt-10 md:mt-15 w-full flex flex-col md:w-auto md:mx-auto md:grid grid-cols-2 2xl:gap-x-35 lg:gap-x-20 gap-x-10 lg:gap-y-10 gap-y-5 sm:mb-10 duration-300">
|
||||||
{
|
{
|
||||||
[0, 1, 2, 3, 4, 5].map((item) => (
|
[0, 1, 2, 3, 4, 5].map(() => (
|
||||||
<a href="" target="_blank">
|
<a href="" target="_blank" key={Math.random()}>
|
||||||
<Card className="w-full md:w-92 lg:w-100 md:rounded-xl rounded-none duration-300">
|
<Card className="w-full md:w-92 lg:w-100 md:rounded-xl rounded-none duration-300">
|
||||||
<CardContent>
|
<CardContent>
|
||||||
<div className="flex gap-6">
|
<div className="flex gap-6">
|
||||||
<img className="size-20 shadow rounded-md" src="https://chromiumdash.appspot.com/releases?platform=Windows" />
|
<Image
|
||||||
|
src={''}
|
||||||
|
alt="资源图片"
|
||||||
|
width={100}
|
||||||
|
height={100}
|
||||||
|
className="rounded-md shadow"
|
||||||
|
priority
|
||||||
|
quality={100}
|
||||||
|
/>
|
||||||
<div className="flex-1 overflow-x-hidden">
|
<div className="flex-1 overflow-x-hidden">
|
||||||
<div className="font-bold text-2xl">Title 666 66 666 66 </div>
|
<div className="font-bold text-2xl">Title 666 66 666 66 </div>
|
||||||
<div className="font-medium text-sm text-zinc-400">你好这是一段随机文本,你好这是一段随机文本,你好这是一段随机文本,</div>
|
<div className="font-medium text-sm text-zinc-400">你好这是一段随机文本,你好这是一段随机文本,你好这是一段随机文本,</div>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp"
|
|||||||
import { InputOTP, InputOTPGroup, InputOTPSlot } from "./ui/input-otp";
|
import { InputOTP, InputOTPGroup, InputOTPSlot } from "./ui/input-otp";
|
||||||
import LoginBG from './login-bg.jpg';
|
import LoginBG from './login-bg.jpg';
|
||||||
import { toast } from "sonner";
|
import { toast } from "sonner";
|
||||||
|
import Image from "next/image";
|
||||||
|
|
||||||
export type SubmitMode = 'password' | 'phone' | 'email' | 'register';
|
export type SubmitMode = 'password' | 'phone' | 'email' | 'register';
|
||||||
export type LoginFormData = {
|
export type LoginFormData = {
|
||||||
@@ -41,17 +42,21 @@ export function useLoginForm(onSubmit: (data: LoginFormData) => Promise<void>, o
|
|||||||
try {
|
try {
|
||||||
await onSubmit({ ...formData, type: loginMode });
|
await onSubmit({ ...formData, type: loginMode });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error instanceof Error) {
|
||||||
toast.error('登录失败,请重试');
|
toast.error('登录失败,请重试');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, [loginMode, onSubmit]);
|
}, [loginMode, onSubmit]);
|
||||||
|
|
||||||
const handleSendCode = useCallback(async (formData: SendCodeFormData) => {
|
const handleSendCode = useCallback(async (formData: SendCodeFormData) => {
|
||||||
try {
|
try {
|
||||||
await onSendCode(formData);
|
await onSendCode(formData);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
if (error instanceof Error) {
|
||||||
toast.error('发送验证码失败,请重试');
|
toast.error('发送验证码失败,请重试');
|
||||||
}
|
}
|
||||||
}, [loginMode, onSendCode]);
|
}
|
||||||
|
}, [onSendCode]);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
loginMode,
|
loginMode,
|
||||||
@@ -400,10 +405,14 @@ export function LoginForm({
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
<div className="bg-muted relative hidden md:block">
|
<div className="bg-muted relative hidden md:block">
|
||||||
<img
|
<Image
|
||||||
src={LoginBG.src}
|
src={LoginBG.src}
|
||||||
alt="Image"
|
alt="Image"
|
||||||
|
width={500}
|
||||||
|
height={500}
|
||||||
className="absolute inset-0 h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"
|
className="absolute inset-0 h-full w-full object-cover dark:brightness-[0.2] dark:grayscale"
|
||||||
|
priority
|
||||||
|
quality={100}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
|||||||
Reference in New Issue
Block a user