diff --git a/app/work/saju/result/SajuFortuneSection.tsx b/app/work/saju/result/SajuFortuneSection.tsx index 8607d95..e05e632 100644 --- a/app/work/saju/result/SajuFortuneSection.tsx +++ b/app/work/saju/result/SajuFortuneSection.tsx @@ -1,6 +1,7 @@ 'use client'; import { useMemo } from 'react'; +import { LottoIcon } from './SajuIcons'; // ── 천간 / 지지 ─────────────────────────────────────────────────────── const STEMS = ['甲','乙','丙','丁','戊','己','庚','辛','壬','癸']; @@ -73,8 +74,33 @@ function seededRand(seed: number) { return () => { s = (s * 1664525 + 1013904223) & 0xffffffff; return (s >>> 0) / 0xffffffff; }; } +// ── 로컬 라인 아이콘 (이모지 대체, 파일 전용 — SajuIcons.tsx 미변경) ────── +type GlyphName = 'sun' | 'great' | 'good' | 'neutral' | 'caution' | 'money' | 'love' | 'career' | 'health' | 'social'; + +const GLYPH_PATHS: Record = { + sun: 'M12 8a4 4 0 100 8 4 4 0 000-8zM12 2v2M12 20v2M4 12H2M22 12h-2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41', + great: 'M12 3l2.2 5.6L20 9l-4.5 3.9L17 19l-5-3-5 3 1.5-6.1L4 9l5.8-.4z', + good: 'M4 12l5 5L20 6', + neutral: 'M4 13c2-2 4-2 6 0s4 2 6 0 4-2 6 0', + caution: 'M12 3l9 16H3zM12 10v4M12 16.5h.01', + money: 'M12 4a8 4 0 1 0 0 8a8 4 0 1 0 0-8M4 8v8a8 4 0 0 0 16 0V8', + love: 'M12 20s-7-4.4-7-9a4 4 0 0 1 7-2.6A4 4 0 0 1 19 11c0 4.6-7 9-7 9z', + career: 'M4 8h16v11H4zM9 8V5h6v3', + health: 'M3 12h4l2-5 3 10 2-6 2 1h5', + social: 'M9 11a3 3 0 100-6 3 3 0 000 6zM3 20c0-3 3-5 6-5s6 2 6 5M17 11a3 3 0 100-6M15 20c0-2.5 1.5-4.5 4-5', +}; + +function Glyph({ name, className }: { name: GlyphName; className?: string }) { + return ( + + + + ); +} + // ── 운세 항목 빌드 ──────────────────────────────────────────────────── -type Area = { icon: string; label: string; score: number; desc: string }; +type Area = { icon: GlyphName; label: string; score: number; desc: string }; const DESCS: Record> = { money: { @@ -119,7 +145,7 @@ function buildAreas( const rand = seededRand(seed); const roll = () => Math.round(Math.max(15, Math.min(98, rand() * 40 + overall - 20))); const keys = ['money','love','career','health','social'] as const; - const icons = ['💰','💕','🎯','🌿','🤝']; + const icons: GlyphName[] = ['money','love','career','health','social']; const labels = ['재물운','애정운','직업운','건강운','사회운']; return keys.map((k, i) => { const s = roll(); @@ -128,11 +154,11 @@ function buildAreas( } // ── 레벨별 색상/라벨 ───────────────────────────────────────────────── -const LEVEL_META: Record = { - great: { emoji:'🌟', label:'아주 좋은 날', bar:'#f59e0b', bg:'bg-amber-50', border:'border-amber-300', text:'text-amber-800', badge:'bg-amber-100 text-amber-700 border-amber-300' }, - good: { emoji:'✨', label:'좋은 날', bar:'#22c55e', bg:'bg-emerald-50',border:'border-emerald-300',text:'text-emerald-800',badge:'bg-emerald-100 text-emerald-700 border-emerald-300' }, - neutral: { emoji:'🌤️', label:'평온한 날', bar:'#64748b', bg:'bg-slate-50', border:'border-slate-200', text:'text-slate-700', badge:'bg-slate-100 text-slate-600 border-slate-200' }, - caution: { emoji:'⚠️', label:'조심하는 날', bar:'#f97316', bg:'bg-orange-50', border:'border-orange-300',text:'text-orange-800', badge:'bg-orange-100 text-orange-700 border-orange-300' }, +const LEVEL_META: Record = { + great: { icon:'great', label:'아주 좋은 날', bar:'#f59e0b', bg:'bg-amber-50', border:'border-amber-300', text:'text-amber-800', badge:'bg-amber-100 text-amber-700 border-amber-300' }, + good: { icon:'good', label:'좋은 날', bar:'#22c55e', bg:'bg-emerald-50',border:'border-emerald-300',text:'text-emerald-800',badge:'bg-emerald-100 text-emerald-700 border-emerald-300' }, + neutral: { icon:'neutral', label:'평온한 날', bar:'#64748b', bg:'bg-slate-50', border:'border-slate-200', text:'text-slate-700', badge:'bg-slate-100 text-slate-600 border-slate-200' }, + caution: { icon:'caution', label:'조심하는 날', bar:'#f97316', bg:'bg-orange-50', border:'border-orange-300',text:'text-orange-800', badge:'bg-orange-100 text-orange-700 border-orange-300' }, }; const REL_DESC: (yongShin: string, yongShinKr: string) => Record = (y, yk) => ({ @@ -148,7 +174,7 @@ const REL_DESC: (yongShin: string, yongShinKr: string) => Record = function ScoreBar({ score, color }: { score: number; color: string }) { return (
-
+
{score} @@ -185,31 +211,31 @@ export default function SajuFortuneSection({ <> {/* ── 상단 연결 화살표 ── */}
-
-
- 사주 분석에서 이어지는 오늘의 운세 +
+
+ 사주 분석에서 이어지는 오늘의 운세
-
+
{/* ── 본문 카드 ── */} -
+
{/* 헤더 */} -
+
-
- ☀️ +
+

오늘의 운세

-

+

{today.year}년 {today.month}월 {today.date}일 · 일진 {today.stem}{today.branch} ({today.stemKr}{today.branchKr})

- - {meta.emoji} {meta.label} + + {meta.label}
@@ -237,7 +263,7 @@ export default function SajuFortuneSection({ 오늘 종합 운세
@@ -247,20 +273,22 @@ export default function SajuFortuneSection({ {/* 5대 운세 그리드 */}
-

오늘의 분야별 운세

+

오늘의 분야별 운세

{areas.map((area) => { const aLevel = toLevel(area.score); const aMeta = LEVEL_META[aLevel]; return (
-
- {area.icon} +
+
- {area.label} - {aMeta.emoji} + {area.label} + + +

{area.desc}

@@ -278,45 +306,41 @@ export default function SajuFortuneSection({

{/* 로또 CTA */} -
-
-
-
- 🎱 - - {level === 'great' ? '오늘 운이 아주 좋습니다! 로또도 한 번 도전해보세요.' : '사주 기반 행운 번호도 확인해보세요.'} - -
-

- 용신 {yongShin}({yongShinKr}) 오행이 담긴 - 사주 기반 로또 번호가 아래에 준비되어 있습니다. - {hasLottoSubscription - ? ' 구독 중이신 로또 서비스의 매주 최신 추천 번호도 함께 확인하세요.' - : ' 로또 구독 시 대운 교차 분석으로 더 정밀한 번호를 매주 받을 수 있어요.'} -

- { - e.preventDefault(); - document.getElementById('saju-lotto-section')?.scrollIntoView({ behavior: 'smooth', block: 'start' }); - }} - className="block w-full text-center bg-gradient-to-r from-amber-500 to-amber-400 hover:from-amber-400 hover:to-amber-300 text-[#04102b] text-sm font-extrabold px-4 py-2.5 rounded-xl transition-all shadow-lg cursor-pointer" - > - 오늘의 로또 번호 추천 보기 ↓ - +
+
+ + + {level === 'great' ? '오늘 운이 아주 좋습니다! 로또도 한 번 도전해보세요.' : '사주 기반 행운 번호도 확인해보세요.'} +
+

+ 용신 {yongShin}({yongShinKr}) 오행이 담긴 + 사주 기반 로또 번호가 아래에 준비되어 있습니다. + {hasLottoSubscription + ? ' 구독 중이신 로또 서비스의 매주 최신 추천 번호도 함께 확인하세요.' + : ' 로또 구독 시 대운 교차 분석으로 더 정밀한 번호를 매주 받을 수 있어요.'} +

+ { + e.preventDefault(); + document.getElementById('saju-lotto-section')?.scrollIntoView({ behavior: 'smooth', block: 'start' }); + }} + className="block w-full text-center bg-white hover:bg-white/90 text-[var(--jsm-navy)] text-sm font-extrabold px-4 py-2.5 rounded-xl transition-colors cursor-pointer" + > + 오늘의 로또 번호 추천 보기 ↓ +
{/* 하단 연결 */}
-
-
- 🎱 오늘의 운세에서 이어지는 사주 로또 추천 +
+
+ 오늘의 운세에서 이어지는 사주 로또 추천
-
+
);