Skip to content

Commit

Permalink
feat: 🎸 add main page
Browse files Browse the repository at this point in the history
  • Loading branch information
sweatpotato13 committed Feb 15, 2025
1 parent 8b93749 commit 831a764
Show file tree
Hide file tree
Showing 7 changed files with 255 additions and 43 deletions.
15 changes: 4 additions & 11 deletions next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@

const nextConfig = {
async rewrites() {
return [
];
return [];
},
async redirects() {
return [
{
source: "/",
destination: "/auction",
permanent: true,
},
];
return [];
},
images: {
domains: ["mabires2.pril.cc"],
remotePatterns: [
{
protocol: 'https',
hostname: 'mabires2.pril.cc',
protocol: "https",
hostname: "mabires2.pril.cc",
},
],
deviceSizes: [40, 120, 200],
Expand Down
84 changes: 83 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,85 @@
import { ArrowLeftRightIcon, Swords } from "lucide-react";
import Link from "next/link";

import AuctionIcon from "@/components/icons/auction-icon";
import DocumentIcon from "@/components/icons/document-icon";
import HornIcon from "@/components/icons/horn-icon";
import ShopIcon from "@/components/icons/shop-icon";

interface NavigationCardProps {
href: string;
title: string;
description: string;
icon: React.ReactNode;
}

function NavigationCard({
href,
title,
description,
icon,
}: NavigationCardProps) {
return (
<Link
href={href}
className="group relative rounded-lg border border-slate-200 bg-white p-6 shadow-sm transition-shadow hover:shadow-md"
>
<div className="flex items-center gap-4">
<div className="flex h-12 w-12 items-center justify-center rounded-lg bg-slate-50 group-hover:bg-slate-100">
{icon}
</div>
<div>
<h3 className="font-semibold text-slate-900">{title}</h3>
<p className="mt-1 text-sm text-slate-500">{description}</p>
</div>
</div>
</Link>
);
}

export default function Page() {
return <div></div>;
return (
<div className="mx-auto max-w-7xl px-4 py-12 sm:px-6 lg:px-8">
<div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3">
<NavigationCard
href="/auction"
title="경매장"
description="실시간 경매장 아이템 가격을 확인하세요"
icon={<AuctionIcon className="h-6 w-6 text-slate-600" />}
/>
<NavigationCard
href="/dungeon"
title="던전 아이템"
description="던전별 드롭 아이템과 가격을 확인하세요"
icon={<Swords className="h-6 w-6 text-slate-600" />}
/>
<NavigationCard
href="/horn"
title="뿔피리 조회"
description="뿔피리 내역을 조회하세요"
icon={<HornIcon className="h-6 w-6 text-slate-600" />}
/>
<NavigationCard
href="/npc-shop"
title="NPC 상점"
description="NPC 상점 아이템 정보를 확인하세요"
icon={<ShopIcon className="h-6 w-6 text-slate-600" />}
/>
<NavigationCard
href="/changelog"
title="변경 이력"
description="사이트의 변경 사항을 확인하세요"
icon={
<ArrowLeftRightIcon className="h-6 w-6 text-slate-600" />
}
/>
<NavigationCard
href="/contact"
title="문의하기"
description="문의사항이나 피드백을 보내주세요"
icon={<DocumentIcon className="h-6 w-6 text-slate-600" />}
/>
</div>
</div>
);
}
4 changes: 3 additions & 1 deletion src/components/providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ export function Providers({ children }: { children: React.ReactNode }) {
return (
<QueryClientProvider client={queryClient}>
{children}
<ReactQueryDevtools initialIsOpen={false} />
{process.env.NODE_ENV === "development" && (
<ReactQueryDevtools initialIsOpen={false} />
)}
</QueryClientProvider>
);
}
11 changes: 10 additions & 1 deletion src/components/topbar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client";

import { Swords } from "lucide-react";
import Link from "next/link";
import React, { useState } from "react";

Expand Down Expand Up @@ -64,7 +65,7 @@ function Topbar() {
{isMenuOpen && (
<div className="absolute top-16 right-0 mt-2 w-48 rounded-lg shadow-lg bg-base-200 z-50">
<ul className="menu p-2">
<li className="flex items-center space-x-2">
<li className="flex space-x-2">
<div className="flex">
<ShopIcon className="h-5 w-5" />
<a href="/npc-shop" className="ml-2">
Expand All @@ -88,6 +89,14 @@ function Topbar() {
</a>
</div>
</li>
<li className="flex space-x-2">
<div className="flex items-center">
<Swords className="h-5 w-5" />
<a href="/dungeon" className="ml-2">
던전 드랍 아이템
</a>
</div>
</li>
<li className="flex space-x-2">
<div className="flex items-center">
<DocumentIcon className="h-5 w-5" />
Expand Down
148 changes: 148 additions & 0 deletions src/constant/dungeons-items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,10 @@ export const DUNGEON_ITEMS: DungeonItem[] = [
"되살아난 허상 - 어려움",
],
},
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
Expand Down Expand Up @@ -2234,6 +2238,150 @@ export const DUNGEON_ITEMS: DungeonItem[] = [
},
],
},
{
id: createUniqueId("불길한 운명의 파편", "몽환의 라비 던전", []),
name: "불길한 운명의 파편",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "불길한 운명의 파편")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("황혼의 검", "몽환의 라비 던전", []),
name: "황혼의 검",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "황혼의 검")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("태양석", "몽환의 라비 던전", []),
name: "태양석",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "태양석")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("만월석", "몽환의 라비 던전", []),
name: "만월석",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "만월석")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("냉혹함의 징표", "몽환의 라비 던전", []),
name: "냉혹함의 징표",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "냉혹함의 징표")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("단호한 칼날의 파편", "몽환의 라비 던전", []),
name: "단호한 칼날의 파편",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "단호한 칼날의 파편")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("마력의 황금 실", "몽환의 라비 던전", []),
name: "마력의 황금 실",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "마력의 황금 실")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("변형된 고리형 구조체", "몽환의 라비 던전", []),
name: "변형된 고리형 구조체",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "변형된 고리형 구조체")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("악몽 파수꾼의 유물", "몽환의 라비 던전", []),
name: "악몽 파수꾼의 유물",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "악몽 파수꾼의 유물")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("증폭된 연금술 결정", "몽환의 라비 던전", []),
name: "증폭된 연금술 결정",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "증폭된 연금술 결정")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("혼돈의 룬", "몽환의 라비 던전", []),
name: "혼돈의 룬",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "혼돈의 룬")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
{
id: createUniqueId("마력의 정수", "몽환의 라비 던전", []),
name: "마력의 정수",
imageUrl: `/api/item-image?id=${AllItemList.find(item => item.name === "마력의 정수")?.id}`,
price: 0,
drops: [
{
dungeon: "몽환의 라비 던전",
difficulties: [],
},
],
},
];

