koishi-plugin-mcdle 0.1.5 → 0.2.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/README.md +31 -0
- package/lib/index.d.ts +1 -1
- package/lib/index.js +589 -226
- package/lib/m3.d.ts +256 -0
- package/lib/view.d.ts +0 -1
- package/package.json +1 -1
- package/readme.md +0 -52
package/lib/index.js
CHANGED
|
@@ -18,8 +18,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
|
|
20
20
|
// src/index.ts
|
|
21
|
-
var
|
|
22
|
-
__export(
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
23
|
Config: () => Config,
|
|
24
24
|
apply: () => apply,
|
|
25
25
|
canHandleMiddlewareGuess: () => canHandleMiddlewareGuess,
|
|
@@ -29,7 +29,7 @@ __export(index_exports, {
|
|
|
29
29
|
resolveMiddlewareSwitch: () => resolveMiddlewareSwitch,
|
|
30
30
|
usage: () => usage
|
|
31
31
|
});
|
|
32
|
-
module.exports = __toCommonJS(
|
|
32
|
+
module.exports = __toCommonJS(src_exports);
|
|
33
33
|
var import_koishi = require("koishi");
|
|
34
34
|
|
|
35
35
|
// src/data.ts
|
|
@@ -14621,7 +14621,355 @@ var itemChineseTitle = [
|
|
|
14621
14621
|
"铜粒"
|
|
14622
14622
|
];
|
|
14623
14623
|
|
|
14624
|
+
// src/m3.ts
|
|
14625
|
+
var WHITE_X = 95.047;
|
|
14626
|
+
var WHITE_Y = 100;
|
|
14627
|
+
var WHITE_Z = 108.883;
|
|
14628
|
+
function labToXyz(l, a, b) {
|
|
14629
|
+
const fy = (l + 16) / 116;
|
|
14630
|
+
const fx = fy + a / 500;
|
|
14631
|
+
const fz = fy - b / 200;
|
|
14632
|
+
const f = /* @__PURE__ */ __name((t) => t > 6 / 29 ? t * t * t : 3 * (6 / 29) ** 2 * (t - 4 / 29), "f");
|
|
14633
|
+
return [f(fx) * WHITE_X, f(fy) * WHITE_Y, f(fz) * WHITE_Z];
|
|
14634
|
+
}
|
|
14635
|
+
__name(labToXyz, "labToXyz");
|
|
14636
|
+
function gamma(value) {
|
|
14637
|
+
return value <= 31308e-7 ? value * 12.92 : 1.055 * value ** (1 / 2.4) - 0.055;
|
|
14638
|
+
}
|
|
14639
|
+
__name(gamma, "gamma");
|
|
14640
|
+
function xyzToRgb(x, y, z) {
|
|
14641
|
+
x /= 100;
|
|
14642
|
+
y /= 100;
|
|
14643
|
+
z /= 100;
|
|
14644
|
+
return [
|
|
14645
|
+
gamma(3.2406 * x - 1.5372 * y - 0.4986 * z),
|
|
14646
|
+
gamma(-0.9689 * x + 1.8758 * y + 0.0415 * z),
|
|
14647
|
+
gamma(0.0557 * x - 0.204 * y + 1.057 * z)
|
|
14648
|
+
];
|
|
14649
|
+
}
|
|
14650
|
+
__name(xyzToRgb, "xyzToRgb");
|
|
14651
|
+
var EPSILON = 1 / 512;
|
|
14652
|
+
function lch(tone, chroma, hue) {
|
|
14653
|
+
const radian = hue * Math.PI / 180;
|
|
14654
|
+
const at = /* @__PURE__ */ __name((c) => xyzToRgb(...labToXyz(tone, Math.cos(radian) * c, Math.sin(radian) * c)), "at");
|
|
14655
|
+
const inGamut = /* @__PURE__ */ __name((rgb2) => rgb2.every((value) => value >= -EPSILON && value <= 1 + EPSILON), "inGamut");
|
|
14656
|
+
let rgb = at(chroma);
|
|
14657
|
+
if (!inGamut(rgb)) {
|
|
14658
|
+
let low = 0;
|
|
14659
|
+
let high = chroma;
|
|
14660
|
+
while (high - low > 0.05) {
|
|
14661
|
+
const mid = (low + high) / 2;
|
|
14662
|
+
if (inGamut(at(mid))) low = mid;
|
|
14663
|
+
else high = mid;
|
|
14664
|
+
}
|
|
14665
|
+
rgb = at(low);
|
|
14666
|
+
}
|
|
14667
|
+
return "#" + rgb.map((value) => Math.round(Math.min(1, Math.max(0, value)) * 255).toString(16).padStart(2, "0")).join("");
|
|
14668
|
+
}
|
|
14669
|
+
__name(lch, "lch");
|
|
14670
|
+
function palette(hue, chroma) {
|
|
14671
|
+
const cache = /* @__PURE__ */ new Map();
|
|
14672
|
+
return (tone) => {
|
|
14673
|
+
const hit = cache.get(tone);
|
|
14674
|
+
if (hit) return hit;
|
|
14675
|
+
const value = lch(tone, chroma, hue);
|
|
14676
|
+
cache.set(tone, value);
|
|
14677
|
+
return value;
|
|
14678
|
+
};
|
|
14679
|
+
}
|
|
14680
|
+
__name(palette, "palette");
|
|
14681
|
+
function palettesOf(hue, options = {}) {
|
|
14682
|
+
const { chroma = 56, tertiaryShift = 60 } = options;
|
|
14683
|
+
return {
|
|
14684
|
+
primary: palette(hue, chroma),
|
|
14685
|
+
secondary: palette(hue, Math.max(16, chroma / 3.2)),
|
|
14686
|
+
tertiary: palette(hue + tertiaryShift, Math.max(28, chroma / 1.8)),
|
|
14687
|
+
neutral: palette(hue, 4),
|
|
14688
|
+
neutralVariant: palette(hue, 9),
|
|
14689
|
+
error: palette(36, 68)
|
|
14690
|
+
};
|
|
14691
|
+
}
|
|
14692
|
+
__name(palettesOf, "palettesOf");
|
|
14693
|
+
function scheme(hue, dark = false, options = {}) {
|
|
14694
|
+
const p = palettesOf(hue, options);
|
|
14695
|
+
const { primary: P, secondary: S, tertiary: T, neutral: N, neutralVariant: V, error: E } = p;
|
|
14696
|
+
if (dark) {
|
|
14697
|
+
return {
|
|
14698
|
+
primary: P(80),
|
|
14699
|
+
onPrimary: P(20),
|
|
14700
|
+
primaryContainer: P(30),
|
|
14701
|
+
onPrimaryContainer: P(90),
|
|
14702
|
+
secondary: S(80),
|
|
14703
|
+
onSecondary: S(20),
|
|
14704
|
+
secondaryContainer: S(30),
|
|
14705
|
+
onSecondaryContainer: S(90),
|
|
14706
|
+
tertiary: T(80),
|
|
14707
|
+
onTertiary: T(20),
|
|
14708
|
+
tertiaryContainer: T(30),
|
|
14709
|
+
onTertiaryContainer: T(90),
|
|
14710
|
+
error: E(80),
|
|
14711
|
+
onError: E(20),
|
|
14712
|
+
errorContainer: E(30),
|
|
14713
|
+
onErrorContainer: E(90),
|
|
14714
|
+
background: N(6),
|
|
14715
|
+
onBackground: N(90),
|
|
14716
|
+
surface: N(6),
|
|
14717
|
+
onSurface: N(90),
|
|
14718
|
+
surfaceVariant: V(30),
|
|
14719
|
+
onSurfaceVariant: V(80),
|
|
14720
|
+
surfaceDim: N(6),
|
|
14721
|
+
surfaceBright: N(24),
|
|
14722
|
+
surfaceContainerLowest: N(4),
|
|
14723
|
+
surfaceContainerLow: N(10),
|
|
14724
|
+
surfaceContainer: N(12),
|
|
14725
|
+
surfaceContainerHigh: N(17),
|
|
14726
|
+
surfaceContainerHighest: N(22),
|
|
14727
|
+
outline: V(60),
|
|
14728
|
+
outlineVariant: V(30),
|
|
14729
|
+
inverseSurface: N(90),
|
|
14730
|
+
inverseOnSurface: N(20),
|
|
14731
|
+
inversePrimary: P(40),
|
|
14732
|
+
scrim: N(0),
|
|
14733
|
+
shadow: N(0)
|
|
14734
|
+
};
|
|
14735
|
+
}
|
|
14736
|
+
return {
|
|
14737
|
+
primary: P(40),
|
|
14738
|
+
onPrimary: P(100),
|
|
14739
|
+
primaryContainer: P(90),
|
|
14740
|
+
onPrimaryContainer: P(30),
|
|
14741
|
+
secondary: S(40),
|
|
14742
|
+
onSecondary: S(100),
|
|
14743
|
+
secondaryContainer: S(90),
|
|
14744
|
+
onSecondaryContainer: S(30),
|
|
14745
|
+
tertiary: T(40),
|
|
14746
|
+
onTertiary: T(100),
|
|
14747
|
+
tertiaryContainer: T(90),
|
|
14748
|
+
onTertiaryContainer: T(30),
|
|
14749
|
+
error: E(40),
|
|
14750
|
+
onError: E(100),
|
|
14751
|
+
errorContainer: E(90),
|
|
14752
|
+
onErrorContainer: E(30),
|
|
14753
|
+
background: N(98),
|
|
14754
|
+
onBackground: N(10),
|
|
14755
|
+
surface: N(98),
|
|
14756
|
+
onSurface: N(10),
|
|
14757
|
+
surfaceVariant: V(90),
|
|
14758
|
+
onSurfaceVariant: V(30),
|
|
14759
|
+
surfaceDim: N(87),
|
|
14760
|
+
surfaceBright: N(98),
|
|
14761
|
+
surfaceContainerLowest: N(100),
|
|
14762
|
+
surfaceContainerLow: N(96),
|
|
14763
|
+
surfaceContainer: N(94),
|
|
14764
|
+
surfaceContainerHigh: N(92),
|
|
14765
|
+
surfaceContainerHighest: N(90),
|
|
14766
|
+
outline: V(50),
|
|
14767
|
+
outlineVariant: V(80),
|
|
14768
|
+
inverseSurface: N(20),
|
|
14769
|
+
inverseOnSurface: N(95),
|
|
14770
|
+
inversePrimary: P(80),
|
|
14771
|
+
scrim: N(0),
|
|
14772
|
+
shadow: N(0)
|
|
14773
|
+
};
|
|
14774
|
+
}
|
|
14775
|
+
__name(scheme, "scheme");
|
|
14776
|
+
var SHAPE = {
|
|
14777
|
+
none: 0,
|
|
14778
|
+
extraSmall: 4,
|
|
14779
|
+
small: 8,
|
|
14780
|
+
medium: 12,
|
|
14781
|
+
large: 16,
|
|
14782
|
+
largeIncreased: 20,
|
|
14783
|
+
extraLarge: 28,
|
|
14784
|
+
extraLargeIncreased: 32,
|
|
14785
|
+
extraExtraLarge: 48,
|
|
14786
|
+
full: 9999
|
|
14787
|
+
};
|
|
14788
|
+
var FONT_STACK = '"Roboto Flex", "Roboto", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", system-ui, sans-serif';
|
|
14789
|
+
var MONO_STACK = '"Roboto Mono", "JetBrains Mono", "SF Mono", "Cascadia Mono", Consolas, "Noto Sans Mono", monospace';
|
|
14790
|
+
var TYPE = {
|
|
14791
|
+
displayLarge: { size: 57, line: 64, weight: 400, tracking: -0.25 },
|
|
14792
|
+
displayMedium: { size: 45, line: 52, weight: 400, tracking: 0 },
|
|
14793
|
+
displaySmall: { size: 36, line: 44, weight: 400, tracking: 0 },
|
|
14794
|
+
headlineLarge: { size: 32, line: 40, weight: 400, tracking: 0 },
|
|
14795
|
+
headlineMedium: { size: 28, line: 36, weight: 400, tracking: 0 },
|
|
14796
|
+
headlineSmall: { size: 24, line: 32, weight: 400, tracking: 0 },
|
|
14797
|
+
titleLarge: { size: 22, line: 28, weight: 400, tracking: 0 },
|
|
14798
|
+
titleMedium: { size: 16, line: 24, weight: 500, tracking: 0.15 },
|
|
14799
|
+
titleSmall: { size: 14, line: 20, weight: 500, tracking: 0.1 },
|
|
14800
|
+
bodyLarge: { size: 16, line: 24, weight: 400, tracking: 0.5 },
|
|
14801
|
+
bodyMedium: { size: 14, line: 20, weight: 400, tracking: 0.25 },
|
|
14802
|
+
bodySmall: { size: 12, line: 16, weight: 400, tracking: 0.4 },
|
|
14803
|
+
labelLarge: { size: 14, line: 20, weight: 500, tracking: 0.1 },
|
|
14804
|
+
labelMedium: { size: 12, line: 16, weight: 500, tracking: 0.5 },
|
|
14805
|
+
labelSmall: { size: 11, line: 16, weight: 500, tracking: 0.5 }
|
|
14806
|
+
};
|
|
14807
|
+
var ELEVATION = [
|
|
14808
|
+
"none",
|
|
14809
|
+
"0 1px 2px 0 rgba(0,0,0,.30), 0 1px 3px 1px rgba(0,0,0,.15)",
|
|
14810
|
+
"0 1px 2px 0 rgba(0,0,0,.30), 0 2px 6px 2px rgba(0,0,0,.15)",
|
|
14811
|
+
"0 1px 3px 0 rgba(0,0,0,.30), 0 4px 8px 3px rgba(0,0,0,.15)",
|
|
14812
|
+
"0 2px 3px 0 rgba(0,0,0,.30), 0 6px 10px 4px rgba(0,0,0,.15)",
|
|
14813
|
+
"0 4px 4px 0 rgba(0,0,0,.30), 0 8px 12px 6px rgba(0,0,0,.15)"
|
|
14814
|
+
];
|
|
14815
|
+
var kebab = /* @__PURE__ */ __name((name2) => name2.replace(/[A-Z]/g, (c) => "-" + c.toLowerCase()), "kebab");
|
|
14816
|
+
function colorVars(s) {
|
|
14817
|
+
return Object.entries(s).map(([role, value]) => `--md-sys-color-${kebab(role)}:${value}`).join(";");
|
|
14818
|
+
}
|
|
14819
|
+
__name(colorVars, "colorVars");
|
|
14820
|
+
function systemVars() {
|
|
14821
|
+
const shape = Object.entries(SHAPE).map(([name2, value]) => `--md-sys-shape-corner-${kebab(name2)}:${value}px`);
|
|
14822
|
+
const elevation = ELEVATION.map((value, level) => `--md-sys-elevation-level${level}:${value}`);
|
|
14823
|
+
const type = Object.entries(TYPE).flatMap(([name2, style]) => [
|
|
14824
|
+
`--md-sys-typescale-${kebab(name2)}-size:${style.size}px`,
|
|
14825
|
+
`--md-sys-typescale-${kebab(name2)}-line-height:${style.line}px`,
|
|
14826
|
+
`--md-sys-typescale-${kebab(name2)}-weight:${style.weight}`,
|
|
14827
|
+
`--md-sys-typescale-${kebab(name2)}-tracking:${style.tracking}px`
|
|
14828
|
+
]);
|
|
14829
|
+
return [...shape, ...elevation, ...type, `--md-sys-typescale-font:${FONT_STACK}`, `--md-sys-typescale-font-mono:${MONO_STACK}`].join(";");
|
|
14830
|
+
}
|
|
14831
|
+
__name(systemVars, "systemVars");
|
|
14832
|
+
function baseline(s) {
|
|
14833
|
+
return `
|
|
14834
|
+
:root{${colorVars(s)};${systemVars()}}
|
|
14835
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
14836
|
+
html,body{margin:0;padding:0}
|
|
14837
|
+
body{
|
|
14838
|
+
background:var(--md-sys-color-background);
|
|
14839
|
+
color:var(--md-sys-color-on-surface);
|
|
14840
|
+
font-family:var(--md-sys-typescale-font);
|
|
14841
|
+
font-synthesis-weight:none;
|
|
14842
|
+
-webkit-font-smoothing:antialiased;
|
|
14843
|
+
text-rendering:optimizeLegibility;
|
|
14844
|
+
font-variant-numeric:tabular-nums;
|
|
14845
|
+
}
|
|
14846
|
+
.m3-display-large{font-size:57px;line-height:64px;font-weight:600;letter-spacing:-.25px}
|
|
14847
|
+
.m3-display-medium{font-size:45px;line-height:52px;font-weight:600;letter-spacing:0}
|
|
14848
|
+
.m3-display-small{font-size:36px;line-height:44px;font-weight:600;letter-spacing:0}
|
|
14849
|
+
.m3-headline-large{font-size:32px;line-height:40px;font-weight:600;letter-spacing:0}
|
|
14850
|
+
.m3-headline-medium{font-size:28px;line-height:36px;font-weight:600;letter-spacing:0}
|
|
14851
|
+
.m3-headline-small{font-size:24px;line-height:32px;font-weight:600;letter-spacing:0}
|
|
14852
|
+
.m3-title-large{font-size:22px;line-height:28px;font-weight:600;letter-spacing:0}
|
|
14853
|
+
.m3-title-medium{font-size:16px;line-height:24px;font-weight:600;letter-spacing:.15px}
|
|
14854
|
+
.m3-title-small{font-size:14px;line-height:20px;font-weight:600;letter-spacing:.1px}
|
|
14855
|
+
.m3-body-large{font-size:16px;line-height:24px;font-weight:400;letter-spacing:.5px}
|
|
14856
|
+
.m3-body-medium{font-size:14px;line-height:20px;font-weight:400;letter-spacing:.25px}
|
|
14857
|
+
.m3-body-small{font-size:12px;line-height:16px;font-weight:400;letter-spacing:.4px}
|
|
14858
|
+
.m3-label-large{font-size:14px;line-height:20px;font-weight:600;letter-spacing:.1px}
|
|
14859
|
+
.m3-label-medium{font-size:12px;line-height:16px;font-weight:600;letter-spacing:.5px}
|
|
14860
|
+
.m3-label-small{font-size:11px;line-height:16px;font-weight:600;letter-spacing:.5px}
|
|
14861
|
+
`;
|
|
14862
|
+
}
|
|
14863
|
+
__name(baseline, "baseline");
|
|
14864
|
+
var MEDAL = {
|
|
14865
|
+
gold: lch(58, 52, 85),
|
|
14866
|
+
silver: lch(66, 5, 260),
|
|
14867
|
+
bronze: lch(48, 36, 48)
|
|
14868
|
+
};
|
|
14869
|
+
function components() {
|
|
14870
|
+
return `
|
|
14871
|
+
.m3-surface{background:var(--md-sys-color-surface);color:var(--md-sys-color-on-surface)}
|
|
14872
|
+
.m3-card{
|
|
14873
|
+
background:var(--md-sys-color-surface-container-low);
|
|
14874
|
+
color:var(--md-sys-color-on-surface);
|
|
14875
|
+
border-radius:var(--md-sys-shape-corner-extra-large);
|
|
14876
|
+
padding:24px;
|
|
14877
|
+
}
|
|
14878
|
+
.m3-card--elevated{background:var(--md-sys-color-surface-container-low);box-shadow:var(--md-sys-elevation-level1)}
|
|
14879
|
+
.m3-card--outlined{background:var(--md-sys-color-surface);border:1px solid var(--md-sys-color-outline-variant)}
|
|
14880
|
+
.m3-card--filled{background:var(--md-sys-color-surface-container-highest)}
|
|
14881
|
+
|
|
14882
|
+
/* 药丸形,Expressive 里用得最多的一种形状 */
|
|
14883
|
+
.m3-chip{
|
|
14884
|
+
display:inline-flex;align-items:center;gap:6px;
|
|
14885
|
+
height:32px;padding:0 16px;
|
|
14886
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
14887
|
+
background:var(--md-sys-color-secondary-container);
|
|
14888
|
+
color:var(--md-sys-color-on-secondary-container);
|
|
14889
|
+
font-size:14px;line-height:20px;font-weight:600;letter-spacing:.1px;white-space:nowrap;
|
|
14890
|
+
}
|
|
14891
|
+
.m3-chip--primary{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}
|
|
14892
|
+
.m3-chip--tertiary{background:var(--md-sys-color-tertiary-container);color:var(--md-sys-color-on-tertiary-container)}
|
|
14893
|
+
.m3-chip--error{background:var(--md-sys-color-error-container);color:var(--md-sys-color-on-error-container)}
|
|
14894
|
+
.m3-chip--outlined{background:transparent;border:1px solid var(--md-sys-color-outline);color:var(--md-sys-color-on-surface-variant)}
|
|
14895
|
+
|
|
14896
|
+
.m3-divider{height:1px;border:0;margin:0;background:var(--md-sys-color-outline-variant)}
|
|
14897
|
+
|
|
14898
|
+
/* 列表项:靠圆角与容器色分组,不画分隔线 */
|
|
14899
|
+
.m3-list{display:flex;flex-direction:column;gap:4px;margin:0;padding:0;list-style:none}
|
|
14900
|
+
.m3-list-item{
|
|
14901
|
+
display:flex;align-items:center;gap:16px;
|
|
14902
|
+
min-height:56px;padding:8px 16px;
|
|
14903
|
+
border-radius:var(--md-sys-shape-corner-medium);
|
|
14904
|
+
background:var(--md-sys-color-surface-container);
|
|
14905
|
+
color:var(--md-sys-color-on-surface);
|
|
14906
|
+
}
|
|
14907
|
+
/* 一组里的首尾项圆角放大,整组读起来像一个整体 */
|
|
14908
|
+
.m3-list-item:first-child{border-top-left-radius:var(--md-sys-shape-corner-extra-large);border-top-right-radius:var(--md-sys-shape-corner-extra-large)}
|
|
14909
|
+
.m3-list-item:last-child{border-bottom-left-radius:var(--md-sys-shape-corner-extra-large);border-bottom-right-radius:var(--md-sys-shape-corner-extra-large)}
|
|
14910
|
+
.m3-list-item--accent{background:var(--md-sys-color-primary-container);color:var(--md-sys-color-on-primary-container)}
|
|
14911
|
+
|
|
14912
|
+
.m3-avatar{
|
|
14913
|
+
width:40px;height:40px;flex:none;
|
|
14914
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
14915
|
+
object-fit:cover;background:var(--md-sys-color-surface-container-highest);
|
|
14916
|
+
}
|
|
14917
|
+
|
|
14918
|
+
/* 序号徽章,名次靠它一眼可辨 */
|
|
14919
|
+
.m3-badge{
|
|
14920
|
+
display:inline-flex;align-items:center;justify-content:center;
|
|
14921
|
+
min-width:28px;height:28px;padding:0 8px;flex:none;
|
|
14922
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
14923
|
+
background:var(--md-sys-color-surface-container-highest);
|
|
14924
|
+
color:var(--md-sys-color-on-surface-variant);
|
|
14925
|
+
font-size:14px;font-weight:600;letter-spacing:0;
|
|
14926
|
+
font-variant-numeric:tabular-nums;
|
|
14927
|
+
}
|
|
14928
|
+
/*
|
|
14929
|
+
* 前三名用真正的金银铜,而不是主题的主 / 次 / 第三色:
|
|
14930
|
+
* 名次的含义是固定的,跟着主题变色反而认不出来。三种金属色本身也走 LCh,
|
|
14931
|
+
* 色调彼此拉开一档,所以放在任何主题里明暗关系都成立。
|
|
14932
|
+
*/
|
|
14933
|
+
.m3-badge--gold{background:${MEDAL.gold};color:#fff}
|
|
14934
|
+
.m3-badge--silver{background:${MEDAL.silver};color:#fff}
|
|
14935
|
+
.m3-badge--bronze{background:${MEDAL.bronze};color:#fff}
|
|
14936
|
+
|
|
14937
|
+
/*
|
|
14938
|
+
* 进度 / 排行条。填充与轨道是两个独立的全圆角色块,中间留 4px 空隙——
|
|
14939
|
+
* 这是 M3 新版进度指示器的标志性细节,靠 flex 比例分配长度,不必算百分比。
|
|
14940
|
+
*/
|
|
14941
|
+
.m3-bar{display:flex;align-items:center;gap:4px;height:16px;flex:1;min-width:0}
|
|
14942
|
+
.m3-bar__fill{
|
|
14943
|
+
height:100%;min-width:16px;
|
|
14944
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
14945
|
+
background:var(--md-sys-color-primary);
|
|
14946
|
+
}
|
|
14947
|
+
.m3-bar__track{
|
|
14948
|
+
height:100%;
|
|
14949
|
+
border-radius:var(--md-sys-shape-corner-full);
|
|
14950
|
+
background:var(--md-sys-color-surface-container-highest);
|
|
14951
|
+
}
|
|
14952
|
+
.m3-bar--on-accent .m3-bar__track{background:var(--md-sys-color-surface-container-lowest)}
|
|
14953
|
+
|
|
14954
|
+
/* 页眉:大标题 + 辅助说明,Expressive 强调标题本身的体量 */
|
|
14955
|
+
.m3-header{display:flex;flex-direction:column;gap:4px;padding:8px 4px 20px}
|
|
14956
|
+
.m3-header__title{font-size:32px;line-height:40px;font-weight:600;letter-spacing:0;color:var(--md-sys-color-on-surface);margin:0}
|
|
14957
|
+
.m3-header__support{font-size:14px;line-height:20px;font-weight:400;letter-spacing:.25px;color:var(--md-sys-color-on-surface-variant);margin:0}
|
|
14958
|
+
|
|
14959
|
+
/* 页脚署名,压到最低对比度,不与正文抢视线 */
|
|
14960
|
+
.m3-footnote{
|
|
14961
|
+
padding-top:16px;text-align:center;
|
|
14962
|
+
font-size:12px;line-height:16px;letter-spacing:.4px;
|
|
14963
|
+
color:var(--md-sys-color-outline);
|
|
14964
|
+
}
|
|
14965
|
+
`;
|
|
14966
|
+
}
|
|
14967
|
+
__name(components, "components");
|
|
14968
|
+
|
|
14624
14969
|
// src/view.ts
|
|
14970
|
+
var HUE = 138;
|
|
14971
|
+
var SCHEME = scheme(HUE, true);
|
|
14972
|
+
var accentOf = /* @__PURE__ */ __name((hue) => lch(80, 46, hue), "accentOf");
|
|
14625
14973
|
var PIXELS = {
|
|
14626
14974
|
// 品牌与模式
|
|
14627
14975
|
creeper: [
|
|
@@ -14988,7 +15336,7 @@ var MODES = {
|
|
|
14988
15336
|
mob: {
|
|
14989
15337
|
name: "生物",
|
|
14990
15338
|
icon: "creeper",
|
|
14991
|
-
accent:
|
|
15339
|
+
accent: accentOf(138),
|
|
14992
15340
|
pixelArt: false,
|
|
14993
15341
|
tagline: "从生命、体型与生成方式里辨认它",
|
|
14994
15342
|
total: mobData.length
|
|
@@ -14996,7 +15344,7 @@ var MODES = {
|
|
|
14996
15344
|
item: {
|
|
14997
15345
|
name: "物品",
|
|
14998
15346
|
icon: "ingot",
|
|
14999
|
-
accent:
|
|
15347
|
+
accent: accentOf(82),
|
|
15000
15348
|
pixelArt: true,
|
|
15001
15349
|
tagline: "从稀有度、来源与用途里辨认它",
|
|
15002
15350
|
total: itemData.length
|
|
@@ -15004,7 +15352,7 @@ var MODES = {
|
|
|
15004
15352
|
block: {
|
|
15005
15353
|
name: "方块",
|
|
15006
15354
|
icon: "grassblock",
|
|
15007
|
-
accent:
|
|
15355
|
+
accent: accentOf(238),
|
|
15008
15356
|
pixelArt: true,
|
|
15009
15357
|
tagline: "从硬度、工具与光学性质里辨认它",
|
|
15010
15358
|
total: blockData.length
|
|
@@ -15110,207 +15458,260 @@ function statusOf(guess, key) {
|
|
|
15110
15458
|
return STATUS_META[v] ? v : "unknown";
|
|
15111
15459
|
}
|
|
15112
15460
|
__name(statusOf, "statusOf");
|
|
15113
|
-
var
|
|
15461
|
+
var STATUS_TILE = {
|
|
15462
|
+
hit: lch(42, 44, 142),
|
|
15463
|
+
half: lch(44, 46, 82),
|
|
15464
|
+
miss: lch(42, 48, 28),
|
|
15465
|
+
none: SCHEME.surfaceContainerHigh
|
|
15466
|
+
};
|
|
15467
|
+
var FONT_STACK_CJK = `"Minecraft", "Fusion Pixel 12px monospaced", "Fusion Pixel 12px", "Zpix", ` + FONT_STACK;
|
|
15114
15468
|
var CSS = `
|
|
15115
|
-
|
|
15469
|
+
${baseline(SCHEME)}${components()}
|
|
15470
|
+
body{font-family:${FONT_STACK_CJK};background:transparent}
|
|
15116
15471
|
html,body{background:transparent}
|
|
15117
|
-
body{font-family:${FONT_STACK};-webkit-font-smoothing:antialiased}
|
|
15118
15472
|
.px{display:block;flex:none}
|
|
15119
15473
|
|
|
15120
15474
|
#card{
|
|
15121
15475
|
position:relative;
|
|
15122
15476
|
display:inline-block;
|
|
15123
|
-
|
|
15124
|
-
color
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
/* 石质底噪:两层错位的斜向条纹,比纯色更有材质但不抢内容 */
|
|
15128
|
-
background-image:
|
|
15129
|
-
repeating-linear-gradient(135deg, rgba(255,255,255,.016) 0 2px, transparent 2px 5px),
|
|
15130
|
-
repeating-linear-gradient(45deg, rgba(0,0,0,.10) 0 3px, transparent 3px 7px);
|
|
15477
|
+
overflow:hidden;
|
|
15478
|
+
background:var(--md-sys-color-surface);
|
|
15479
|
+
color:var(--md-sys-color-on-surface);
|
|
15480
|
+
border-radius:${SHAPE.extraLarge}px;
|
|
15131
15481
|
}
|
|
15132
|
-
|
|
15133
|
-
content:"";position:absolute;inset:0;pointer-events:none;
|
|
15134
|
-
background:radial-gradient(120% 90% at 50% 0%, rgba(255,255,255,.05), transparent 60%);
|
|
15135
|
-
}
|
|
15136
|
-
.pad{padding:22px 24px 20px}
|
|
15482
|
+
.pad{padding:24px}
|
|
15137
15483
|
|
|
15138
|
-
/* ──
|
|
15139
|
-
.hd{
|
|
15140
|
-
|
|
15141
|
-
|
|
15142
|
-
|
|
15143
|
-
|
|
15144
|
-
|
|
15145
|
-
|
|
15146
|
-
|
|
15147
|
-
background:
|
|
15148
|
-
|
|
15149
|
-
.
|
|
15150
|
-
.brand
|
|
15151
|
-
.brand .
|
|
15152
|
-
|
|
15153
|
-
.brand .word b{color:var(--accent)}
|
|
15154
|
-
.hd .sub{margin-top:
|
|
15155
|
-
text-shadow:2px 2px 0 rgba(0,0,0,.4)}
|
|
15484
|
+
/* ── 页眉 ─────────────────────────────────────────── */
|
|
15485
|
+
.hd{
|
|
15486
|
+
position:relative;
|
|
15487
|
+
background:var(--md-sys-color-surface-container);
|
|
15488
|
+
padding:20px 24px 18px;
|
|
15489
|
+
}
|
|
15490
|
+
/* 顶端那道强调色仍在,但收成一条细的圆头指示条,不再模拟草皮 */
|
|
15491
|
+
.hd .turf{
|
|
15492
|
+
position:absolute;left:24px;top:14px;width:56px;height:4px;
|
|
15493
|
+
border-radius:${SHAPE.full}px;background:var(--accent);
|
|
15494
|
+
}
|
|
15495
|
+
.hd-row{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;margin-top:18px}
|
|
15496
|
+
.brand{display:flex;align-items:center;gap:12px}
|
|
15497
|
+
.brand .mark{color:var(--accent)}
|
|
15498
|
+
.brand .word{font-size:28px;font-weight:600;letter-spacing:.18em;line-height:1}
|
|
15499
|
+
.brand .word b{color:var(--accent);font-weight:600}
|
|
15500
|
+
.hd .sub{margin-top:8px;font-size:13px;letter-spacing:.05em;color:var(--md-sys-color-on-surface-variant)}
|
|
15156
15501
|
.hd-meta{text-align:right;flex:none}
|
|
15157
|
-
.hd-meta .big{font-size:
|
|
15158
|
-
|
|
15159
|
-
.hd-meta .cap{font-size:11px;letter-spacing:.2em;color:#939b8b;margin-top:6px}
|
|
15502
|
+
.hd-meta .big{font-size:28px;font-weight:600;color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15503
|
+
.hd-meta .cap{font-size:11px;letter-spacing:.1em;color:var(--md-sys-color-on-surface-variant);margin-top:6px}
|
|
15160
15504
|
|
|
15161
|
-
/*
|
|
15162
|
-
.badge{
|
|
15163
|
-
|
|
15164
|
-
|
|
15505
|
+
/* 模式徽记:药丸形 */
|
|
15506
|
+
.badge{
|
|
15507
|
+
display:inline-flex;align-items:center;gap:7px;padding:6px 14px;
|
|
15508
|
+
border-radius:${SHAPE.full}px;
|
|
15509
|
+
background:var(--accent);color:var(--md-sys-color-surface);
|
|
15510
|
+
font-size:12.5px;letter-spacing:.06em;font-weight:600;
|
|
15511
|
+
}
|
|
15165
15512
|
|
|
15166
15513
|
/* ── 猜测板 ───────────────────────────────────────── */
|
|
15167
|
-
table{border-collapse:separate;border-spacing:
|
|
15168
|
-
th{padding:0 0
|
|
15169
|
-
.col{display:flex;flex-direction:column;align-items:center;gap:
|
|
15170
|
-
min-width:80px;max-width:132px;color
|
|
15171
|
-
.col .lb{font-size:11px;letter-spacing:.
|
|
15514
|
+
table{border-collapse:separate;border-spacing:6px;margin:0 -6px}
|
|
15515
|
+
th{padding:0 0 8px;vertical-align:bottom}
|
|
15516
|
+
.col{display:flex;flex-direction:column;align-items:center;gap:6px;
|
|
15517
|
+
min-width:80px;max-width:132px;color:var(--md-sys-color-on-surface-variant)}
|
|
15518
|
+
.col .lb{font-size:11px;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant);
|
|
15519
|
+
text-align:center;line-height:1.25;font-weight:600}
|
|
15172
15520
|
th.n .col{align-items:flex-start;min-width:150px}
|
|
15173
15521
|
|
|
15174
15522
|
td{padding:0}
|
|
15175
|
-
.tile{
|
|
15176
|
-
|
|
15523
|
+
.tile{
|
|
15524
|
+
position:relative;overflow:hidden;height:100%;
|
|
15525
|
+
min-height:60px;min-width:76px;max-width:132px;
|
|
15526
|
+
padding:9px 10px;
|
|
15527
|
+
display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
|
|
15528
|
+
border-radius:${SHAPE.medium}px;
|
|
15177
15529
|
background:var(--tile);
|
|
15178
|
-
|
|
15530
|
+
}
|
|
15179
15531
|
/* 多标签字段给更宽的上限,否则一列里会折成很高的一坨 */
|
|
15180
15532
|
.tile.list{max-width:168px}
|
|
15181
15533
|
th.list .col{max-width:168px}
|
|
15182
|
-
.tile .v{font-size:13px;font-weight:
|
|
15183
|
-
|
|
15184
|
-
.tile .chips{display:flex;flex-wrap:wrap;gap:
|
|
15185
|
-
.chip{
|
|
15186
|
-
|
|
15534
|
+
.tile .v{font-size:13px;font-weight:600;line-height:1.35;text-align:center;
|
|
15535
|
+
color:#fff;word-break:break-word}
|
|
15536
|
+
.tile .chips{display:flex;flex-wrap:wrap;gap:4px;justify-content:center}
|
|
15537
|
+
.chip{
|
|
15538
|
+
font-size:11.5px;line-height:1.35;padding:2px 8px;
|
|
15539
|
+
border-radius:${SHAPE.full}px;
|
|
15540
|
+
color:#fff;background:rgba(0,0,0,.24);
|
|
15541
|
+
}
|
|
15187
15542
|
/* 部分匹配时把真正命中的标签点亮,让「黄」变得可读 */
|
|
15188
|
-
.chip.on{background
|
|
15189
|
-
|
|
15190
|
-
.tile .flag{position:absolute;top:4px;right:4px;color:rgba(255,255,255,.8)}
|
|
15543
|
+
.chip.on{background:#fff;color:${SCHEME.surface};font-weight:600}
|
|
15544
|
+
.tile .flag{position:absolute;top:5px;right:5px;color:rgba(255,255,255,.85)}
|
|
15191
15545
|
/* 数值方向不只靠角标:整块的上/下边缘会亮起一条,指向答案所在的一侧 */
|
|
15192
|
-
.tile.s-up::after,.tile.s-down::after{content:"";position:absolute;left:
|
|
15193
|
-
background:rgba(255,255,255,.
|
|
15194
|
-
.tile.s-up::after{top:
|
|
15195
|
-
.tile.s-down::after{bottom:
|
|
15546
|
+
.tile.s-up::after,.tile.s-down::after{content:"";position:absolute;left:12px;right:12px;height:4px;
|
|
15547
|
+
border-radius:${SHAPE.full}px;background:rgba(255,255,255,.62)}
|
|
15548
|
+
.tile.s-up::after{top:5px}
|
|
15549
|
+
.tile.s-down::after{bottom:5px}
|
|
15196
15550
|
|
|
15197
|
-
.s-hit{--tile
|
|
15198
|
-
.s-half{--tile
|
|
15199
|
-
.s-miss{--tile
|
|
15200
|
-
.s-none{--tile
|
|
15551
|
+
.s-hit{--tile:${STATUS_TILE.hit}}
|
|
15552
|
+
.s-half{--tile:${STATUS_TILE.half}}
|
|
15553
|
+
.s-miss{--tile:${STATUS_TILE.miss}}
|
|
15554
|
+
.s-none{--tile:${STATUS_TILE.none}}
|
|
15201
15555
|
|
|
15202
15556
|
/* 名称格 */
|
|
15203
|
-
.name{
|
|
15204
|
-
|
|
15205
|
-
|
|
15206
|
-
.
|
|
15207
|
-
|
|
15208
|
-
|
|
15557
|
+
.name{
|
|
15558
|
+
display:flex;align-items:center;gap:12px;min-height:60px;min-width:150px;
|
|
15559
|
+
padding:8px 12px 8px 9px;
|
|
15560
|
+
border-radius:${SHAPE.medium}px;
|
|
15561
|
+
background:var(--md-sys-color-surface-container-high);
|
|
15562
|
+
}
|
|
15563
|
+
.name.correct{background:${STATUS_TILE.hit}}
|
|
15564
|
+
.thumb{
|
|
15565
|
+
width:44px;height:44px;flex:none;
|
|
15566
|
+
display:flex;align-items:center;justify-content:center;
|
|
15567
|
+
border-radius:${SHAPE.small}px;
|
|
15568
|
+
background:var(--md-sys-color-surface-container-lowest);
|
|
15569
|
+
}
|
|
15209
15570
|
.thumb img{max-width:38px;max-height:38px;display:block}
|
|
15210
15571
|
.thumb img.sharp{image-rendering:pixelated}
|
|
15211
15572
|
.thumb img.broken{display:none}
|
|
15212
|
-
.thumb .fb{display:none;color
|
|
15573
|
+
.thumb .fb{display:none;color:var(--md-sys-color-outline)}
|
|
15213
15574
|
.thumb.failed .fb{display:block}
|
|
15214
15575
|
.name .txt{min-width:0}
|
|
15215
|
-
.name .cn{font-size:15px;font-weight:
|
|
15216
|
-
.name .en{font-size:10.5px;letter-spacing:.
|
|
15576
|
+
.name .cn{font-size:15px;font-weight:600;line-height:1.25}
|
|
15577
|
+
.name .en{font-size:10.5px;letter-spacing:.04em;color:var(--md-sys-color-on-surface-variant);margin-top:3px;
|
|
15217
15578
|
white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:150px}
|
|
15218
|
-
.name.correct .en{color
|
|
15219
|
-
.name .no{
|
|
15220
|
-
.name
|
|
15579
|
+
.name.correct .cn,.name.correct .en,.name.correct .no{color:#fff}
|
|
15580
|
+
.name.correct .en,.name.correct .no{opacity:.78}
|
|
15581
|
+
.name .no{font-size:10px;color:var(--md-sys-color-outline);margin-top:3px}
|
|
15221
15582
|
|
|
15222
|
-
/*
|
|
15223
|
-
tr.fresh .tile,tr.fresh .name{box-shadow:
|
|
15224
|
-
inset 4px 4px 0 rgba(255,255,255,.16), 0 0 0 2px var(--accent)}
|
|
15583
|
+
/* 最新一行的强调:外圈描边 + 行首的圆头标记 */
|
|
15584
|
+
tr.fresh .tile,tr.fresh .name{box-shadow:0 0 0 2px var(--accent)}
|
|
15225
15585
|
tr.fresh .name{position:relative}
|
|
15226
|
-
tr.fresh .name::before{content:"";position:absolute;left:0;top:
|
|
15586
|
+
tr.fresh .name::before{content:"";position:absolute;left:0;top:14px;bottom:14px;width:4px;
|
|
15587
|
+
border-radius:${SHAPE.full}px;background:var(--accent)}
|
|
15227
15588
|
|
|
15228
15589
|
/* ── 进度条 ───────────────────────────────────────── */
|
|
15229
|
-
.prog{display:flex;align-items:center;gap:
|
|
15230
|
-
.prog .bar{
|
|
15231
|
-
|
|
15232
|
-
.
|
|
15233
|
-
|
|
15234
|
-
|
|
15590
|
+
.prog{display:flex;align-items:center;gap:12px;margin-top:20px}
|
|
15591
|
+
.prog .bar{
|
|
15592
|
+
flex:1;height:12px;overflow:hidden;
|
|
15593
|
+
border-radius:${SHAPE.full}px;
|
|
15594
|
+
background:var(--md-sys-color-surface-container-highest);
|
|
15595
|
+
}
|
|
15596
|
+
.prog .fill{height:100%;border-radius:${SHAPE.full}px;background:var(--accent)}
|
|
15597
|
+
.prog .num{font-size:12px;color:var(--md-sys-color-on-surface-variant);letter-spacing:.04em;flex:none;
|
|
15598
|
+
font-variant-numeric:tabular-nums}
|
|
15235
15599
|
|
|
15236
15600
|
/* ── 图例 / 页脚 ──────────────────────────────────── */
|
|
15237
|
-
.legend{
|
|
15238
|
-
|
|
15239
|
-
|
|
15240
|
-
background:var(--
|
|
15241
|
-
|
|
15601
|
+
.legend{
|
|
15602
|
+
display:flex;flex-wrap:wrap;gap:8px 10px;align-items:center;
|
|
15603
|
+
padding:14px 24px;
|
|
15604
|
+
background:var(--md-sys-color-surface-container);
|
|
15605
|
+
}
|
|
15606
|
+
.lg{
|
|
15607
|
+
display:flex;align-items:center;gap:6px;padding:5px 12px;
|
|
15608
|
+
border-radius:${SHAPE.full}px;
|
|
15609
|
+
font-size:11.5px;color:#fff;background:var(--tile);
|
|
15610
|
+
}
|
|
15611
|
+
.lg.s-none{color:var(--md-sys-color-on-surface-variant)}
|
|
15612
|
+
.tip{margin-left:auto;font-size:11.5px;color:var(--md-sys-color-outline);letter-spacing:.02em}
|
|
15242
15613
|
|
|
15243
15614
|
/* ── 通用区块 ─────────────────────────────────────── */
|
|
15244
|
-
.sec{margin-top:
|
|
15615
|
+
.sec{margin-top:22px}
|
|
15245
15616
|
.sec:first-child{margin-top:0}
|
|
15246
|
-
.sec-t{display:flex;align-items:center;gap:
|
|
15247
|
-
margin-bottom:
|
|
15248
|
-
.sec-t::after{content:"";flex:1;height:
|
|
15249
|
-
|
|
15250
|
-
|
|
15251
|
-
|
|
15252
|
-
|
|
15253
|
-
|
|
15254
|
-
.
|
|
15255
|
-
.row
|
|
15256
|
-
|
|
15257
|
-
|
|
15617
|
+
.sec-t{display:flex;align-items:center;gap:10px;font-size:12px;letter-spacing:.1em;
|
|
15618
|
+
font-weight:600;color:var(--md-sys-color-on-surface-variant);margin-bottom:12px}
|
|
15619
|
+
.sec-t::after{content:"";flex:1;height:1px;background:var(--md-sys-color-outline-variant)}
|
|
15620
|
+
.panel{
|
|
15621
|
+
padding:16px 18px;
|
|
15622
|
+
border-radius:${SHAPE.large}px;
|
|
15623
|
+
background:var(--md-sys-color-surface-container);
|
|
15624
|
+
}
|
|
15625
|
+
.rows{display:flex;flex-direction:column;gap:9px}
|
|
15626
|
+
.row{display:flex;align-items:center;gap:10px;font-size:13.5px;
|
|
15627
|
+
color:var(--md-sys-color-on-surface);line-height:1.5}
|
|
15628
|
+
.row .k{color:var(--accent);flex:none;font-weight:600}
|
|
15629
|
+
.row .m{color:var(--md-sys-color-on-surface-variant);font-size:12px}
|
|
15630
|
+
.cmd{
|
|
15631
|
+
font-weight:600;color:var(--md-sys-color-on-surface);
|
|
15632
|
+
background:var(--md-sys-color-surface-container-highest);
|
|
15633
|
+
padding:2px 9px;border-radius:${SHAPE.small}px;
|
|
15634
|
+
}
|
|
15258
15635
|
|
|
15259
|
-
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:
|
|
15260
|
-
.mode-card{
|
|
15261
|
-
|
|
15262
|
-
|
|
15263
|
-
|
|
15264
|
-
|
|
15636
|
+
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}
|
|
15637
|
+
.mode-card{
|
|
15638
|
+
padding:15px 16px;
|
|
15639
|
+
border-radius:${SHAPE.large}px;
|
|
15640
|
+
background:var(--md-sys-color-surface-container);
|
|
15641
|
+
}
|
|
15642
|
+
.mode-card .top{display:flex;align-items:center;gap:9px;font-size:15px;font-weight:600}
|
|
15643
|
+
.mode-card .cnt{font-size:11.5px;color:var(--md-sys-color-on-surface-variant);margin-top:8px;letter-spacing:.04em}
|
|
15644
|
+
.mode-card .tl{font-size:11.5px;color:var(--md-sys-color-on-surface-variant);margin-top:6px;line-height:1.5}
|
|
15265
15645
|
|
|
15266
|
-
.attrs{display:flex;flex-wrap:wrap;gap:
|
|
15267
|
-
.attr{
|
|
15268
|
-
|
|
15646
|
+
.attrs{display:flex;flex-wrap:wrap;gap:8px}
|
|
15647
|
+
.attr{
|
|
15648
|
+
display:flex;align-items:center;gap:7px;padding:7px 14px;
|
|
15649
|
+
border-radius:${SHAPE.full}px;
|
|
15650
|
+
font-size:12.5px;color:var(--md-sys-color-on-secondary-container);
|
|
15651
|
+
background:var(--md-sys-color-secondary-container);
|
|
15652
|
+
}
|
|
15269
15653
|
.attr .px{color:var(--accent)}
|
|
15270
15654
|
|
|
15271
15655
|
/* ── 揭晓卡 ───────────────────────────────────────── */
|
|
15272
|
-
.reveal{display:flex;align-items:center;gap:
|
|
15656
|
+
.reveal{display:flex;align-items:center;gap:22px}
|
|
15273
15657
|
.reveal .who{flex:1;min-width:0}
|
|
15274
15658
|
.reveal .cn .crown{display:inline-block;vertical-align:middle;margin-left:12px;color:var(--accent)}
|
|
15275
|
-
.reveal .big-thumb{
|
|
15276
|
-
|
|
15277
|
-
|
|
15659
|
+
.reveal .big-thumb{
|
|
15660
|
+
width:136px;height:136px;flex:none;
|
|
15661
|
+
display:flex;align-items:center;justify-content:center;
|
|
15662
|
+
border-radius:${SHAPE.extraLarge}px;
|
|
15663
|
+
background:var(--md-sys-color-surface-container);
|
|
15664
|
+
}
|
|
15665
|
+
.reveal .big-thumb img{max-width:112px;max-height:112px;display:block}
|
|
15278
15666
|
.reveal .big-thumb img.sharp{image-rendering:pixelated}
|
|
15279
15667
|
.reveal .big-thumb img.broken{display:none}
|
|
15280
|
-
.reveal .big-thumb .fb{display:none;color
|
|
15668
|
+
.reveal .big-thumb .fb{display:none;color:var(--md-sys-color-outline)}
|
|
15281
15669
|
.reveal .big-thumb.failed .fb{display:block}
|
|
15282
|
-
.reveal .cn{font-size:
|
|
15283
|
-
.reveal .en{font-size:13px;letter-spacing:.
|
|
15284
|
-
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:
|
|
15285
|
-
.stat{
|
|
15286
|
-
|
|
15287
|
-
.
|
|
15288
|
-
|
|
15289
|
-
|
|
15670
|
+
.reveal .cn{font-size:36px;font-weight:600;line-height:1.1}
|
|
15671
|
+
.reveal .en{font-size:13px;letter-spacing:.1em;color:var(--md-sys-color-on-surface-variant);margin-top:10px}
|
|
15672
|
+
.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
|
|
15673
|
+
.stat{
|
|
15674
|
+
padding:13px 16px;
|
|
15675
|
+
border-radius:${SHAPE.large}px;
|
|
15676
|
+
background:var(--md-sys-color-surface-container);
|
|
15677
|
+
}
|
|
15678
|
+
.stat .n{font-size:22px;font-weight:600;color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15679
|
+
.stat .c{font-size:10.5px;color:var(--md-sys-color-on-surface-variant);margin-top:7px;letter-spacing:.06em}
|
|
15290
15680
|
|
|
15291
15681
|
/* ── 排行榜 ───────────────────────────────────────── */
|
|
15292
15682
|
.rank{display:flex;flex-direction:column;gap:6px}
|
|
15293
|
-
.rk{
|
|
15294
|
-
|
|
15295
|
-
.
|
|
15296
|
-
|
|
15297
|
-
|
|
15298
|
-
.rk.
|
|
15299
|
-
.rk.
|
|
15300
|
-
.rk
|
|
15301
|
-
|
|
15683
|
+
.rk{
|
|
15684
|
+
display:flex;align-items:center;gap:14px;padding:12px 14px;
|
|
15685
|
+
border-radius:${SHAPE.medium}px;
|
|
15686
|
+
background:var(--md-sys-color-surface-container);
|
|
15687
|
+
}
|
|
15688
|
+
.rk:first-child{border-top-left-radius:${SHAPE.extraLarge}px;border-top-right-radius:${SHAPE.extraLarge}px}
|
|
15689
|
+
.rk:last-child{border-bottom-left-radius:${SHAPE.extraLarge}px;border-bottom-right-radius:${SHAPE.extraLarge}px}
|
|
15690
|
+
.rk .pos{
|
|
15691
|
+
width:34px;height:34px;flex:none;
|
|
15692
|
+
display:flex;align-items:center;justify-content:center;
|
|
15693
|
+
border-radius:${SHAPE.full}px;
|
|
15694
|
+
font-size:15px;font-weight:600;
|
|
15695
|
+
color:var(--md-sys-color-on-surface-variant);
|
|
15696
|
+
background:var(--md-sys-color-surface-container-highest);
|
|
15697
|
+
}
|
|
15698
|
+
.rk.p1 .pos,.rk.p2 .pos,.rk.p3 .pos{color:#fff}
|
|
15699
|
+
.rk.p1 .pos{background:${MEDAL.gold}}
|
|
15700
|
+
.rk.p2 .pos{background:${MEDAL.silver}}
|
|
15701
|
+
.rk.p3 .pos{background:${MEDAL.bronze}}
|
|
15702
|
+
.rk.p1{box-shadow:0 0 0 2px ${MEDAL.gold}}
|
|
15302
15703
|
.rk .who{flex:1;min-width:0}
|
|
15303
|
-
.rk .nm{font-size:14.5px;font-weight:
|
|
15704
|
+
.rk .nm{font-size:14.5px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
|
|
15304
15705
|
max-width:260px}
|
|
15305
|
-
.rk .split{display:flex;gap:
|
|
15306
|
-
.rk .sp{display:flex;align-items:center;gap:4px;font-size:11px;color
|
|
15706
|
+
.rk .split{display:flex;gap:10px;margin-top:6px}
|
|
15707
|
+
.rk .sp{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--md-sys-color-on-surface-variant)}
|
|
15307
15708
|
.rk .tot{flex:none;text-align:right}
|
|
15308
|
-
.rk .tot .n{font-size:
|
|
15309
|
-
|
|
15310
|
-
.rk .tot .c{font-size:10px;color:#7c856f;margin-top:5px;letter-spacing:.1em}
|
|
15709
|
+
.rk .tot .n{font-size:22px;font-weight:600;color:var(--accent);line-height:1;font-variant-numeric:tabular-nums}
|
|
15710
|
+
.rk .tot .c{font-size:10px;color:var(--md-sys-color-outline);margin-top:5px;letter-spacing:.06em}
|
|
15311
15711
|
|
|
15312
|
-
.empty{padding:
|
|
15313
|
-
.
|
|
15712
|
+
.empty{padding:36px 20px;min-width:400px;text-align:center;
|
|
15713
|
+
color:var(--md-sys-color-on-surface-variant);font-size:13.5px;line-height:2}
|
|
15714
|
+
.empty .px{margin:0 auto 14px;color:var(--md-sys-color-outline)}
|
|
15314
15715
|
`;
|
|
15315
15716
|
function shell(body, opts) {
|
|
15316
15717
|
const width = opts.width ? `width:${opts.width}px;` : "";
|
|
@@ -15479,7 +15880,15 @@ function helpCard(dailyLimit, allowRepeat, middleware) {
|
|
|
15479
15880
|
</div>`;
|
|
15480
15881
|
}).join("");
|
|
15481
15882
|
const legend = legendChips();
|
|
15482
|
-
const
|
|
15883
|
+
const total = mobData.length + itemData.length + blockData.length;
|
|
15884
|
+
const body = header(null, "猜生物 · 猜物品 · 猜方块", { big: `${total}`, cap: "词条总量" }) + `<div class="pad">
|
|
15885
|
+
<div class="sec">
|
|
15886
|
+
<div class="sec-t"><span>玩 什 么</span></div>
|
|
15887
|
+
<div class="panel"><div class="rows">
|
|
15888
|
+
<div class="row"><span>每局随机抽一个生物、物品或方块,你的每次猜测都会逐项与答案比对,用颜色告诉你差在哪里。</span></div>
|
|
15889
|
+
<div class="row"><span>首次猜测的词条属于哪一类,本局就在哪一类里出题。</span></div>
|
|
15890
|
+
</div></div>
|
|
15891
|
+
</div>
|
|
15483
15892
|
<div class="sec">
|
|
15484
15893
|
<div class="sec-t"><span>三 种 模 式</span></div>
|
|
15485
15894
|
<div class="grid3">${modeCards}</div>
|
|
@@ -15494,9 +15903,18 @@ function helpCard(dailyLimit, allowRepeat, middleware) {
|
|
|
15494
15903
|
</div>
|
|
15495
15904
|
</div>
|
|
15496
15905
|
</div>
|
|
15906
|
+
<div class="sec">
|
|
15907
|
+
<div class="sec-t"><span>三 步 上 手</span></div>
|
|
15908
|
+
<div class="panel"><div class="rows">
|
|
15909
|
+
<div class="row"><span class="k">壹</span><span class="cmd">mcdle.猜 苦力怕</span><span class="m">用一个有效词条开局</span></div>
|
|
15910
|
+
<div class="row"><span class="k">贰</span><span>${middleware ? "开局后可直接发送当前模式的完整词条名称继续猜测。" : "对照颜色与箭头缩小范围,每一次猜测都会留在棋盘上。"}</span></div>
|
|
15911
|
+
<div class="row"><span class="k">叁</span><span>锁定答案,战绩自动记入 <span class="cmd">mcdle.排行榜</span>。</span></div>
|
|
15912
|
+
</div></div>
|
|
15913
|
+
</div>
|
|
15497
15914
|
<div class="sec">
|
|
15498
15915
|
<div class="sec-t"><span>指 令</span></div>
|
|
15499
15916
|
<div class="panel"><div class="rows">
|
|
15917
|
+
<div class="row"><span class="cmd">mcdle</span><span class="m">这份玩法与指令说明</span></div>
|
|
15500
15918
|
<div class="row"><span class="cmd">mcdle.猜 [名称]</span><span class="m">开始一局,或提交猜测</span></div>
|
|
15501
15919
|
<div class="row"><span class="cmd">mcdle.猜</span><span class="m">局中直接使用可回看当前棋盘</span></div>
|
|
15502
15920
|
<div class="row"><span class="cmd">mcdle.裸猜 [开/关]</span><span class="m">临时切换本群无前缀续猜</span></div>
|
|
@@ -15514,54 +15932,22 @@ function helpCard(dailyLimit, allowRepeat, middleware) {
|
|
|
15514
15932
|
<div class="row"><span class="k">·</span><span>词条与数据来自 Minecraft Wiki,版本号按发布先后比较。</span></div>
|
|
15515
15933
|
</div></div>
|
|
15516
15934
|
</div>
|
|
15517
|
-
</div>` + noteRow("词条数据来自 zh.minecraft.wiki");
|
|
15518
|
-
return shell(body, { accent: "#8ec96a", width: 760 });
|
|
15519
|
-
}
|
|
15520
|
-
__name(helpCard, "helpCard");
|
|
15521
|
-
function introCard(dailyLimit, middleware) {
|
|
15522
|
-
const modeCards = ["mob", "item", "block"].map((m) => {
|
|
15523
|
-
const meta = MODES[m];
|
|
15524
|
-
return `<div class="mode-card" style="--accent:${meta.accent}">
|
|
15525
|
-
<div class="top" style="color:${meta.accent}">${px(meta.icon, 17)}<span>${meta.name}</span></div>
|
|
15526
|
-
<div class="cnt">${meta.total} 个词条</div>
|
|
15527
|
-
</div>`;
|
|
15528
|
-
}).join("");
|
|
15529
|
-
const body = header(null, "猜生物 · 猜物品 · 猜方块", { big: `${mobData.length + itemData.length + blockData.length}`, cap: "词条总量" }) + `<div class="pad">
|
|
15530
|
-
<div class="sec">
|
|
15531
|
-
<div class="sec-t"><span>玩 什 么</span></div>
|
|
15532
|
-
<div class="grid3">${modeCards}</div>
|
|
15533
|
-
</div>
|
|
15534
|
-
<div class="sec">
|
|
15535
|
-
<div class="sec-t"><span>三 步 上 手</span></div>
|
|
15536
|
-
<div class="panel"><div class="rows">
|
|
15537
|
-
<div class="row"><span class="k">壹</span><span class="cmd">mcdle.猜 苦力怕</span><span class="m">用一个有效词条开局</span></div>
|
|
15538
|
-
<div class="row"><span class="k">贰</span><span>${middleware ? "开局后可直接发送当前模式的完整词条名称继续猜测。" : "对照颜色与箭头缩小范围,每一次猜测都会留在棋盘上。"}</span></div>
|
|
15539
|
-
<div class="row"><span class="k">叁</span><span>锁定答案,战绩自动记入 <span class="cmd">mcdle.排行榜</span>。</span></div>
|
|
15540
|
-
</div></div>
|
|
15541
|
-
</div>
|
|
15542
|
-
<div class="sec">
|
|
15543
|
-
<div class="sec-t"><span>今 日 额 度</span></div>
|
|
15544
|
-
<div class="panel"><div class="rows">
|
|
15545
|
-
<div class="row"><span class="k">·</span><span>每个群每日 <b>${dailyLimit}</b> 局,跨零点重置;详细规则见 <span class="cmd">mcdle.帮助</span>。</span></div>
|
|
15546
|
-
<div class="row"><span class="k">·</span><span><span class="cmd">mcdle.裸猜 开/关</span> 可临时调整本群续猜方式。</span></div>
|
|
15547
|
-
</div></div>
|
|
15548
|
-
</div>
|
|
15549
15935
|
</div>` + noteRow("灵感来自 Wordle 与 mcdle.net");
|
|
15550
|
-
return shell(body, { accent:
|
|
15936
|
+
return shell(body, { accent: accentOf(138), width: 760 });
|
|
15551
15937
|
}
|
|
15552
|
-
__name(
|
|
15938
|
+
__name(helpCard, "helpCard");
|
|
15553
15939
|
function rankCard(entries, shown) {
|
|
15554
15940
|
if (!entries.length) {
|
|
15555
15941
|
const body2 = header(null, "排行榜", { big: "0", cap: "上榜人数" }) + `<div class="pad"><div class="empty">${px("trophy", 44)}
|
|
15556
15942
|
榜单还空着<br><span style="font-size:12px">用 <span class="cmd">mcdle.猜 苦力怕</span> 开出第一局,成为榜首</span></div></div>`;
|
|
15557
|
-
return shell(body2, { accent:
|
|
15943
|
+
return shell(body2, { accent: accentOf(90), width: 560 });
|
|
15558
15944
|
}
|
|
15559
15945
|
const max = Math.max(...entries.map((e) => e.total), 1);
|
|
15560
15946
|
const rows = entries.map((e, i) => {
|
|
15561
15947
|
const pos = i + 1;
|
|
15562
15948
|
const split = ["mob", "item", "block"].map((m) => {
|
|
15563
15949
|
const n = m === "mob" ? e.mob : m === "item" ? e.item : e.block;
|
|
15564
|
-
return `<span class="sp" style="color:${n ? MODES[m].accent :
|
|
15950
|
+
return `<span class="sp" style="color:${n ? MODES[m].accent : SCHEME.outline}">${px(MODES[m].icon, 10)}<span>${n}</span></span>`;
|
|
15565
15951
|
}).join("");
|
|
15566
15952
|
const w = Math.round(e.total / max * 100);
|
|
15567
15953
|
return `<div class="rk p${pos <= 3 ? pos : "n"}">
|
|
@@ -15573,7 +15959,7 @@ function rankCard(entries, shown) {
|
|
|
15573
15959
|
</div>`;
|
|
15574
15960
|
}).join("");
|
|
15575
15961
|
const body = header(null, "群内战绩 · 按累计猜中排序", { big: `${shown}`, cap: "上榜人数" }) + `<div class="pad"><div class="rank">${rows}</div></div>` + noteRow("每猜中一局记一分,按模式分别计数");
|
|
15576
|
-
return shell(body, { accent:
|
|
15962
|
+
return shell(body, { accent: accentOf(90), width: 560 });
|
|
15577
15963
|
}
|
|
15578
15964
|
__name(rankCard, "rankCard");
|
|
15579
15965
|
|
|
@@ -15581,7 +15967,7 @@ __name(rankCard, "rankCard");
|
|
|
15581
15967
|
var name = "mcdle";
|
|
15582
15968
|
var usage = `## 使用
|
|
15583
15969
|
|
|
15584
|
-
\`mcdle.猜 [名称]\`
|
|
15970
|
+
发送 \`mcdle\` 查看玩法与全部指令。\`mcdle.猜 [名称]\` 用有效词条开局或猜测。首次猜测的词条决定生物、物品或方块模式,系统再从同类词库中抽取答案。
|
|
15585
15971
|
|
|
15586
15972
|
## 提示
|
|
15587
15973
|
|
|
@@ -15596,10 +15982,9 @@ var usage = `## 使用
|
|
|
15596
15982
|
|
|
15597
15983
|
| 指令 | 说明 |
|
|
15598
15984
|
| --- | --- |
|
|
15599
|
-
| \`mcdle\` |
|
|
15985
|
+
| \`mcdle\` | 玩法与指令说明 |
|
|
15600
15986
|
| \`mcdle.猜 [名称]\` | 用有效词条开局或猜测 |
|
|
15601
|
-
| \`mcdle.裸猜 [开/关]\` |
|
|
15602
|
-
| \`mcdle.帮助\` | 完整说明 |
|
|
15987
|
+
| \`mcdle.裸猜 [开/关]\` | 切换本群无前缀续猜 |
|
|
15603
15988
|
| \`mcdle.排行榜\` | 群内战绩 |
|
|
15604
15989
|
| \`mcdle.词库\` | 全部词条 |`;
|
|
15605
15990
|
var inject = { required: ["database"], optional: ["puppeteer"] };
|
|
@@ -15738,11 +16123,10 @@ function apply(ctx, cfg) {
|
|
|
15738
16123
|
return await next();
|
|
15739
16124
|
}
|
|
15740
16125
|
});
|
|
15741
|
-
ctx.command("mcdle", "我的世界猜谜游戏").action(async ({ session }) => mcdle(session));
|
|
16126
|
+
ctx.command("mcdle", "我的世界猜谜游戏 · 玩法与指令").action(async ({ session }) => mcdle(session));
|
|
15742
16127
|
ctx.command("mcdle.猜 [guess:string]").action(async ({ session }, guess) => {
|
|
15743
16128
|
await c(session, guess?.trim());
|
|
15744
16129
|
});
|
|
15745
|
-
ctx.command("mcdle.帮助").action(async ({ session }) => bz(session));
|
|
15746
16130
|
ctx.command("mcdle.排行榜").action(async ({ session }) => phb(session));
|
|
15747
16131
|
ctx.command("mcdle.词库").action(async ({ session }) => ck(session));
|
|
15748
16132
|
ctx.command("mcdle.裸猜 [state:string]", "临时开关本群的无前缀续猜").usage("例:mcdle.裸猜(切换)· mcdle.裸猜 开 · mcdle.裸猜 关 · mcdle.裸猜 状态").action(async ({ session }, state) => {
|
|
@@ -15890,30 +16274,11 @@ function apply(ctx, cfg) {
|
|
|
15890
16274
|
const channelOn = middlewareOn(session.channelId);
|
|
15891
16275
|
await sendCard(
|
|
15892
16276
|
session,
|
|
15893
|
-
|
|
15894
|
-
|
|
16277
|
+
helpCard(cfg.dailyPlayLimit, cfg.allowRepeatedGuesses, channelOn),
|
|
16278
|
+
helpText(channelOn)
|
|
15895
16279
|
);
|
|
15896
16280
|
}
|
|
15897
16281
|
__name(mcdle, "mcdle");
|
|
15898
|
-
function introText(channelOn) {
|
|
15899
|
-
const total = mobData.length + itemData.length + blockData.length;
|
|
15900
|
-
return textCard(
|
|
15901
|
-
"MCDLE · 我的世界猜谜",
|
|
15902
|
-
`从 ${total} 个词条里,只凭属性提示锁定唯一答案。`,
|
|
15903
|
-
[
|
|
15904
|
-
`壹 mcdle.猜 苦力怕 用一个有效词条开局`,
|
|
15905
|
-
channelOn ? `贰 开局后可直接发送当前模式的词条名称继续猜测` : `贰 对照颜色与箭头缩小范围,每次猜测都会留在棋盘上`,
|
|
15906
|
-
`叁 猜中后自动记入 mcdle.排行榜`
|
|
15907
|
-
],
|
|
15908
|
-
[
|
|
15909
|
-
`生物 ${mobData.length} · 物品 ${itemData.length} · 方块 ${blockData.length}`,
|
|
15910
|
-
`每日 ${cfg.dailyPlayLimit} 局,跨零点重置`,
|
|
15911
|
-
`裸猜 mcdle.裸猜 开/关 临时调整本群续猜方式`,
|
|
15912
|
-
`完整规则:mcdle.帮助`
|
|
15913
|
-
]
|
|
15914
|
-
);
|
|
15915
|
-
}
|
|
15916
|
-
__name(introText, "introText");
|
|
15917
16282
|
function middlewareSwitchText(on, temporary, reverted) {
|
|
15918
16283
|
const mark = on ? "✅" : "⛔";
|
|
15919
16284
|
const state = on ? "开启" : "停用";
|
|
@@ -16286,22 +16651,14 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16286
16651
|
);
|
|
16287
16652
|
}
|
|
16288
16653
|
__name(applyGuess, "applyGuess");
|
|
16289
|
-
function bz(session) {
|
|
16290
|
-
const channelOn = middlewareOn(session.channelId);
|
|
16291
|
-
return sendCard(
|
|
16292
|
-
session,
|
|
16293
|
-
helpCard(cfg.dailyPlayLimit, cfg.allowRepeatedGuesses, channelOn),
|
|
16294
|
-
helpText(channelOn)
|
|
16295
|
-
);
|
|
16296
|
-
}
|
|
16297
|
-
__name(bz, "bz");
|
|
16298
16654
|
function helpText(channelOn) {
|
|
16655
|
+
const total = mobData.length + itemData.length + blockData.length;
|
|
16299
16656
|
const legend = ["true", "mixed", "false", "false_up", "false_down"].map(
|
|
16300
16657
|
(s) => `${STATUS_META[s].emoji} ${STATUS_META[s].label}`
|
|
16301
16658
|
);
|
|
16302
16659
|
return textCard(
|
|
16303
|
-
"MCDLE
|
|
16304
|
-
|
|
16660
|
+
"MCDLE · 我的世界猜谜",
|
|
16661
|
+
`从 ${total} 个词条里,只凭属性提示锁定唯一答案。每局随机抽一个生物、物品或方块,首次猜测的词条属于哪一类,本局就在哪一类里出题。`,
|
|
16305
16662
|
legend,
|
|
16306
16663
|
[
|
|
16307
16664
|
"部分匹配的字段里,【】括起来的就是与答案重合的那几项。",
|
|
@@ -16313,6 +16670,12 @@ ${words.join(" ")}`).join("\n\n")
|
|
|
16313
16670
|
`方块 ${blockData.length} 条 · ${FIELDS.block.length} 项属性`
|
|
16314
16671
|
],
|
|
16315
16672
|
[
|
|
16673
|
+
`壹 mcdle.猜 苦力怕 用一个有效词条开局`,
|
|
16674
|
+
channelOn ? `贰 开局后可直接发送当前模式的词条名称继续猜测` : `贰 对照颜色与箭头缩小范围,每次猜测都会留在棋盘上`,
|
|
16675
|
+
`叁 猜中后自动记入 mcdle.排行榜`
|
|
16676
|
+
],
|
|
16677
|
+
[
|
|
16678
|
+
"mcdle 这份玩法与指令说明",
|
|
16316
16679
|
"mcdle.猜 [名称] 开始一局,或提交猜测",
|
|
16317
16680
|
"mcdle.猜 局中直接使用可回看当前棋盘",
|
|
16318
16681
|
"mcdle.裸猜 [开/关] 临时切换本群无前缀续猜",
|