diff --git a/src/pages/saju/components/FortuneRing.jsx b/src/pages/saju/components/FortuneRing.jsx new file mode 100644 index 0000000..17b1a6c --- /dev/null +++ b/src/pages/saju/components/FortuneRing.jsx @@ -0,0 +1,32 @@ +import React from 'react'; + +export default function FortuneRing({ score, max = 100 }) { + const radius = 80; + const circumference = 2 * Math.PI * radius; + const safe = Math.max(0, Math.min(score || 0, max)); + const dashOffset = circumference - (safe / max) * circumference; + + return ( +
+ + + + +
+
{safe}
+
/ {max}
+
+
+ ); +} diff --git a/src/pages/saju/components/LuckyBox.jsx b/src/pages/saju/components/LuckyBox.jsx new file mode 100644 index 0000000..847fd99 --- /dev/null +++ b/src/pages/saju/components/LuckyBox.jsx @@ -0,0 +1,21 @@ +import React from 'react'; + +export default function LuckyBox({ lucky }) { + if (!lucky) return null; + return ( +
+
+
럭키 컬러
+
{(lucky.color || []).join(' · ')}
+
+
+
럭키 숫자
+
{lucky.number}
+
+
+
럭키 방향
+
{lucky.direction}
+
+
+ ); +} diff --git a/src/pages/saju/components/ScoreCard.jsx b/src/pages/saju/components/ScoreCard.jsx new file mode 100644 index 0000000..22546f8 --- /dev/null +++ b/src/pages/saju/components/ScoreCard.jsx @@ -0,0 +1,38 @@ +import React from 'react'; + +const ICON_BY_CATEGORY = { + wealth: '💰', + romance: '💖', + social: '🤝', + career: '💼', +}; + +const COLOR_VAR_BY_CATEGORY = { + wealth: 'var(--saju-wealth)', + romance: 'var(--saju-romance)', + social: 'var(--saju-social)', + career: 'var(--saju-career)', +}; + +const TITLE_BY_CATEGORY = { + wealth: '재물운', + romance: '연애운', + social: '인간관계', + career: '직장운', +}; + +export default function ScoreCard({ category, score }) { + const safe = Math.max(0, Math.min(score || 0, 100)); + return ( +
+
+ {ICON_BY_CATEGORY[category]} + {TITLE_BY_CATEGORY[category]} +
+
{safe}/100
+
+
+
+
+ ); +}