diff --git a/src/app/article/components/MD/index.scss b/src/app/article/components/MD/index.scss index 74f1b61..f8cff42 100755 --- a/src/app/article/components/MD/index.scss +++ b/src/app/article/components/MD/index.scss @@ -1,5 +1,5 @@ -@use '@/styles/var' as *; -@use '@/styles/fun' as *; +@use "@/styles/var" as *; +@use "@/styles/fun" as *; .ContentMdComponent { .markdown-body { @@ -17,7 +17,7 @@ font-family: inherit; &::before { - content: ''; + content: ""; position: absolute; top: 0.75rem; left: 1rem; @@ -25,7 +25,9 @@ height: 0.75rem; background: #ff5f56; border-radius: 50%; - box-shadow: 1rem 0 0 #ffbd2e, 2rem 0 0 #27c93f; + box-shadow: + 1rem 0 0 #ffbd2e, + 2rem 0 0 #27c93f; z-index: 2; } @@ -69,7 +71,7 @@ cursor: pointer; &::after { - content: '点击展开代码'; + content: "点击展开代码"; position: absolute; bottom: 0; left: 0; @@ -118,7 +120,7 @@ } img { - @apply blur-[20px] rounded-xl hover:scale-105 cursor-pointer transition-all; + @apply blur-[20px] rounded-xl hover:scale-105 cursor-pointer transition-transform; } h1, @@ -179,7 +181,7 @@ counter-reset: counter; } - ol > li:not([id^='user-content-fn-']) { + ol > li:not([id^="user-content-fn-"]) { &::before { @apply absolute w-4 h-4 mt-1 leading-none left-0 rounded-full text-center text-sm border border-[#11181C] dark:border-gray-400; counter-increment: counter; @@ -188,7 +190,7 @@ & ol > li::before { @apply absolute left-7 border-0 text-base mt-0 leading-normal; - content: counter(counter) '.'; + content: counter(counter) "."; } } @@ -252,7 +254,7 @@ } } - input[type='checkbox'] { + input[type="checkbox"] { width: 16px; height: 16px; border-radius: 4px; @@ -298,7 +300,7 @@ font-size: 0.95em; font-family: inherit; } - + .line-content { flex: 1; word-break: break-all; diff --git a/src/app/friend/components/CopyableText/index.tsx b/src/app/friend/components/CopyableText/index.tsx index 35a32c2..13367d6 100644 --- a/src/app/friend/components/CopyableText/index.tsx +++ b/src/app/friend/components/CopyableText/index.tsx @@ -43,7 +43,7 @@ export default function CopyableText({ text, children, className = '' }: Copyabl }; return ( - + {children} ); diff --git a/src/app/friend/index.tsx b/src/app/friend/index.tsx index b7e6676..4cbe483 100644 --- a/src/app/friend/index.tsx +++ b/src/app/friend/index.tsx @@ -1,97 +1,268 @@ 'use client'; +import React, { useState } from 'react'; import Link from 'next/link'; - -import { ToastContainer } from 'react-toastify'; - -import Slide from '@/components/Slide'; -import Starry from '@/components/Starry'; -import ApplyForAdd from './components/ApplyForAdd'; -import CopyableText from './components/CopyableText'; - +import { ToastContainer, toast } from 'react-toastify'; +import 'react-toastify/dist/ReactToastify.css'; import { Web } from '@/types/app/web'; - import { useConfigStore, useAuthorStore } from '@/stores'; +const Icons = { + Copy: () => ( + + + + ), + Check: () => ( + + + + ), + Link: () => ( + + + + ), + Rss: () => ( + + + + ), + User: () => ( + + + + ) +}; + +// 默认头像 +const DEFAULT_AVATAR = + "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Ccircle fill='%23e5e7eb' cx='32' cy='32' r='32'/%3E%3Cpath fill='%239ca3af' d='M32 32a8 8 0 1 1 0-16 8 8 0 0 1 0 16zm0 8c-8 0-16 4-16 12v4h32v-4c0-8-8-12-16-12z'/%3E%3C/svg%3E"; + +const CopyInput = ({ label, value, icon, isCode = false, highlight = false, truncate = false }: any) => { + const [copied, setCopied] = useState(false); + + const handleCopy = () => { + if (!value) return; + navigator.clipboard.writeText(value); + setCopied(true); + toast.success(`已复制: ${label}`, { autoClose: 1500 }); + setTimeout(() => setCopied(false), 2000); + }; + + return ( +
+
+ {icon} +
+ +
+ + {label} + +
+ {value || 'Wait for loading...'} +
+
+ + +
+ ); +}; + export default ({ data }: { data: { [string: string]: { order: number; list: Web[] } } }) => { const web = useConfigStore((state) => state.web); const author = useAuthorStore((state) => state.author); return ( <> - - {/* 星空背景组件 */} - + 😇 朋友圈 + -
-
一个人的寂寞,一群人的狂欢!
-
- -
-
-
+ {/* 全局背景装饰 */} +
+
+
+
+
+
-
-
-
-

本站信息

+
+
-
-

- 站点名称:{web?.title} -

-

- 站点介绍:{web?.description} -

-

- 站点图标:{author?.avatar} -

-

- 站点地址:{web?.url} -

-

- Rss地址:{web?.url + '/api/rss'} -

+
+ {/* 卡片背后的光晕装饰 */} +
+ + {/* 卡片主体 */} +
+
+
+
+ {/* Logo/头像展示区 */} +
+ {/* 旋转光晕边框 */} +
+
+ Site Logo +
+
+ + {/* 标题与描述 */} +
+

+ {web?.title} +

+

+ {web?.description} +

+
+
+ +
+
+
+ {/* 1. 站点名称 */} +
+ T} + /> +
+ +
+ D} + truncate + /> +
+ +
+ } + isCode + /> +
+ +
+ IMG
} + isCode + truncate + /> +
+ +
+ } + isCode + highlight + /> +
+
+
+
+ +
+
-
+
{Object.keys(data)?.map((type, index) => ( -
-

{type}

+
+
+
+

+ {type} +

+ +
+
+
-
+
{type === '全站置顶' && ( - -
- 项目作者 - -
-

宇阳

-

ThriveX 博客管理系统作者

+ +
+
OWNER
+ 项目作者 +
+

宇阳

+

ThriveX 博客管理系统作者

)} {data[type].list?.map((item: Web) => ( - -
- {item.title} + +
+
+ {item.title} { + const el = e.target as HTMLImageElement; + if (el.src !== DEFAULT_AVATAR) el.src = DEFAULT_AVATAR; + }} + /> +
-
-

{item.title}

-

{item.description}

+
+

+ {item.title} +

+

+ {item.description || '暂无介绍...'} +

))}
-
+
))} -
-
+
- + +
); }; diff --git a/src/app/record/components/RecordCard.tsx b/src/app/record/components/RecordCard.tsx index 936a2c2..d932fcf 100644 --- a/src/app/record/components/RecordCard.tsx +++ b/src/app/record/components/RecordCard.tsx @@ -69,17 +69,17 @@ export default function RecordCard({ id, content, images, createTime, user }: Re {/* Footer: 互动栏 (装饰用) */} {/*
- - -