feat: 토정비결 및 PDF 저장 기능 추가

- 토정비결 페이지 구현 (연간/월별 운세)
- 분야별 운세 (재물, 건강, 관운, 애정)
- PDF 저장 기능 구현 (jsPDF + html2canvas)
- 모든 결과 페이지에 PDF 다운로드 기능 추가
- PDFButton 재사용 가능한 컴포넌트 생성
- 홈페이지에 토정비결 링크 추가
- 페이지 간 네비게이션 링크 업데이트

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-11 23:44:55 +09:00
parent 08d6f71fd1
commit f85e857bea
11 changed files with 950 additions and 17 deletions

View File

@@ -1,5 +1,6 @@
import Link from 'next/link';
import { calculateSaju } from '@/lib/saju-calculator';
import PDFButton from '../components/PDFButton';
interface PageProps {
searchParams: Promise<{
@@ -118,7 +119,7 @@ export default async function FortunePage({ searchParams }: PageProps) {
</nav>
{/* Content */}
<div className="max-w-6xl mx-auto px-4 py-12">
<div id="pdf-content" className="max-w-6xl mx-auto px-4 py-12">
{/* Header */}
<div className="text-center mb-12">
<h1 className="text-4xl md:text-5xl font-bold text-gray-900 mb-4">
@@ -218,7 +219,7 @@ export default async function FortunePage({ searchParams }: PageProps) {
</div>
{/* 다른 메뉴 */}
<div className="grid md:grid-cols-3 gap-6">
<div className="grid md:grid-cols-2 lg:grid-cols-4 gap-6">
<Link
href={`/result?${new URLSearchParams(params as any).toString()}`}
className="bg-white rounded-xl p-6 shadow-lg hover:shadow-xl transition text-center group"
@@ -229,7 +230,7 @@ export default async function FortunePage({ searchParams }: PageProps) {
</Link>
<Link
href="/"
href="/compatibility"
className="bg-white rounded-xl p-6 shadow-lg hover:shadow-xl transition text-center group"
>
<div className="text-4xl mb-3">💕</div>
@@ -238,13 +239,19 @@ export default async function FortunePage({ searchParams }: PageProps) {
</Link>
<Link
href="/"
href="/tojeong"
className="bg-white rounded-xl p-6 shadow-lg hover:shadow-xl transition text-center group"
>
<div className="text-4xl mb-3">🎋</div>
<h3 className="text-xl font-bold text-gray-900 mb-2"></h3>
<p className="text-gray-600 text-sm"> </p>
</Link>
<PDFButton
elementId="pdf-content"
filename={`오늘의운세_${todayYear}${todayMonth}${todayDay}.pdf`}
buttonText="운세 PDF 저장"
/>
</div>
</div>