export const ZODIAC_EN: Record = { 鼠: "rat", 牛: "ox", 虎: "tiger", 兔: "rabbit", 龙: "dragon", 蛇: "snake", 马: "horse", 羊: "goat", 猴: "monkey", 鸡: "rooster", 狗: "dog", 猪: "pig", } export const zodiacImg = (z?: string) => (z && ZODIAC_EN[z] ? `/data/zodiac/${ZODIAC_EN[z]}.jpg` : "") /* 全球心理援助热线 (公开发布的常用号码; 仅作引导, 紧急情况请拨当地急救号)。 国际目录 findahelpline.com 可按所在地查询。 */ export const HELPLINES_GLOBAL: { region: string; name: string; tel: string }[] = [ { region: "International", name: "Find a Helpline", tel: "findahelpline.com" }, { region: "Mainland China", name: "Hope 24 Hotline", tel: "400-161-9995" }, { region: "Mainland China", name: "Beijing Suicide Research and Prevention Center", tel: "010-82951332" }, { region: "Hong Kong, China", name: "The Samaritans", tel: "2389 2222" }, { region: "Taiwan, China", name: "Anxin Mental Health Hotline", tel: "1925" }, { region: "US / Canada", name: "Suicide & Crisis Lifeline", tel: "988" }, { region: "UK / Ireland", name: "Samaritans", tel: "116 123" }, { region: "Australia", name: "Lifeline", tel: "13 11 14" }, { region: "Japan", name: "TELL Lifeline", tel: "0570-783-556" }, { region: "India", name: "AASRA", tel: "+91 9820466726" }, { region: "EU", name: "Emergency", tel: "112" }, ] export const ZHI12 = ["子", "丑", "寅", "卯", "辰", "巳", "午", "未", "申", "酉", "戌", "亥"] export const hourZhi = (h: number) => ZHI12[Math.floor(((h + 1) % 24) / 2)] /* 阿拉伯数字 → 中文数字(玉盘五行能量值,与水墨风格一致) */ const CN_DIGITS = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"] export function toChineseNum(n: number): string { if (n < 0) return String(n) if (n < 10) return CN_DIGITS[n] if (n < 20) return "十" + (n % 10 ? CN_DIGITS[n % 10] : "") if (n < 100) { const t = Math.floor(n / 10), o = n % 10 return CN_DIGITS[t] + "十" + (o ? CN_DIGITS[o] : "") } return String(n) } /* 五行 / 流年关系 的英文惯用译名(年运英文模式用) */ export const ELEMENT_EN: Record = { 金: "Metal", 木: "Wood", 水: "Water", 火: "Fire", 土: "Earth" } export const RELATION_EN: Record = { 同类: "Companion", 生我: "Resource", 我生: "Output", 我克: "Wealth", 克我: "Influence" } /* 五行玉盘流体配色(实体白玉盘上的矿彩,不随主题切换) */ export const JADE_COLOR: Record = { 金: "#B8B2A2", 木: "#5C7A6B", 水: "#5C7CA8", 火: "#A35B5B", 土: "#C5A46B", } /* Canvas / SVG 调色板(随主题) */ export const PALETTES = { ru: { star: "150,144,128", ink: "#3A3833", display: "#1B1A17", dim: "rgba(163,156,141,0.95)", gold: "#1F1E1A", ringFaint: "#EFEDE6", centerFill: "#FFFFFF", arcFill: "rgba(70,80,70,0.03)", arcCur: "rgba(31,30,26,0.1)", weaveBg: "rgba(255,255,255,0.3)", weaveDot: "120,110,90", weaveLine: "60,58,50", element: { 金: "#8E876F", 木: "#4F6E5E", 水: "#4A6B97", 火: "#9C4F4F", 土: "#A8854E" } as Record, }, xuanwu: { star: "237,230,214", ink: "#D8D2C4", display: "#EDE6D6", dim: "rgba(148,141,126,0.9)", gold: "#C5A46B", ringFaint: "rgba(197,164,107,0.18)", centerFill: "rgba(16,18,22,0.5)", arcFill: "rgba(249,246,240,0.05)", arcCur: "rgba(197,164,107,0.28)", weaveBg: "rgba(21,23,27,0.28)", weaveDot: "232,221,192", weaveLine: "197,164,107", element: { 金: "#B8B2A2", 木: "#7FA290", 水: "#7E9CC4", 火: "#C08080", 土: "#C5A46B" } as Record, }, } export type ThemeName = keyof typeof PALETTES export const pal = () => PALETTES[(document.documentElement.dataset.theme as ThemeName) || "ru"] || PALETTES.ru export const TZ_LABEL = (v: number) => { const sign = v >= 0 ? "+" : "-" const a = Math.abs(v) return `UTC${sign}${String(Math.floor(a)).padStart(2, "0")}:${a % 1 ? "30" : "00"}` } /* day_master_element 是日柱双字五行,单一日主五行取日柱天干五行 */ export const dayMasterElement = (ming: { pillars?: { gan_element: string }[] }): string => ming?.pillars?.[2]?.gan_element ?? "土" export const FAQ_ITEMS_EN: Array<[string, string]> = [ ["Is Chinese metaphysics just superstition?", "Treating it as absolute prophecy is superstition. Treating it as an ancient language for observing the relationship between yourself and time makes it a cultural and psychological tool. Every reading here lands on actionable reflection — never a verdict."], ["Does the zodiac follow the Lunar New Year or the Start of Spring?", "Common usage follows the first day of the Lunar New Year; classical astrology follows lìchūn (Start of Spring). This app uses the classical convention, so people born in January or February may see a different zodiac than their official ID — that is expected."], ["What is true solar time, and why do I need to enter my birth city?", "Ancients used sundials: noon meant the sun directly overhead. Clock time is standardized by time zone, but local solar time shifts 4 minutes for every degree of longitude from the zone's centre. Your birth city corrects for this, making the hour calculation more precise."], ["I was born in the Southern Hemisphere — how is my chart handled?", "The 'month pillar' in a birth chart is really about season. July in the Southern Hemisphere is winter. For Southern Hemisphere births, this app adjusts the month pillar to reflect the actual season — a common and reasonable approach among practitioners."], ["What is a luck cycle (dàyùn) and why does it last ten years?", "Luck cycles project your chart forward through the seasonal markers (solar terms), marking roughly ten-year climate periods in your life. They are not verdicts — think of them as weather forecasts: knowing the rainy season is coming so you can pack an umbrella."], ["My hexagram shows something inauspicious. What do I do?", "In the Yi Jing, auspicious/inauspicious means 'this path flows / this path meets resistance' — not a sentence. When resistance appears, the classical answer is always: adjust direction, build strength, wait for timing. This app translates that into a small action you can take today."], ["If I cast again tomorrow, I'll get a different hexagram — which one counts?", "Tradition says 'cast once per question, sincerely, on first impulse.' The value isn't in predicting an outcome — it's in the moment you force a vague anxiety into a specific, concrete question. That act of articulation is itself already problem-solving."], ["Star omens like 'Seven Killings' or 'Peach Blossom' sound alarming / mystical?", "They are poetic labels ancient observers gave to common life patterns: Seven Killings points to external pressure; Peach Blossom to social magnetism; Travelling Horse to change and mobility. This app translates all of them into psychological descriptions — no fear, no mystification."], ["Is my birth data safe?", "Everything is stored only on this device and never uploaded anywhere. Your profile is tied to this browser; other devices cannot see it. Backups are encrypted with your own password. You can erase everything at any time with one click."], ] export const FAQ_ITEMS: Array<[string, string]> = [ ["命理是迷信吗?", "把命理当作「绝对预言」是迷信;把它当作一套观察自己与时间关系的古老语言,则是文化与心理工具。本盘所有解读都落回可行动的建议,从不替您下判决。"], ["生肖按农历新年算,还是按立春算?", "民间常按农历正月初一,命理传统按立春换年。本盘排盘采用农历年界的传统算法,所以一二月份出生者的生肖可能与身份证习惯不同,这是正常的。"], ["什么是真太阳时?为什么要填出生城市?", "古人以日晷定时,太阳到头顶正上方才是「正午」。钟表时间是按时区统一的,与当地太阳时间每偏离时区中央经线 1° 就差 4 分钟。出生城市就是用来做这个校正,让时辰更准。"], ["南半球出生,八字怎么算?", "八字里的「月令」本质是季节。南半球的七月是冬天,所以本盘对南半球出生者按季节对冲调整月柱(业内常见的折中处理之一), 让排盘贴合真实的季节体感。"], ["大运是什么?为什么十年一换?", "大运是从出生那一刻起,顺着节气往前(或往后) 推出来的「人生季节表」, 每十年一个气候段。它不是吉凶判决,更像天气预报:知道雨季要来,就备好伞。"], ["卦上出现「凶」字怎么办?", "《易经》里的吉凶是「此路顺/此路阻」的路况提示,不是命运宣判。遇到阻,经文给的答案从来都是:调整方向、积蓄力量、等待时机。本盘会把这些转译成今天就能做的一小步。"], ["摇出的卦,换个时间再摇会不一样,哪个算数?", "传统讲「不动不占,一事一占」: 同一件事以第一次诚心起的卦为准。卦的价值不在预测对错,而在它逼你把模糊的焦虑说成一个具体的问题——这件事本身就已经在解决问题了。"], ["神煞(如七杀、桃花) 听起来很吓人/很玄?", "它们是古人给「人生常见情境」起的代号:七杀指外部压力,桃花指人缘吸引力,驿马指变动。本盘一律把它们翻译成心理状态描述,不恐吓、不渲染。"], ["我的生辰数据安全吗?", "全部数据只存在本机,不上传云端;档案与您的设备绑定,其他设备不可见;备份文件用您设的密码加密。您随时可以一键清除。"], ]