From e3eb8934ef21412698cb7638aa6ee93fbf5765a4 Mon Sep 17 00:00:00 2001 From: monoid Date: Mon, 7 Apr 2025 22:53:01 +0900 Subject: [PATCH] ai data --- package.json | 3 +- pnpm-lock.yaml | 35 ++++ src/App.tsx | 250 +++++++++++----------- src/Gallery.tsx | 37 ++-- src/data/article.ts | 492 ++++++++++++++++++++++++++++++++++++++++++++ src/table.tsx | 6 +- 6 files changed, 688 insertions(+), 135 deletions(-) create mode 100644 src/data/article.ts diff --git a/package.json b/package.json index 7cca0b2..4a36742 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "react": "^18.3.1", "react-dom": "^18.3.1", "tailwind-merge": "^3.0.2", - "tailwindcss": "^4.0.17" + "tailwindcss": "^4.0.17", + "wouter": "^3.6.0" }, "devDependencies": { "@eslint/js": "^9.17.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8144fd2..5dcb70c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,6 +29,9 @@ importers: tailwindcss: specifier: ^4.0.17 version: 4.0.17 + wouter: + specifier: ^3.6.0 + version: 3.6.0(react@18.3.1) devDependencies: '@eslint/js': specifier: ^9.17.0 @@ -956,6 +959,9 @@ packages: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} engines: {node: '>=16 || 14 >=14.17'} + mitt@3.0.1: + resolution: {integrity: sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==} + ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} @@ -1022,6 +1028,10 @@ packages: resolution: {integrity: sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ==} engines: {node: '>=0.10.0'} + regexparam@3.0.0: + resolution: {integrity: sha512-RSYAtP31mvYLkAHrOlh25pCNQ5hWnT106VukGaaFfuJrZFkGRX5GhUAdPqpSDXxOhA2c4akmRuplv1mRqnBn6Q==} + engines: {node: '>=8'} + resolve-from@4.0.0: resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} engines: {node: '>=4'} @@ -1105,6 +1115,11 @@ packages: uri-js@4.4.1: resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + use-sync-external-store@1.5.0: + resolution: {integrity: sha512-Rb46I4cGGVBmjamjphe8L/UnvJD+uPPtTkNvX5mZgqdbavhI4EbgIWJiIHXJ8bc/i9EQGPRh4DwEURJ552Do0A==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 + vite@6.0.9: resolution: {integrity: sha512-MSgUxHcaXLtnBPktkbUSoQUANApKYuxZ6DrbVENlIorbhL2dZydTLaZ01tjUoE3szeFzlFk9ANOKk0xurh4MKA==} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} @@ -1154,6 +1169,11 @@ packages: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} + wouter@3.6.0: + resolution: {integrity: sha512-l11eR4urCc+CbY8+pV8HKFHxEqMgffss9aVB1XwiSkLDtH3cI6XpCa50cOzREzL0KwQqrwCVE5dCyeNcCgFpPg==} + peerDependencies: + react: '>=16.8.0' + yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} @@ -1922,6 +1942,8 @@ snapshots: dependencies: brace-expansion: 2.0.1 + mitt@3.0.1: {} + ms@2.1.3: {} nanoid@3.3.8: {} @@ -1979,6 +2001,8 @@ snapshots: dependencies: loose-envify: 1.4.0 + regexparam@3.0.0: {} + resolve-from@4.0.0: {} reusify@1.0.4: {} @@ -2066,6 +2090,10 @@ snapshots: dependencies: punycode: 2.3.1 + use-sync-external-store@1.5.0(react@18.3.1): + dependencies: + react: 18.3.1 + vite@6.0.9(jiti@2.4.2)(lightningcss@1.29.2): dependencies: esbuild: 0.24.2 @@ -2082,4 +2110,11 @@ snapshots: word-wrap@1.2.5: {} + wouter@3.6.0(react@18.3.1): + dependencies: + mitt: 3.0.1 + react: 18.3.1 + regexparam: 3.0.0 + use-sync-external-store: 1.5.0(react@18.3.1) + yocto-queue@0.1.0: {} diff --git a/src/App.tsx b/src/App.tsx index f510eff..f549d0c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,6 +8,8 @@ import { GalleryTitleHeader } from './GalleryTitleHeader'; import { GlobalNavigationBar, Header, VisitHistory } from './Header'; import { LoginBox } from './Sidebar'; import { GalleryTable, TableRowData } from './table'; +import { articles } from './data/article'; +import { Route, Switch } from 'wouter'; const tableData: TableRowData[] = [ @@ -37,22 +39,6 @@ const tableData: TableRowData[] = [ recommendations: "-", isAdOrSurvey: true, }, - { // Notice Example 1 - id: 1012381, - category: "공지", - titleText: "3월 5주차 주던", - commentCount: 7, - variant: "icon_notice", - author: { - type: "nickname", - nickname: "보배단", - userType: "manager", // Optional, if applicable - }, - date: "25.03.27", - views: 3178, - recommendations: 12, - isNotice: true, - }, { // Notice Example 2 id: 784571, category: "공지", @@ -69,34 +55,28 @@ const tableData: TableRowData[] = [ recommendations: 6, isNotice: true, }, - { // Normal Row Example 1 - id: 1040045, + ...articles.map((item) => ({ + id: item.id, // Random ID for each article category: "일반", - titleText: "버서커 헬 졸업해도되는데 태초한번도 안떠서 계속 돌림", + titleText: item.Title, variant: "icon_pic", - commentCount: 2, - author: { - type: "nickname", - nickname: "븜구리", - userType: "manager", // Optional, if applicable - }, - date: "21:58", - views: 4, - recommendations: 0, - }, - { // Normal Row Example 2 (IP Author) - id: 1040043, - category: "일반", - titleText: "혹시 엘마가 진각무기압타 빗자루 쓸 수 있음?", - variant: "icon_txt", - author: { + date: `25.04.02`, + views: parseInt(item.View), + commentCount: item.comments.length, + author: item.Author.match(/ㅇㅇ \(\d+\.\d+\)/) ? { type: "IP", - ip: "1.248", + ip: item.Author.split(" ")[1], + } : item.Author === "ㅇㅇ" ? { + type: "semi-nickname", + nickname: item.Author, + } : { + type: "nickname", + nickname: item.Author, }, - date: "21:58", - views: 1, - recommendations: 0, - }, + titleLinkUrl: `/${item.id}`, + recommendations: Math.floor(Math.random() * 50), // Random number for recommendations + isNews: false, + } satisfies TableRowData)), // ... Add all other rows from the original HTML here { // News Row Example id: '', // No ID @@ -110,59 +90,75 @@ const tableData: TableRowData[] = [ }, ]; +function GalleryMain() { + return +
+ + +
+
+
+
+
+ +
+ + + +
+
+ +
+
+
+
+
+