// 던전별 아이템 목록을 가져오는 유틸리티 함수
Expand Down
30 changes: 1 addition & 29 deletions src/constant/dungeons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ export type DungeonType =
| "크롬 바스"
| "테흐 두인 미션"
| "마그 멜 미션"
| "몽환의 라비 던전"
| "울라 하드 모드 던전"
| "베테랑 던전"
| "심연의 페카 상급"
| "심연의 코일 상급";
| "몽환의 라비 던전";

export const DUNGEON_LIST: DungeonType[] = [
"브리 레흐",
Expand All @@ -17,10 +13,6 @@ export const DUNGEON_LIST: DungeonType[] = [
"테흐 두인 미션",
"마그 멜 미션",
"몽환의 라비 던전",
"울라 하드 모드 던전",
"베테랑 던전",
"심연의 페카 상급",
"심연의 코일 상급",
];

export type SubDifficulty = {
Expand Down Expand Up @@ -87,24 +79,4 @@ export const DUNGEON_INFO: Record<DungeonType, DungeonInfo> = {
description: "몽환의 라비 던전입니다.",
subDifficulties: [],
},
"울라 하드 모드 던전": {
name: "울라 하드 모드 던전",
description: "울라 하드 모드 던전입니다.",
subDifficulties: [],
},
"베테랑 던전": {
name: "베테랑 던전",
description: "베테랑 던전입니다.",
subDifficulties: [],
},
"심연의 페카 상급": {
name: "심연의 페카 상급",
description: "심연의 페카 상급 던전입니다.",
subDifficulties: [],
},
"심연의 코일 상급": {
name: "심연의 코일 상급",
description: "심연의 코일 상급 던전입니다.",
subDifficulties: [],
},
};
6 changes: 6 additions & 0 deletions src/lib/api/auction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ export interface AuctionResponse {
next_cursor: string;
}

// API 호출 간 딜레이를 위한 sleep 함수
const sleep = (ms: number) => new Promise(resolve => setTimeout(resolve, ms));

async function fetchAllAuctionPages(params: {
item_name?: string;
auction_item_category?: string;
Expand All @@ -38,6 +41,9 @@ async function fetchAllAuctionPages(params: {
try {
do {
try {
// API 호출 간 1초 딜레이 추가
await sleep(1000);

const queryParams = new URLSearchParams();
if (params.item_name) {
queryParams.append("item_name", params.item_name);
Expand Down

0 comments on commit 831a764

Please sign in to comment.