diff --git a/app/_lib/data.ts b/.local.env similarity index 100% rename from app/_lib/data.ts rename to .local.env diff --git a/app/_lib/data/search.ts b/app/_lib/data/search.ts new file mode 100644 index 0000000..e69de29 diff --git a/app/_lib/data/sider.tsx b/app/_lib/data/sider.tsx new file mode 100644 index 0000000..e69de29 diff --git a/app/_ui/Logo.tsx b/app/_ui/Logo.tsx index 360ae9f..b4e0d19 100644 --- a/app/_ui/Logo.tsx +++ b/app/_ui/Logo.tsx @@ -1,7 +1,10 @@ +import LogoImg from "@/assets/logo.png" +import Image from "next/image" +import Link from "next/link" export default function Logo() { return ( -
-

AI工具集

-
+ + logo img + ) } \ No newline at end of file diff --git a/app/_ui/PosterBox.tsx b/app/_ui/PosterBox.tsx new file mode 100644 index 0000000..40dd3b7 --- /dev/null +++ b/app/_ui/PosterBox.tsx @@ -0,0 +1,33 @@ +export default function PosterBox({ posterList }: { posterList: string[] }) { + return ( +
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ) +} \ No newline at end of file diff --git a/app/_ui/Search.tsx b/app/_ui/Search.tsx new file mode 100644 index 0000000..521d60a --- /dev/null +++ b/app/_ui/Search.tsx @@ -0,0 +1,124 @@ +"use client"; + +import { faSearch } from "@fortawesome/free-solid-svg-icons"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import clsx from "clsx"; +import { useMemo, useState } from "react"; +import Logo from "./Logo"; +export type SearchTypeItem = { + name: string; + key: string; + includes: string[]; + priority: number; + +} +export type SearchWayItemType = { + label: string; + value: string; + fullName: string; + key: string; + +} +export const SearchTypeList: SearchTypeItem[] = [ + { + name: '常用', + key: 'custom', + includes: ['inside', 'bing'], + priority: 0 + }, + { + name: '搜索', + key: 'search', + includes: ['101'], + priority: 0 + }, + { + name: '社区', + key: 'community', + includes: ['101'], + priority: 0 + }, + { + name: '图片', + key: 'picture', + includes: ['101'], + priority: 0 + }, + { + name: '生活', + key: 'life', + includes: ['101'], + priority: 0 + } +] +export const SearchWayItem: SearchWayItemType[] = [ + { + label: '站内', + value: '', + fullName: '站内资源', + key: 'inside', + }, + { + label: 'Bing', + fullName: '站内资源', + value: 'https://bing.com', + key: 'bing' + } +] +export default function Search() { + const [selectKey, setSelectKey] = useState(SearchTypeList[0].key) + const nowSelectConfig = useMemo(() => { + const idx = SearchTypeList.findIndex(val => val.key === selectKey) + if (idx !== -1) return SearchTypeList[idx] + else return null + }, [selectKey]) + const [activeSearchKey, setActiveSearchKey] = useState(nowSelectConfig?.includes[0]) + const activeSearch = useMemo(() => { + const idx = SearchWayItem.findIndex(val => val.key === activeSearchKey) + if (idx !== -1) { + return SearchWayItem[idx] + } else { + return null + } + }, [activeSearchKey]) + return ( +
+ +
+ +
+
+
+ { + SearchTypeList.map(item => ( +
{ + setSelectKey(item.key) + }} + className={clsx(item.key === selectKey ? + "text-[#333]" : "text-[#999] cursor-pointer")}> + {item.name} +
+ )) + } +
+
+ + +
+
+ { + SearchWayItem.filter(val => nowSelectConfig?.includes.includes(val.key)).map(item => ( +
{ + setActiveSearchKey(item.key) + }} className={clsx(activeSearchKey === item.key ? + "text-[#333]" : "text-[#999] cursor-pointer")}>{item.label}
+ )) + } +
+ +
+ +
+ ); +} \ No newline at end of file diff --git a/app/_ui/SiderNav.tsx b/app/_ui/SiderNav.tsx index 89b7667..b691e30 100644 --- a/app/_ui/SiderNav.tsx +++ b/app/_ui/SiderNav.tsx @@ -4,7 +4,7 @@ import Logo from "./Logo"; export default function SiderNav({ linkList }: { linkList: LinkTypeItem[] }) { return ( -
+
diff --git a/app/_ui/search/config.ts b/app/_ui/search/config.ts deleted file mode 100644 index 81a38ca..0000000 --- a/app/_ui/search/config.ts +++ /dev/null @@ -1,18 +0,0 @@ -export type SearchConfigItem = { - name: string; - label: string; - type: string; - value: string; - options?: string[]; -} - -export type SearchConfig = [ - { - name: 'searchType'; - label: 'Search Type'; - type: 'select'; - value: 'global'; - options: ['global', 'local']; - }, - -]; \ No newline at end of file diff --git a/app/_ui/search/index.tsx b/app/_ui/search/index.tsx deleted file mode 100644 index 9d67925..0000000 --- a/app/_ui/search/index.tsx +++ /dev/null @@ -1,28 +0,0 @@ -"use client"; - -import { faSearch } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; - -export default function Search() { - - return ( -
- -
AI工具集
-
-
-
常用
-
搜索
-
社区
-
图片
-
生活
-
-
- - -
-
- -
- ); -} \ No newline at end of file diff --git a/app/ai-apps/layout.tsx b/app/ai-apps/layout.tsx index c60e55a..d137762 100644 --- a/app/ai-apps/layout.tsx +++ b/app/ai-apps/layout.tsx @@ -8,7 +8,7 @@ export default function Layout({ children: React.ReactNode; }>) { return ( -
+
{children}
diff --git a/app/layout.tsx b/app/layout.tsx index 962e409..d44d40f 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -16,7 +16,7 @@ export default function RootLayout({ return ( {children} diff --git a/app/page.tsx b/app/page.tsx index 0f6a54a..7d6b848 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,16 +1,19 @@ import HeaderNav from "./_ui/HeaderNav"; import SiderNav from "./_ui/SiderNav"; -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faArrowRotateBack, faDeafness, faImage, faMagnet, faMessage, faPenClip, faSearch, faThumbsUp, faVideo } from '@fortawesome/free-solid-svg-icons' import '@fortawesome/fontawesome-svg-core/styles.css' +import Search from "./_ui/Search"; +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { faArrowRotateBack, faDeafness, faImage, faMagnet, faMessage, faPenClip, faSearch, faThumbsUp, faVideo } from '@fortawesome/free-solid-svg-icons' import { LinkTypeItem } from "./_lib/types"; -import Search from "./_ui/search"; +import PosterBox from "./_ui/PosterBox"; + const defaultLinkList = [ { label: 'AI应用集', icon: , href: '/ai-apps', id: 1, + }, { label: 'AI写作工具', @@ -61,14 +64,37 @@ const defaultLinkList = [ id: 9, } ] as LinkTypeItem[]; -export default function Home() { +export default async function Home() { + return ( -
+
-
+
+ +
+
+ +
+
+ + + +
+ { + defaultLinkList.map(item => ( +
+
+ + {item.icon} + {item.label} +
+
+ )) + } +
); diff --git a/assets/logo.png b/assets/logo.png new file mode 100644 index 0000000..ff765ab Binary files /dev/null and b/assets/logo.png differ diff --git a/dcoker.compose.yml b/dcoker.compose.yml new file mode 100644 index 0000000..978749b --- /dev/null +++ b/dcoker.compose.yml @@ -0,0 +1,12 @@ +version: "3.8" +services: + db: + image: postgres:latest + environment: + POSTGRES_USER: expdsn + POSTGRES_PASSWORD: YlBau_58662 + POSTGRES_DB: mydatabase + volumes: + - postgres_data:/var/lib/postgresql/data + ports: + - "5432:5432" \ No newline at end of file diff --git a/package.json b/package.json index e5ae0ae..0dd5a21 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "@fortawesome/fontawesome-svg-core": "^6.7.2", "@fortawesome/free-solid-svg-icons": "^6.7.2", "@fortawesome/react-fontawesome": "^0.2.2", + "clsx": "^2.1.1", "icons": "link:@awesome.me/kit-KIT_CODE/icons", "next": "15.1.4", "react": "^19.0.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0afb992..0efa435 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ importers: '@fortawesome/react-fontawesome': specifier: ^0.2.2 version: 0.2.2(@fortawesome/fontawesome-svg-core@6.7.2)(react@19.0.0) + clsx: + specifier: ^2.1.1 + version: 2.1.1 icons: specifier: link:@awesome.me/kit-KIT_CODE/icons version: link:@awesome.me/kit-KIT_CODE/icons @@ -567,6 +570,10 @@ packages: client-only@0.0.1: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + clsx@2.1.1: + resolution: {integrity: sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==} + engines: {node: '>=6'} + color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} @@ -2203,6 +2210,8 @@ snapshots: client-only@0.0.1: {} + clsx@2.1.1: {} + color-convert@2.0.1: dependencies: color-name: 1.1.4