dsh-metaphysics 0.62.5 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +79 -3
- package/client.almanac.js +49 -49
- package/client.chart.js +222 -0
- package/client.chenggu.js +57 -57
- package/client.convert.js +50 -50
- package/client.daliuren.js +113 -102
- package/client.fengshui.js +44 -44
- package/client.js +390 -281
- package/client.liuyao.js +112 -101
- package/client.mbti.js +50 -50
- package/client.name.js +51 -51
- package/client.numerology.js +50 -50
- package/client.qimen.js +110 -99
- package/client.star.js +51 -51
- package/client.tarot.js +111 -100
- package/client.xiaoliuren.js +51 -51
- package/client.zeri.js +49 -49
- package/engine/index.js +29 -1
- package/engine/interpret.js +33 -1
- package/engine/structure.js +1 -1
- package/engine/xiaoliuren.js +6 -2
- package/package.json +1 -1
- package//345/221/275/347/220/206/346/216/222/347/233/230.html +277 -30
- package/client.bazi.js +0 -211
- package/client.hepan.js +0 -210
- package/client.trend.js +0 -202
- package/client.ziwei.js +0 -211
|
@@ -362,7 +362,7 @@ h3::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,var(--li
|
|
|
362
362
|
<div class="wrap">
|
|
363
363
|
<header>
|
|
364
364
|
<div class="brand-row">
|
|
365
|
-
<div class="brand"><span class="seal" aria-hidden="true">命</span><span class="brand-txt">命理排盘<span class="ver">v0.
|
|
365
|
+
<div class="brand"><span class="seal" aria-hidden="true">命</span><span class="brand-txt">命理排盘<span class="ver">v0.63.0</span><small>八字 · 紫微 · 六爻 · 梅花 · 六壬 · 奇门 · 合盘 · 塔罗 全部在本机计算</small></span></div>
|
|
366
366
|
<div class="view-switch">
|
|
367
367
|
<span class="hint">熟练了可以换回平铺</span>
|
|
368
368
|
<span class="seg" role="group" aria-label="首屏样式">
|
|
@@ -653,7 +653,7 @@ h3::after{content:"";flex:1;height:1px;background:linear-gradient(90deg,var(--li
|
|
|
653
653
|
<h3>对拍:把典籍当期望值</h3>
|
|
654
654
|
<ul><li>六爻:京房八宫卦序与世应,64 卦全表;旬空六旬表</li><li>六壬:日干寄宫、中气换将;紫微:纳音定五行局、紫微天府相照</li><li>卦例:《增删卜易》9 条 +《卜筮正宗》128 条(93 成对 + 35 静卦),核本变卦 / 动爻数 / 卦宫 / 缺爻 / 旬空</li><li>奇门:20 个时辰 × 9 宫,核四柱 / 局数 / 值符 / 值使 / 星门神 / 天盘干</li></ul>
|
|
655
655
|
<h3>工程验证</h3>
|
|
656
|
-
<ul><li>测试:
|
|
656
|
+
<ul><li>测试:164 个测试文件 / 8794 条断言;七道闸(回归 · 断言基线 · 测试可失败自检 · HTML 注入面 · 工程约定 · 产物宿主形态 · 随机扫射)</li><li>可复现:seed / asOf 显式;同一输入同一输出</li><li>口径:晚子时、真太阳时、奇门三流派、闰月归月都可切换,并有字段级差异对照</li></ul>
|
|
657
657
|
|
|
658
658
|
<h3>已知边界(不猜)</h3>
|
|
659
659
|
<ul><li>六爻应期(具体哪天应验)不做;卦例只录动爻个数,不录爻位</li><li>财富/健康只给结构判断与档位,不给金额区间、不作诊断</li><li>紫微飞星已做「单一支化逐宫追到成环」与「三方四正 16 条按落宫归堆」,但都未叠大限流年四化、不折吉凶;八字交运日已能算到日/时,但未与第三方排盘案例批量对拍</li></ul>
|
|
@@ -5000,7 +5000,7 @@ __mods.structure = (function () {
|
|
|
5000
5000
|
// 八大地支结构(炳祥课堂口径)
|
|
5001
5001
|
//
|
|
5002
5002
|
// 定位:只做「静态结构 + 宫位权重」的只读标注,不改旺衰、不改喜忌。
|
|
5003
|
-
//
|
|
5003
|
+
// 课堂口径来源:炳祥八字课程笔记(内部资料,不随包发布);
|
|
5004
5004
|
// 这里把「四个地支落在身强阵营还是身弱阵营」按年支定 A 档(年支那一档记 A,另一档记 B),
|
|
5005
5005
|
// 于是八种排布可以写成 AAAA / ABBB / AAAB / AABA / ABAA / AABB / ABAB / ABBA,
|
|
5006
5006
|
// 再从「异类那一支的宫位权重」读出静态从格概率:
|
|
@@ -17580,10 +17580,14 @@ function buildXiaoliuren(input) {
|
|
|
17580
17580
|
const info = PALACES[p3];
|
|
17581
17581
|
return {
|
|
17582
17582
|
system: 'xiaoliuren',
|
|
17583
|
-
|
|
17583
|
+
// question 放在顶层,不放进 meta:句柄按设计不收 question(它不影响盘面),
|
|
17584
|
+
// 放进 meta 会让「句柄回放」与「原始调用」的 meta 不一致(回放后变 null),
|
|
17585
|
+
// 看起来像盘变了。其余体系也都是把 question 挂顶层。
|
|
17586
|
+
meta: { mode: mode === 'time' ? '时间起课' : '报数起课', originText },
|
|
17587
|
+
question: input.question || null,
|
|
17584
17588
|
steps: [p1, p2, p3],
|
|
17585
17589
|
result: { palace: p3, luck: info.luck, text: info.text },
|
|
17586
|
-
sources: ['
|
|
17590
|
+
sources: ['掌诀口径:通行马前口诀(白话提炼,非原文照录)'],
|
|
17587
17591
|
disclaimer: '小六壬为轻量快占,属民俗娱乐参考;重要事项请综合现实信息判断。',
|
|
17588
17592
|
};
|
|
17589
17593
|
}
|
|
@@ -22451,7 +22455,12 @@ function baziInterpret(r) {
|
|
|
22451
22455
|
const jiaoLine = r.dayun && r.dayun.jiao && r.dayun.jiao.at
|
|
22452
22456
|
? `起运交运时刻 ${r.dayun.jiao.at}(${r.dayun.jiao.frame};三日折一年,距${r.dayun.jiao.from.name} ${r.dayun.jiao.spanDays} 天)。每步大运在同月同日同时刻换,逐年日期见下方大运表「交运」列。\n`
|
|
22453
22457
|
: '';
|
|
22454
|
-
|
|
22458
|
+
// 精确起运岁:与「几岁几个月」的口语写法并列。对上第三方排盘时差的就是日、时这两位。
|
|
22459
|
+
const sae = r.dayun && r.dayun.startAgeExact;
|
|
22460
|
+
const exactLine = sae && Number.isInteger(sae.years)
|
|
22461
|
+
? `起运岁精确值:${sae.years} 年 ${sae.months} 个月 ${sae.days} 天 ${sae.hours} 小时(${sae.caliber})。与摘要「${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月」同源:后者四舍五入到月,差一个月的边界常出在这里——第三方给到日/时的,按这一行核对。\n`
|
|
22462
|
+
: '';
|
|
22463
|
+
return `${jiaoLine}${exactLine}当前大运:${pick(cur, 'ganzhi', '—')}(${curSpan})。后续两步:${nextTwo}。\n近五年流年:${years || '—'}。\n读法:大运管"这十年的大环境",流年管"今年的具体天气";两者打架时,以能否动到用神为准。`;
|
|
22455
22464
|
})(),
|
|
22456
22465
|
},
|
|
22457
22466
|
{ key: 'years', label: '流年时间轴', text: yearsText },
|
|
@@ -22538,6 +22547,33 @@ function baziInterpret(r) {
|
|
|
22538
22547
|
key: 'xianshen', label: '闲神',
|
|
22539
22548
|
text: `【${frame.xianshen.level}】${frame.xianshen.detail}\n口径:${frame.xianshen.method}`,
|
|
22540
22549
|
}] : []),
|
|
22550
|
+
// 八大地支结构:与旺衰分并列的第二套静态视图。算出来却没人看得见的字段等于没做,
|
|
22551
|
+
// 所以这里单独给一节,写清「它是什么、跟上面旺衰分的区别、能不能据此断从格」。
|
|
22552
|
+
...(r.strength && r.strength.branchStructure ? [{
|
|
22553
|
+
key: 'structure', label: '地支结构',
|
|
22554
|
+
text: (() => {
|
|
22555
|
+
const b = r.strength.branchStructure;
|
|
22556
|
+
const cols = b.branches.map((x) => `${x.label}支${x.branch}(${x.support}·${x.camp} 档 ${x.weight} 分${b.placeholderHour && x.key === 'hour' ? '·占位' : ''})`).join(';');
|
|
22557
|
+
const odd = b.odd && b.odd.length ? `异类:${b.odd.map((x) => `${x.label}支${x.branch}(${x.weight} 分)`).join('、')}。` : '四支二对二或同党,无异类。';
|
|
22558
|
+
const bal = b.balance || {};
|
|
22559
|
+
return `【${b.code}】${b.detail}\n`
|
|
22560
|
+
+ `逐支:${cols}\n`
|
|
22561
|
+
+ `${odd}${b.halfSupported && b.halfSupported.length ? `半得地:${b.halfSupported.join('、')}(按 0.2–0.5 折算,不计入身强阵营)。` : ''}\n`
|
|
22562
|
+
+ `地支 身强 ${bal.branch ? bal.branch.A : '—'} : 身弱 ${bal.branch ? bal.branch.B : '—'},加天干后 ${bal.total ? `${bal.total.A}:${bal.total.B}` : '—'}(宫位权重年 11 / 月 36 / 日 27 / 时 16)。\n`
|
|
22563
|
+
+ `${b.word}${b.congProb != null ? `——静态从格概率 ${b.congRange}。` : '。'}\n`
|
|
22564
|
+
+ `口径:${b.method}\n`
|
|
22565
|
+
+ `与「日主强弱」的关系:这是并列的第二套静态视图,不改上面的旺衰评分,也不参与取格与喜忌——两者是同一组四支的两种读法,不是先后两步。\n`
|
|
22566
|
+
+ `边界:${b.note}`;
|
|
22567
|
+
})(),
|
|
22568
|
+
}] : []),
|
|
22569
|
+
// 暗合:另列不并。这一条最容易被人当成「合」读进旺衰,所以把边界写在节里。
|
|
22570
|
+
...(r.relations && Array.isArray(r.relations.anhe) && r.relations.anhe.length ? [{
|
|
22571
|
+
key: 'anhe', label: '暗合',
|
|
22572
|
+
text: `${r.relations.anhe.join('\n')}\n`
|
|
22573
|
+
+ `口径:${r.relations.anheNote || '暗合只作取象,不参与旺衰与格局。'}\n`
|
|
22574
|
+
+ `边界:暗合与上面的「地支关系」(三合、三会、六合、六冲、刑、害)是两条线,本插件不把它们合并计分;`
|
|
22575
|
+
+ `${r.relations.anhe.length === 1 ? '本盘只出现一对,按课里口径可以直接忽略。' : `本盘共 ${r.relations.anhe.length} 对,可作取象参考,但仍不折旺衰。`}`,
|
|
22576
|
+
}] : []),
|
|
22541
22577
|
(() => {
|
|
22542
22578
|
const ss = r.shensha;
|
|
22543
22579
|
const cols = { year: '年', month: '月', day: '日', hour: '时' };
|
|
@@ -27159,6 +27195,13 @@ function baziText(r) {
|
|
|
27159
27195
|
const jiao = r.dayun.jiao && r.dayun.jiao.at
|
|
27160
27196
|
? `;交运 ${r.dayun.jiao.at}(${r.dayun.jiao.frame},距${r.dayun.jiao.from.name} ${r.dayun.jiao.spanDays} 天,三日折一年)`
|
|
27161
27197
|
: '';
|
|
27198
|
+
// 起运岁精确值(截断到年月日时):上面 startAge 是四舍五入到月的口语写法,两者同源、并列给出。
|
|
27199
|
+
// 第三方对拍里截断到月 23/23 全中、四舍五入只有 15/23——差别就在这串日时上,所以必须看得见。
|
|
27200
|
+
const sae = r.dayun.startAgeExact;
|
|
27201
|
+
const startAgeExactLine = sae && Number.isInteger(sae.years)
|
|
27202
|
+
? `起运岁(精确):${sae.years} 年 ${sae.months} 个月 ${sae.days} 天 ${sae.hours} 小时`
|
|
27203
|
+
+ `(${sae.caliber};上面「${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月」是四舍五入到月,两者同源)`
|
|
27204
|
+
: '';
|
|
27162
27205
|
// 阈值 20 分钟:与 NAOJ 历要项对拍实测,本引擎节气最多偏早 13.5 分钟(Meeus 低精度上限约 14 分钟)
|
|
27163
27206
|
const near = r.jieqi.nearBoundaryMinutes < 20
|
|
27164
27207
|
? `\n⚠ 出生时刻距「节」仅 ${r.jieqi.nearBoundaryMinutes} 分钟,而节气时刻本身有最多约 14 分钟的偏差,月柱与年柱建议人工复核。`
|
|
@@ -27191,6 +27234,22 @@ function baziText(r) {
|
|
|
27191
27234
|
(r.frame.yongshen.qt ? ` 穷通:${r.frame.yongshen.qt.month}${r.frame.yongshen.qt.stem}取${r.frame.yongshen.qt.yong.join('、')}(首取${r.frame.yongshen.qt.primary})` : ''),
|
|
27192
27235
|
`十神权重:${Object.entries(r.frame.godStats.groups).map(([k, v]) => `${k}${v}`).join(' ')}`,
|
|
27193
27236
|
] : [];
|
|
27237
|
+
// 八大地支结构(炳祥课静态口径):算得出但没有输出通道的字段等于没做,这里补一行摘要。
|
|
27238
|
+
// 只报「哪几支成党、异类是哪支、静态从格概率」,与上面旺衰分是两套并列口径,不互相覆盖。
|
|
27239
|
+
// 三柱模式第四支是正午占位:照实标「占位」,不把它说成实有的时支。
|
|
27240
|
+
const bs = r.strength && r.strength.branchStructure;
|
|
27241
|
+
const bsCols = bs ? bs.branches.map((b) => `${b.label}${b.branch}${b.camp}${bs.placeholderHour && b.key === 'hour' ? '·占位' : ''}`).join('、') : '';
|
|
27242
|
+
// 注意 bs.word 本身已含三柱说明(bazi.js 的 hourUnknown 分支会改写它),这里不重复追加
|
|
27243
|
+
const bsTail = bs && !bs.placeholderHour && !bs.complete ? ' 时柱暂缺,只列三支' : '';
|
|
27244
|
+
const branchStructureLine = bs
|
|
27245
|
+
? `地支结构:${bs.placeholderHour ? '三支+占位' : '四支'} ${bs.code}(${bsCols}) `
|
|
27246
|
+
+ `${bs.word}${bs.congProb != null ? `(静态从格 ${bs.congRange})` : ''}${bsTail}`
|
|
27247
|
+
: '';
|
|
27248
|
+
// 暗合:另列不并入合冲刑害。只出现一对时按课里口径「可忽略」,所以照实写出来但不升级为断语。
|
|
27249
|
+
const anhe = (r.relations && Array.isArray(r.relations.anhe)) ? r.relations.anhe : [];
|
|
27250
|
+
const anheLine = anhe.length
|
|
27251
|
+
? `暗合:${anhe.join(' ')}(另列,不并入上面的合冲刑害;${anhe.length === 1 ? '只一对,按口径可忽略' : `共 ${anhe.length} 对`})`
|
|
27252
|
+
: '';
|
|
27194
27253
|
const hourMissing = r.hourUnknown === true || !P.hour;
|
|
27195
27254
|
return [
|
|
27196
27255
|
`【四柱】${P.year.ganzhi} ${P.month.ganzhi} ${P.day.ganzhi}${P.hour ? ` ${P.hour.ganzhi}` : '(时柱暂缺)'}`,
|
|
@@ -27200,14 +27259,17 @@ function baziText(r) {
|
|
|
27200
27259
|
`五行:${wuxing}`,
|
|
27201
27260
|
...(palaces ? [palaces] : []),
|
|
27202
27261
|
`日主强弱:${r.strength.level}(${r.strength.score}) ${r.strength.detail}`,
|
|
27262
|
+
...(branchStructureLine ? [branchStructureLine] : []),
|
|
27203
27263
|
...gejuLine,
|
|
27204
27264
|
`天干关系:${(r.relations && r.relations.stems.length) ? r.relations.stems.join(' ') : '—'}`,
|
|
27205
27265
|
`地支关系:${(r.relations && r.relations.branches.length) ? r.relations.branches.join(' ') : '—'}`,
|
|
27266
|
+
...(anheLine ? [anheLine] : []),
|
|
27206
27267
|
shenshaLine,
|
|
27207
27268
|
`真太阳时:${r.solarTime.trueSolarText}(${r.input.geo ? r.input.geo.note + ';' : ''}${r.solarTime.note}) 晚子时:${r.input.lateZi ? '23:00 后算次日' : '23:00 后仍算当日'}`,
|
|
27208
27269
|
`节气:上一节 ${r.jieqi.previous.name} ${r.jieqi.previous.time} 下一节 ${r.jieqi.next.name} ${r.jieqi.next.time}`,
|
|
27209
27270
|
...(renyuanLine ? [renyuanLine] : []),
|
|
27210
27271
|
`大运:${r.dayun.rule}(${r.dayun.direction}),${r.dayun.startAge.years}岁${r.dayun.startAge.months}个月起运${jiao}`,
|
|
27272
|
+
...(startAgeExactLine ? [startAgeExactLine] : []),
|
|
27211
27273
|
` ${dayun}`,
|
|
27212
27274
|
`流年:${r.liunian.slice(0, 10).map((l) => `${l.year}${l.ganzhi}(${l.stemTenGod})${l.luck ? `·${l.luck.tier}` : ''}`).join(' ')}`,
|
|
27213
27275
|
(() => {
|
|
@@ -28834,8 +28896,10 @@ function chengguText(r) {
|
|
|
28834
28896
|
|
|
28835
28897
|
/** 小六壬文本 */
|
|
28836
28898
|
function xiaoliurenText(r) {
|
|
28899
|
+
// 所问从顶层读(引擎把 question 挂顶层,不进 meta——meta 要能被句柄完整复现)
|
|
28900
|
+
const q = r.question || (r.meta && r.meta.question) || null;
|
|
28837
28901
|
return [
|
|
28838
|
-
`【小六壬·${r.meta.mode}】${
|
|
28902
|
+
`【小六壬·${r.meta.mode}】${q ? `所问:${q}` : ''}`,
|
|
28839
28903
|
r.meta.originText,
|
|
28840
28904
|
`落宫:${r.steps.join(' → ')}`,
|
|
28841
28905
|
`断语:${r.result.palace}(${r.result.luck}) ${r.result.text}`,
|
|
@@ -29135,7 +29199,7 @@ return { interpret, DIRECTIONS, DIRECTION_DEFAULT, BRIGHTNESS, flowOf, parseDate
|
|
|
29135
29199
|
})();
|
|
29136
29200
|
|
|
29137
29201
|
window.Engine = __mods.index;
|
|
29138
|
-
window.__MP_VER = "0.
|
|
29202
|
+
window.__MP_VER = "0.63.0";
|
|
29139
29203
|
</script>
|
|
29140
29204
|
<script>
|
|
29141
29205
|
// 两个 UI 共用的表单规则:宿主面板(src/app.js)与独立页(src/web-ui.js)。
|
|
@@ -29251,16 +29315,22 @@ window.__MP_VER = "0.62.5";
|
|
|
29251
29315
|
--line:#c8c1b2;--dimline:#b9b2a4;--hair:#e9e2d3;
|
|
29252
29316
|
/* 底色略沉作「桌面」,--card 跳到近白:原先 bg 与 card 只差 1/255,卡片感等于零。
|
|
29253
29317
|
同一色相里塞 9 个几乎相等的浅色,谁都浮不起来。 */
|
|
29254
|
-
--
|
|
29255
|
-
--
|
|
29256
|
-
--
|
|
29257
|
-
--
|
|
29318
|
+
/* 水墨风:宣纸白为底、淡墨分层;米黄系整体降饱和,纸感靠 --band 的微暖留一点 */
|
|
29319
|
+
--bg:#f4f2ec;--card:#fdfdfb;--band:#f7f5ef;--hover:#eeece5;--hover2:#e6e4dc;
|
|
29320
|
+
--tri:#eef0ea;--soul:#f7ece9;--sel:#f5efe9;--link:#f0efe9;
|
|
29321
|
+
--red:#a02c26;--red-rgb:160,44,38;--lu:#3d5a52;--lu-rgb:61,90,82;
|
|
29322
|
+
--quan:#6e5a2e;--quan-rgb:110,90,46;--ke:#3a5568;--ke-rgb:58,85,104;--ji:#a02c26;
|
|
29258
29323
|
--br-good:#4c7a5c;--br-bad:#9c5b56;--on-accent:#fff;--wx-metal:#8a6b1f;
|
|
29259
|
-
--tg-bi:#
|
|
29324
|
+
--tg-bi:#4e5d6b;--tg-shi:#55685c;--tg-cai:#6e5a2e;--tg-guan:#8a4a42;--tg-yin:#5d5570;
|
|
29260
29325
|
/* 之前 mp-cli / mp-qt / mp-cl / 起名卡里引用了 --ink3、--fx、--sans,却从未定义:
|
|
29261
29326
|
var() 取不到值 → 整条声明作废,字色与字形全靠继承,楷体、弱化灰都成了摆设。 */
|
|
29262
29327
|
--ink3:#8a8378;--fx:"Kaiti SC",KaiTi,"STKaiti","Songti SC",serif;--sans:system-ui,-apple-system,"Microsoft YaHei",sans-serif;--kai:"Kaiti SC",KaiTi,"STKaiti",serif;
|
|
29263
|
-
--shadow:0 1px 2px rgba(35,28,18,.05),0 18px 40px -30px rgba(35,28,18,.42)
|
|
29328
|
+
--shadow:0 1px 2px rgba(35,28,18,.05),0 18px 40px -30px rgba(35,28,18,.42),
|
|
29329
|
+
/* 动效与圆角令牌:全站同一节奏(借鉴 wallpaper-engine 的 --we-dur/--we-ease 约定),
|
|
29330
|
+
reduced-motion 时整体关停,见文件尾的全局 @media。 */
|
|
29331
|
+
--dur:150ms;--dur-fast:100ms;--ease:cubic-bezier(.32,.72,.24,1);
|
|
29332
|
+
--r-sm:6px;--r-md:10px;--r-lg:14px;
|
|
29333
|
+
--glow:0 0 0 1px rgba(var(--lu-rgb),.25),0 0 12px rgba(var(--lu-rgb),.12)}
|
|
29264
29334
|
/* 变量与 .mp-it 共享 —— 「解析与详解」是 .pp 的兄弟节点、不在 .pp 内部,
|
|
29265
29335
|
变量只挂在 .pp 上时它拿不到 --card/--muted/--red,头部底色会变透明、边框会退回黑色。 */
|
|
29266
29336
|
.pp{border:1px solid var(--line);background:var(--bg);color:var(--ink);font-family:"Songti SC","SimSun","Microsoft YaHei",serif;font-size:12.5px;line-height:1.55;
|
|
@@ -29271,31 +29341,45 @@ window.__MP_VER = "0.62.5";
|
|
|
29271
29341
|
.pp,.mp-it,.mp-al,.mp-cg,.mp-cl,.mp-cli,.mp-kline,.mp-mb,.mp-mb-paper,.mp-nm,.mp-quick,.mp-cdiff,.mp-shadow,.mp-trace-card,.mp-trace-layer,.mp-prof{--ink:#eae5d9;--ink2:#d5cfc2;--muted:#aca598;--label:#a49c8e;--faint:#928b7e;
|
|
29272
29342
|
--line:#514a3e;--dimline:#5f5849;--hair:#2f2b23;
|
|
29273
29343
|
/* 与浅色同理:底更沉、卡片更亮,让层级在深底上也能立起来 */
|
|
29274
|
-
|
|
29275
|
-
--
|
|
29276
|
-
--
|
|
29277
|
-
--
|
|
29344
|
+
/* 暗色水墨:墨底宣纸灰字,降暖提灰 */
|
|
29345
|
+
--bg:#131311;--card:#1f1f1c;--band:#26261f;--hover:#2c2c26;--hover2:#35352c;
|
|
29346
|
+
--tri:#2a2e28;--soul:#332521;--sel:#322d27;--link:#2c2b25;
|
|
29347
|
+
--red:#e08a7a;--red-rgb:224,138,122;--lu:#8fb8a8;--lu-rgb:143,184,168;
|
|
29348
|
+
--quan:#c9a96a;--quan-rgb:201,169,106;--ke:#8aadc0;--ke-rgb:138,173,192;--ji:#e08a7a;
|
|
29278
29349
|
--br-good:#79c79a;--br-bad:#e09a8c;--on-accent:#14130f;--wx-metal:#dcb273;
|
|
29279
29350
|
--tg-bi:#93b7cf;--tg-shi:#8fbb9d;--tg-cai:#d3ae62;--tg-guan:#d98d84;--tg-yin:#b4a4d0;
|
|
29280
|
-
--ink3:#8b8478
|
|
29351
|
+
--ink3:#8b8478;
|
|
29352
|
+
--dur:150ms;--dur-fast:100ms;--ease:cubic-bezier(.32,.72,.24,1);
|
|
29353
|
+
--r-sm:6px;--r-md:10px;--r-lg:14px;
|
|
29354
|
+
--glow:0 0 0 1px rgba(var(--lu-rgb),.3),0 0 14px rgba(var(--lu-rgb),.16);
|
|
29355
|
+
--shadow:0 1px 2px rgba(0,0,0,.5),0 18px 40px -30px rgba(0,0,0,.9)}
|
|
29281
29356
|
}
|
|
29282
29357
|
.pp *{box-sizing:border-box}
|
|
29283
29358
|
.pp-grid{display:grid;grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(4,minmax(150px,auto));gap:0;border:1px solid var(--line)}
|
|
29284
|
-
.pp-cell{border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:7px 8px;display:flex;flex-direction:column;position:relative;min-height:150px;background:var(--bg)
|
|
29359
|
+
.pp-cell{border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:7px 8px;display:flex;flex-direction:column;position:relative;min-height:150px;background:var(--bg);
|
|
29360
|
+
transition:background var(--dur) var(--ease),box-shadow var(--dur) var(--ease)}
|
|
29361
|
+
.pp-cell:hover,.pp-cell:focus-visible{background:var(--card);box-shadow:var(--glow);z-index:1}
|
|
29362
|
+
/* 命宫:双环选中态(借鉴 wallpaper-engine 色板的「发丝内环 + accent 外环」,比裸描边读得清) */
|
|
29363
|
+
.pp-soul{box-shadow:inset 0 0 0 2px rgba(var(--red-rgb),.35);background:linear-gradient(180deg,rgba(var(--red-rgb),.05),transparent 60%)}
|
|
29364
|
+
.pp-soul:hover,.pp-soul:focus-visible{background:var(--card);box-shadow:inset 0 0 0 2px rgba(var(--red-rgb),.4),var(--glow)}
|
|
29285
29365
|
/* 右边框按「视觉列」去,不能按 nth-child:格子用 grid-column 绝对定位,DOM 顺序不等于列序 */
|
|
29286
29366
|
.pp-cell.pp-lastcol{border-right:none}
|
|
29287
29367
|
.pp-cell.pp-lastrow{border-bottom:none}
|
|
29288
|
-
.pp-center{grid-column:2/4;grid-row:2/4;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;
|
|
29368
|
+
.pp-center{grid-column:2/4;grid-row:2/4;border-right:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 18px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;text-align:center;position:relative;
|
|
29369
|
+
background:var(--bg)}
|
|
29370
|
+
.pp-center::before{content:"";position:absolute;inset:12px 16px;border:1px solid var(--hair);border-radius:var(--r-md);pointer-events:none}
|
|
29371
|
+
.pp-center::after{content:"";position:absolute;inset:13px 17px;border:1px solid var(--line);border-radius:var(--r-md);opacity:.4;pointer-events:none}
|
|
29289
29372
|
.pp-center .ct-t1{font-size:17px;font-weight:700;letter-spacing:.05em;margin-bottom:6px}
|
|
29290
29373
|
.pp-center .ct-t2{font-size:12.5px;color:var(--ink)}
|
|
29291
29374
|
.pp-center .ct-t3{font-size:14px;letter-spacing:.35em;margin:6px 0;font-weight:600}
|
|
29292
29375
|
.pp-center .ct-t4{font-size:12.5px;color:var(--muted)}
|
|
29293
29376
|
.pp-stars{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:0 6px;font-size:13px;line-height:1.6;min-height:36px}
|
|
29294
29377
|
.pp-st{white-space:nowrap}
|
|
29295
|
-
.pp-st.main{font-weight:700}
|
|
29378
|
+
.pp-st.main{font-weight:700;font-size:13px;letter-spacing:.04em;text-shadow:0 0 .5px currentColor}
|
|
29296
29379
|
.pp-st.good{color:var(--lu)}
|
|
29297
29380
|
.pp-st.bad{color:var(--ji)}
|
|
29298
|
-
.pp-st.
|
|
29381
|
+
.pp-st.bad::before{content:"·";font-weight:900;margin-right:1px}
|
|
29382
|
+
.pp-st.aux{color:var(--muted);font-size:11.5px}
|
|
29299
29383
|
.pp-m{display:inline-block;font-style:normal;font-size:12px;line-height:1;padding:0 2px;border-radius:2px;color:var(--on-accent);margin-left:1px;vertical-align:1px}
|
|
29300
29384
|
.pp-m.lu{background:var(--lu)}.pp-m.quan{background:var(--quan)}.pp-m.ke{background:var(--ke)}.pp-m.ji{background:var(--ji)}
|
|
29301
29385
|
/* 大限/流年四化:只留色框不填充,与生年四化的实心块区分 */
|
|
@@ -29306,7 +29390,9 @@ window.__MP_VER = "0.62.5";
|
|
|
29306
29390
|
.pp-m.self.lu{color:var(--lu)}.pp-m.self.quan{color:var(--quan)}.pp-m.self.ke{color:var(--ke)}.pp-m.self.ji{color:var(--ji)}
|
|
29307
29391
|
/* 庙旺得利平不陷:星名后的等级小字。刻意压低视觉权重(灰为主、陷才微红),
|
|
29308
29392
|
避免与四化的实心彩色方块抢层次 */
|
|
29309
|
-
.pp-b{font-style:normal;font-size:
|
|
29393
|
+
.pp-b{font-style:normal;font-size:10px;margin-left:3px;padding:0 3px;border-radius:999px;color:var(--muted);letter-spacing:0;opacity:.92;background:var(--band)}
|
|
29394
|
+
.pp-b.good{color:var(--br-good)}
|
|
29395
|
+
.pp-b.bad{color:var(--br-bad)}
|
|
29310
29396
|
.pp-b.good{color:var(--br-good)}
|
|
29311
29397
|
.pp-b.mid{color:var(--muted)}
|
|
29312
29398
|
.pp-b.bad{color:var(--br-bad)}
|
|
@@ -29369,6 +29455,12 @@ window.__MP_VER = "0.62.5";
|
|
|
29369
29455
|
.pp-str{margin-top:10px;font-size:13px;line-height:1.8}
|
|
29370
29456
|
.pp-str b{color:var(--red);font-size:15px;margin:0 4px}
|
|
29371
29457
|
.pp-drel{font-style:normal;color:var(--red);font-size:12px}
|
|
29458
|
+
/* 八大地支结构:与日主强弱并列的第二套口径,用中性色,不与主结论抢色 */
|
|
29459
|
+
.pp-struct{margin-top:6px;font-size:12.5px;line-height:1.75;color:var(--ink2)}
|
|
29460
|
+
.pp-struct .pp-st-code{font-weight:700;letter-spacing:.06em;color:var(--ink);margin-right:6px}
|
|
29461
|
+
.pp-struct .pp-st-odd{color:var(--quan)}
|
|
29462
|
+
.pp-anhe{margin-top:6px;font-size:12.5px;line-height:1.75;color:var(--ink2)}
|
|
29463
|
+
.pp-anhe b{color:var(--muted);font-weight:400;margin-right:8px}
|
|
29372
29464
|
.pp-dim{color:var(--muted)}
|
|
29373
29465
|
/* 岁运提示下的原文:比正文再轻一档,只做出处,不抢结论 */
|
|
29374
29466
|
.pp-sy-src{margin-top:6px;font-size:11.5px;line-height:1.55}
|
|
@@ -29385,6 +29477,39 @@ window.__MP_VER = "0.62.5";
|
|
|
29385
29477
|
#ppm-ben:checked~.pp-modes label[for="ppm-ben"],#ppm-da:checked~.pp-modes label[for="ppm-da"],#ppm-ln:checked~.pp-modes label[for="ppm-ln"]{background:var(--red);color:var(--on-accent)}
|
|
29386
29478
|
.pp-tri{background:var(--tri)}
|
|
29387
29479
|
.pp-soul{background:var(--soul)}
|
|
29480
|
+
/* 三视图切换(学文墨天机:飞星/三合/四化)——真分派,不是同一张盘的显隐开关:
|
|
29481
|
+
四化派(默认):生年四化实心 + 大限/流年空心 + 自化 + 飞星链 chips;
|
|
29482
|
+
飞星派:每宫格内显示「宫干四化飞出」逐条(禄→某宫…),图例藏大限/流年四化;
|
|
29483
|
+
三合派:只看星曜庙旺与宫位结构,所有四化徽章(含生年)、自化、飞星链全部藏起。 */
|
|
29484
|
+
.pp-schools{border-top:none}
|
|
29485
|
+
.pp-schools label{min-height:38px;padding:2px 16px;font-size:12px}
|
|
29486
|
+
#ppm-sc-sihe:checked~.pp-schools label[for="ppm-sc-sihe"],
|
|
29487
|
+
#ppm-sc-feixing:checked~.pp-schools label[for="ppm-sc-feixing"],
|
|
29488
|
+
#ppm-sc-sanhe:checked~.pp-schools label[for="ppm-sc-sanhe"]{background:var(--lu);color:var(--on-accent)}
|
|
29489
|
+
/* 飞星派专属:宫内宫干四化行,只在飞星模式展开 */
|
|
29490
|
+
.pp-fx{display:none;margin-top:3px;font-size:10.5px;line-height:1.55;color:var(--muted);border-top:1px dashed var(--hair);padding-top:2px}
|
|
29491
|
+
.pp-fx i{font-style:normal;white-space:nowrap;margin-right:4px}
|
|
29492
|
+
.pp-fx i em{font-style:normal;color:var(--faint)}
|
|
29493
|
+
#ppm-sc-feixing:checked~.pp-body .pp-fx{display:block}
|
|
29494
|
+
#ppm-sc-feixing:checked~.pp-body .pp-m.view,
|
|
29495
|
+
#ppm-sc-feixing:checked~.pp-body .pp-viewhua{display:none}
|
|
29496
|
+
/* 三合派:四化信息整体退场(生年/自化/大限流年/图例/飞星链 chips) */
|
|
29497
|
+
#ppm-sc-sanhe:checked~.pp-body .pp-m,
|
|
29498
|
+
#ppm-sc-sanhe:checked~.pp-body .pp-zh,
|
|
29499
|
+
#ppm-sc-sanhe:checked~.pp-body .pp-viewhua,
|
|
29500
|
+
#ppm-sc-sanhe:checked~.pp-flywrap{display:none}
|
|
29501
|
+
#ppm-sc-sihe:checked~.pp-flywrap{display:block}
|
|
29502
|
+
#ppm-sc-feixing:checked~.pp-flywrap{display:block}
|
|
29503
|
+
/* 自化图示(文墨式图例行):箭头颜色跟四化色走 */
|
|
29504
|
+
.pp-zhlegend{display:flex;gap:10px;align-items:center;justify-content:center;font-size:12px;color:var(--muted);margin-top:4px}
|
|
29505
|
+
.pp-zhlegend i{font-style:normal;font-weight:600}
|
|
29506
|
+
.pp-zhlegend .z-lu{color:var(--lu)}.pp-zhlegend .z-quan{color:var(--quan)}
|
|
29507
|
+
.pp-zhlegend .z-ke{color:var(--ke)}.pp-zhlegend .z-ji{color:var(--ji)}
|
|
29508
|
+
/* 纸纹:feTurbulence 纤维噪点叠加在盘面底色上,浅色偏灰纤维、暗色同用(低透明度不抢字) */
|
|
29509
|
+
.pp-paper{position:relative}
|
|
29510
|
+
.pp::before{content:"";position:absolute;inset:0;pointer-events:none;z-index:0;opacity:.5;
|
|
29511
|
+
background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 0.32 0 0 0 0 0.29 0 0 0 0 0.24 0 0 0 0.10 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23p)'/%3E%3C/svg%3E")}
|
|
29512
|
+
.pp>*{position:relative;z-index:1}
|
|
29388
29513
|
.pp-zh{margin-left:4px;white-space:nowrap}
|
|
29389
29514
|
.pp-borrow{font-size:9.5px;color:var(--muted);margin-top:1px;letter-spacing:.02em}
|
|
29390
29515
|
|
|
@@ -29395,9 +29520,13 @@ window.__MP_VER = "0.62.5";
|
|
|
29395
29520
|
.pp-cell:hover{background:var(--hover)}
|
|
29396
29521
|
/* 键盘可达:宫格是 div+tabindex,焦点必须看得见(原先把 outline 关了却没补替代) */
|
|
29397
29522
|
.pp-cell:focus-visible{box-shadow:inset 0 0 0 2px var(--red)}
|
|
29398
|
-
.pp-cell.pp-sel{background:var(--sel);box-shadow:inset 0 0 0 2px rgba(var(--red-rgb),.
|
|
29523
|
+
.pp-cell.pp-sel{background:var(--sel);box-shadow:inset 0 0 0 2px rgba(var(--red-rgb),.55)}
|
|
29524
|
+
/* 三方四正虚线:ink 色细虚线,端点宫由 pp-sel/pp-link 底色呼应 */
|
|
29525
|
+
.pp-sf{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:2}
|
|
29526
|
+
.pp-sf line{stroke:var(--ink);stroke-width:1.2px;stroke-dasharray:3 2.4;opacity:.38;vector-effect:non-scaling-stroke}
|
|
29527
|
+
.pp-sf circle{fill:var(--ink);opacity:.45}
|
|
29399
29528
|
/* 选中宫的财帛/官禄/迁移三宫:能一眼看出命宫牵着哪几宫 */
|
|
29400
|
-
.pp-cell.pp-link{background:var(--link);box-shadow:inset 0 0 0 1.5px rgba(var(--red-rgb),.
|
|
29529
|
+
.pp-cell.pp-link{background:var(--link);box-shadow:inset 0 0 0 1.5px rgba(var(--red-rgb),.3)}
|
|
29401
29530
|
.pp-detail{display:none;border-top:1px solid var(--line);background:var(--card);padding:11px 14px 13px;font-family:system-ui,sans-serif}
|
|
29402
29531
|
.pp-detail.open{display:block}
|
|
29403
29532
|
.pp-detail .dt-dh{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;padding-bottom:6px;margin-bottom:7px;border-bottom:1px dashed var(--line)}
|
|
@@ -30590,6 +30719,16 @@ window.__MP_VER = "0.62.5";
|
|
|
30590
30719
|
.mp-prof-bar button.ghost{background:transparent;color:var(--muted);border-color:var(--line)}
|
|
30591
30720
|
.mp-prof-bar .mp-prof-tip{font-size:11.5px;color:var(--muted)}
|
|
30592
30721
|
@media (max-width:360px){.mp-prof-list{grid-template-columns:repeat(auto-fill,minmax(140px,1fr))}}
|
|
30722
|
+
|
|
30723
|
+
/* 减少动态效果偏好:本面板所有过渡一律退化为即时(不覆盖用户系统设置) */
|
|
30724
|
+
@media (prefers-reduced-motion: reduce){
|
|
30725
|
+
.pp *,.mp-it *,.mp-al *,.mp-btn,.mp-chip{transition:none!important;animation:none!important}
|
|
30726
|
+
}
|
|
30727
|
+
/* 大表行 hover:只提底色不加位移,行高稳定不被打断 */
|
|
30728
|
+
.pp table tbody tr{transition:background var(--dur-fast) var(--ease)}
|
|
30729
|
+
.pp table tbody tr:hover{background:var(--hover)}
|
|
30730
|
+
/* 结果卡阴影分层:默认最轻,hover 时浮起一档(只对可交互的卡,避免整页抖动) */
|
|
30731
|
+
.pp{transition:box-shadow var(--dur) var(--ease)}
|
|
30593
30732
|
`;
|
|
30594
30733
|
const pp = (window.__PP = window.__PP || {});
|
|
30595
30734
|
pp.CSS = CSS;
|
|
@@ -30691,7 +30830,7 @@ window.__MP_VER = "0.62.5";
|
|
|
30691
30830
|
const fx = (n) => ((n % 12) + 12) % 12;
|
|
30692
30831
|
const isTrine = (b, m) => b !== m && [fx(m + 4), fx(m + 8), fx(m + 6)].includes(b);
|
|
30693
30832
|
|
|
30694
|
-
function cellHTML(p, soulIdx, view, allPalaces, viewHua) {
|
|
30833
|
+
function cellHTML(p, soulIdx, view, allPalaces, viewHua, flyByBranch) {
|
|
30695
30834
|
const pos = POS[p.branch] || [1, 1];
|
|
30696
30835
|
const b = BR.indexOf(p.branch);
|
|
30697
30836
|
const cls = ['pp-cell'];
|
|
@@ -30720,6 +30859,7 @@ window.__MP_VER = "0.62.5";
|
|
|
30720
30859
|
<div class="pp-stars">${starsHTML(p.stars, viewHua)}${zh}</div>
|
|
30721
30860
|
${borrow}
|
|
30722
30861
|
<div class="pp-ages">${agesHTML(p.xiaoxian.age)}</div>
|
|
30862
|
+
${fxLineHTML(p, flyByBranch)}
|
|
30723
30863
|
<div class="pp-foot">
|
|
30724
30864
|
<div class="ft-l">
|
|
30725
30865
|
<span class="ft-dx">${ss.boshi} ${p.daxian.start}-${p.daxian.end}</span>
|
|
@@ -30735,6 +30875,15 @@ window.__MP_VER = "0.62.5";
|
|
|
30735
30875
|
</div>`;
|
|
30736
30876
|
}
|
|
30737
30877
|
|
|
30878
|
+
/* 飞星派专属:本宫宫干四化飞到哪一宫,逐条摊在宫格内(只此模式展开,CSS 控显隐)。
|
|
30879
|
+
宫数据不带 mutagenHits,从 r.daxianList 借:同一宫干,飞化等价。 */
|
|
30880
|
+
function fxLineHTML(p, flyByBranch) {
|
|
30881
|
+
const hits = (flyByBranch && flyByBranch[p.branch]) || [];
|
|
30882
|
+
if (!hits.length) return '';
|
|
30883
|
+
const items = hits.map((m) => `<i class="${MUT[m.type] || ''}" title="${esc(m.star)}化${esc(m.type)}">${esc(m.type)}<em>→${esc(m.palace || '未上盘')}</em></i>`).join('');
|
|
30884
|
+
return `<div class="pp-fx">${esc(p.ganzhi)}宫干 ${items}</div>`;
|
|
30885
|
+
}
|
|
30886
|
+
|
|
30738
30887
|
function sizhuOf(r) {
|
|
30739
30888
|
try {
|
|
30740
30889
|
const E = window.Engine || (window.__PP && window.__PP.Engine);
|
|
@@ -30765,7 +30914,9 @@ window.__MP_VER = "0.62.5";
|
|
|
30765
30914
|
const dxObj = (r.daxianList || []).find((d) => d.branch === dxPalace.branch) || null;
|
|
30766
30915
|
const huaByView = { da: huaMap(dxObj && dxObj.mutagenHits), ln: huaMap(ln && ln.mutagenHits) };
|
|
30767
30916
|
|
|
30768
|
-
const
|
|
30917
|
+
const flyByBranch = {};
|
|
30918
|
+
for (const d of r.daxianList || []) flyByBranch[d.branch] = d.mutagenHits || [];
|
|
30919
|
+
const grid = (m, kind) => r.palaces.map((p) => cellHTML(p, m, kind, r.palaces, huaByView[kind] || null, flyByBranch)).join('');
|
|
30769
30920
|
const center = (m, kind) => {
|
|
30770
30921
|
const mode = kind === 'da'
|
|
30771
30922
|
? `<div class="ct-t1">大限 ${dxPalace.ganzhi} ${dxPalace.daxian.start}-${dxPalace.daxian.end}岁</div>`
|
|
@@ -30863,14 +31014,22 @@ window.__MP_VER = "0.62.5";
|
|
|
30863
31014
|
<input type="radio" name="ppm" id="ppm-ben" class="pp-r" checked>
|
|
30864
31015
|
<input type="radio" name="ppm" id="ppm-da" class="pp-r">
|
|
30865
31016
|
<input type="radio" name="ppm" id="ppm-ln" class="pp-r">
|
|
31017
|
+
<input type="radio" name="ppm-sc" id="ppm-sc-sihe" class="pp-r" checked>
|
|
31018
|
+
<input type="radio" name="ppm-sc" id="ppm-sc-feixing" class="pp-r">
|
|
31019
|
+
<input type="radio" name="ppm-sc" id="ppm-sc-sanhe" class="pp-r">
|
|
30866
31020
|
<div class="pp-modes">
|
|
30867
31021
|
<label for="ppm-ben">本命</label><label for="ppm-da">大限</label><label for="ppm-ln">流年</label>
|
|
30868
31022
|
<span class="pp-soon">点任一宫位看详情</span>
|
|
30869
31023
|
</div>
|
|
31024
|
+
<div class="pp-modes pp-schools">
|
|
31025
|
+
<label for="ppm-sc-sihe">四化</label><label for="ppm-sc-feixing">飞星</label><label for="ppm-sc-sanhe">三合</label>
|
|
31026
|
+
</div>
|
|
30870
31027
|
${body('ben', soulIdx, 'ben')}
|
|
30871
31028
|
${body('da', dxIdx, 'da')}
|
|
30872
31029
|
${body('ln', lnIdx, 'ln')}
|
|
30873
|
-
|
|
31030
|
+
<div class="pp-zhlegend">自化图示 <i class="z-lu">→禄</i><i class="z-quan">→权</i><i class="z-ke">→科</i><i class="z-ji">→忌</i></div>
|
|
31031
|
+
<div class="pp-flywrap">${flyHTML}${flyCompositeHTML}</div>
|
|
31032
|
+
</div>${flowHTML}${chips}${pats}${dxs}${lnHit}${zyHTML}`;
|
|
30874
31033
|
};
|
|
30875
31034
|
|
|
30876
31035
|
// ── 宫位详情 ────────────────────────────────────────────────
|
|
@@ -30945,6 +31104,69 @@ window.__MP_VER = "0.62.5";
|
|
|
30945
31104
|
body.querySelectorAll('.pp-cell[aria-expanded="true"]').forEach((c) => c.setAttribute('aria-expanded', 'false'));
|
|
30946
31105
|
}
|
|
30947
31106
|
|
|
31107
|
+
/* 三方四正连线(文墨天机式):点击宫位后,把本宫—对宫—财帛—官禄四点连成虚线。
|
|
31108
|
+
实现是纯 SVG overlay:绝对定位在 .pp-body 里、pointer-events:none 不挡点击,
|
|
31109
|
+
线段端点由宫位格在 grid 上的行列号换算成百分比坐标,窗口缩放自动跟随。 */
|
|
31110
|
+
const SF_POS = { /* 与十二宫 POS 同构:地支 → [row, col](1-based,含中宫 2/3) */ };
|
|
31111
|
+
function drawSanfang(body, pi) {
|
|
31112
|
+
clearSanfang(body);
|
|
31113
|
+
const grid = body.querySelector('.pp-grid');
|
|
31114
|
+
if (!grid) return;
|
|
31115
|
+
const targets = [pi, (pi + 6) % 12, (pi + 4) % 12, (pi + 8) % 12];
|
|
31116
|
+
/* 文墨式连线:线只走中宫,不穿周边宫位。
|
|
31117
|
+
每个宫往中宫一侧的「边中点」取锚:上排宫取下边中点、下排宫取上边中点,
|
|
31118
|
+
左列宫取右边中点、右列宫取左边中点。中宫占 col 2~3 / row 2~3(即 25%~75%),
|
|
31119
|
+
锚点恰好落在中宫边界上,折线自然被中宫「接住」。 */
|
|
31120
|
+
const anchorOf = (b) => {
|
|
31121
|
+
const cell = body.querySelector('.pp-cell[data-pi="' + b + '"]');
|
|
31122
|
+
if (!cell) return null;
|
|
31123
|
+
const r = Number(cell.style.gridRow), c = Number(cell.style.gridColumn);
|
|
31124
|
+
/* 锚点 = 该宫「朝中宫的那条竖边」上的点:
|
|
31125
|
+
x 永远落在中宫边界(25 或 75),y 取该宫行的中心。
|
|
31126
|
+
这样线段从中宫边界出发,全部活动范围被限制在中宫矩形内,
|
|
31127
|
+
不会横穿左右两侧的宫位(文墨的线也只在中间那块动)。 */
|
|
31128
|
+
// 左右两列宫:x 取中宫左右边界,y 取该宫行的中心(row 2/3 → y 37.5/62.5,都在中宫内)
|
|
31129
|
+
// 上排/下排的角宫(row 1/4)按所属左右列同样处理——y 可能越界,
|
|
31130
|
+
// 所以统一把 y 压回中宫范围(25~75 的 1/4、3/4 分位)。
|
|
31131
|
+
const yy = Math.min(75, Math.max(25, (r - 0.5) * 25));
|
|
31132
|
+
if (c === 1) return [25, yy];
|
|
31133
|
+
return [75, yy];
|
|
31134
|
+
};
|
|
31135
|
+
const pts = targets.map(anchorOf);
|
|
31136
|
+
if (pts.some((x) => !x)) return;
|
|
31137
|
+
const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
31138
|
+
svg.setAttribute("class", "pp-sf");
|
|
31139
|
+
svg.setAttribute("viewBox", "0 0 100 100");
|
|
31140
|
+
svg.setAttribute("preserveAspectRatio", "none");
|
|
31141
|
+
const mk = (x1, y1, x2, y2) => {
|
|
31142
|
+
const l = document.createElementNS("http://www.w3.org/2000/svg", "line");
|
|
31143
|
+
l.setAttribute("x1", x1); l.setAttribute("y1", y1);
|
|
31144
|
+
l.setAttribute("x2", x2); l.setAttribute("y2", y2);
|
|
31145
|
+
svg.appendChild(l);
|
|
31146
|
+
};
|
|
31147
|
+
/* 文墨的三角/菱形画法:四个锚点首尾相连成闭环——
|
|
31148
|
+
本宫 → 对宫(对角线,过中心)→ 三合1 → 三合2 → 回本宫。
|
|
31149
|
+
两条对角交叉线 + 两条边线,落在中宫的形状就是一个斜菱形,
|
|
31150
|
+
视觉上与文墨天机的三角形连线一致。 */
|
|
31151
|
+
mk(pts[0][0], pts[0][1], pts[1][0], pts[1][1]);
|
|
31152
|
+
mk(pts[1][0], pts[1][1], pts[2][0], pts[2][1]);
|
|
31153
|
+
mk(pts[2][0], pts[2][1], pts[3][0], pts[3][1]);
|
|
31154
|
+
mk(pts[3][0], pts[3][1], pts[0][0], pts[0][1]);
|
|
31155
|
+
// 端点小圆点:本宫用实心红点,其余三方用墨点
|
|
31156
|
+
for (let i = 0; i < 4; i++) {
|
|
31157
|
+
const c = document.createElementNS("http://www.w3.org/2000/svg", "circle");
|
|
31158
|
+
c.setAttribute("cx", pts[i][0]); c.setAttribute("cy", pts[i][1]); c.setAttribute("r", i === 0 ? 0.9 : 0.7);
|
|
31159
|
+
if (i === 0) c.setAttribute("style", "fill:var(--red);opacity:.85");
|
|
31160
|
+
svg.appendChild(c);
|
|
31161
|
+
}
|
|
31162
|
+
grid.style.position = "relative";
|
|
31163
|
+
grid.appendChild(svg);
|
|
31164
|
+
}
|
|
31165
|
+
function clearSanfang(body) {
|
|
31166
|
+
const old = body.querySelector("svg.pp-sf");
|
|
31167
|
+
if (old) old.remove();
|
|
31168
|
+
}
|
|
31169
|
+
|
|
30948
31170
|
// 全局委托:面板与独立页都不需要额外初始化,panel-kit 一加载就生效
|
|
30949
31171
|
function bindZiwei() {
|
|
30950
31172
|
if (bindZiwei.done || typeof document === 'undefined' || !document.addEventListener) return;
|
|
@@ -30957,6 +31179,7 @@ window.__MP_VER = "0.62.5";
|
|
|
30957
31179
|
// 再点同一宫 → 收起
|
|
30958
31180
|
if (cell.classList.contains('pp-sel')) {
|
|
30959
31181
|
clearMarks(body);
|
|
31182
|
+
clearSanfang(body);
|
|
30960
31183
|
detail.classList.remove('open');
|
|
30961
31184
|
detail.innerHTML = '';
|
|
30962
31185
|
return;
|
|
@@ -30964,6 +31187,7 @@ window.__MP_VER = "0.62.5";
|
|
|
30964
31187
|
clearMarks(body);
|
|
30965
31188
|
const pi = Number(cell.dataset.pi);
|
|
30966
31189
|
const soulIdx = Number(body.dataset.soul);
|
|
31190
|
+
drawSanfang(body, pi);
|
|
30967
31191
|
const sel = body.querySelectorAll('.pp-cell');
|
|
30968
31192
|
sel.forEach((c) => {
|
|
30969
31193
|
const ci = Number(c.dataset.pi);
|
|
@@ -30980,6 +31204,7 @@ window.__MP_VER = "0.62.5";
|
|
|
30980
31204
|
const body = t.closest('.pp-body');
|
|
30981
31205
|
if (body) {
|
|
30982
31206
|
clearMarks(body);
|
|
31207
|
+
clearSanfang(body);
|
|
30983
31208
|
const d = body.querySelector('.pp-detail');
|
|
30984
31209
|
if (d) { d.classList.remove('open'); d.innerHTML = ''; }
|
|
30985
31210
|
return;
|
|
@@ -31991,6 +32216,25 @@ window.__MP_VER = "0.62.5";
|
|
|
31991
32216
|
const syRow = sy.length ? `<div class="pp-tl pp-dim">岁运提示(只标干支变动,不判吉凶)</div><div class="pp-chips">${sy.map((l) =>
|
|
31992
32217
|
`<span class="pp-chip" title="${esc(`${l.suiyun.signals.map((x) => x.detail).join(';')}|${l.suiyun.note || ''}`)}">${l.year} ${esc(l.suiyun.signals.map((x) => `${x.type}${(x.type.startsWith('流年') || x.type.startsWith('大运')) && x.target ? `·${x.target}` : ''}`).join('/'))}</span>`).join('')}</div>${sySrc}` : '';
|
|
31993
32218
|
const str = r.strength ? `<div class="pp-str">日主强弱:<b>${r.strength.level}</b>${r.strength.score} <span class="pp-dim">${r.strength.detail}</span></div>` : '';
|
|
32219
|
+
// 八大地支结构:只读标注,与上面旺衰分并列。算出来却没人看得见等于没做,所以面板必须给这一行。
|
|
32220
|
+
const bs = r.strength && r.strength.branchStructure;
|
|
32221
|
+
const structHTML = bs ? (() => {
|
|
32222
|
+
const cols = bs.branches.map((b) => `${esc(b.label)}${esc(b.branch)}<i class="pp-drel">·${esc(b.camp)}</i>${bs.placeholderHour && b.key === 'hour' ? '<span class="pp-dim">占位</span>' : ''}`).join(' ');
|
|
32223
|
+
const odd = bs.odd && bs.odd.length ? `<span class="pp-st-odd">异类 ${bs.odd.map((x) => `${esc(x.label)}${esc(x.branch)}(${x.weight}分)`).join('、')}</span>` : '<span class="pp-st-odd">无异类</span>';
|
|
32224
|
+
const prob = bs.congProb != null ? ` 从格 ${esc(bs.congRange)}` : ' 不套从格概率';
|
|
32225
|
+
const bal = bs.balance || {};
|
|
32226
|
+
const balText = bal.branch ? ` 支 ${bal.branch.A}:${bal.branch.B} 合干 ${bal.total ? `${bal.total.A}:${bal.total.B}` : '—'}` : '';
|
|
32227
|
+
return `<div class="pp-struct" title="${esc(`${bs.method};${bs.note}`)}">`
|
|
32228
|
+
+ `<span class="pp-st-code">${esc(bs.code)}</span>${cols} ${odd}${prob}${balText}`
|
|
32229
|
+
+ `<span class="pp-dim"> 静态结构,只作标注,不改上面的旺衰评分</span>`
|
|
32230
|
+
+ `</div>`;
|
|
32231
|
+
})() : '';
|
|
32232
|
+
// 暗合:另列不并。一对时照课里口径标「可忽略」,不让它看起来像有效合局。
|
|
32233
|
+
const anheList = (r.relations && Array.isArray(r.relations.anhe)) ? r.relations.anhe : [];
|
|
32234
|
+
const anheHTML = anheList.length
|
|
32235
|
+
? `<div class="pp-anhe" title="${esc(r.relations.anheNote || '')}"><b>暗合</b>${anheList.map((x) => esc(x)).join(' ')}`
|
|
32236
|
+
+ `<span class="pp-dim"> 另列,不并入上面的合冲刑害;${anheList.length === 1 ? '只一对,按口径可忽略' : `共 ${anheList.length} 对`}</span></div>`
|
|
32237
|
+
: '';
|
|
31994
32238
|
const ssGroups = (r.shensha && r.shensha.groups) || [];
|
|
31995
32239
|
const ssx = ssGroups.length ? `
|
|
31996
32240
|
<div class="pp-ssx">
|
|
@@ -32004,6 +32248,8 @@ window.__MP_VER = "0.62.5";
|
|
|
32004
32248
|
<div class="pp-rel"><div><b>天干</b>${(r.relations && r.relations.stems.length) ? r.relations.stems.join(' · ') : '—'}</div>
|
|
32005
32249
|
<div><b>地支</b>${(r.relations && r.relations.branches.length) ? r.relations.branches.join(' · ') : '—'}</div></div>
|
|
32006
32250
|
${str}
|
|
32251
|
+
${structHTML}
|
|
32252
|
+
${anheHTML}
|
|
32007
32253
|
${sect('格局', gj)}
|
|
32008
32254
|
${sect('用神', ys)}
|
|
32009
32255
|
${cliCard}
|
|
@@ -32026,7 +32272,8 @@ window.__MP_VER = "0.62.5";
|
|
|
32026
32272
|
${(!r.palaces.minggong || !r.palaces.shengong) ? '<span class="pp-chip" title="命宫与身宫由生月与生时支合数定宫;时柱暂缺,这两宫不排">命宫·身宫 时柱暂缺不排</span>' : ''}
|
|
32027
32273
|
</div>`) : ''}
|
|
32028
32274
|
${ssx}
|
|
32029
|
-
<div style="margin-top:8px;font-size:12px;color:var(--muted)">上一节 ${r.jieqi.previous.name} ${r.jieqi.previous.time} 下一节 ${r.jieqi.next.name} ${r.jieqi.next.time} ${r.dayun.rule},${r.dayun.startAge.years}岁起运${(r.dayun.jiao && r.dayun.jiao.at) ? `(交运 ${r.dayun.jiao.at},${r.dayun.jiao.frame})` : ''}
|
|
32275
|
+
<div style="margin-top:8px;font-size:12px;color:var(--muted)">上一节 ${r.jieqi.previous.name} ${r.jieqi.previous.time} 下一节 ${r.jieqi.next.name} ${r.jieqi.next.time} ${r.dayun.rule},${r.dayun.startAge.years}岁起运${(r.dayun.jiao && r.dayun.jiao.at) ? `(交运 ${r.dayun.jiao.at},${r.dayun.jiao.frame})` : ''}${(r.dayun.startAgeExact && Number.isInteger(r.dayun.startAgeExact.years))
|
|
32276
|
+
? ` 精确 ${r.dayun.startAgeExact.years}年${r.dayun.startAgeExact.months}月${r.dayun.startAgeExact.days}天${r.dayun.startAgeExact.hours}时(截断到日时;上面是四舍五入到月)` : ''}</div>
|
|
32030
32277
|
</div>`;
|
|
32031
32278
|
};
|
|
32032
32279
|
|