fix 前端优化

This commit is contained in:
npc0-hue
2026-07-21 13:44:23 +08:00
parent 0cb91b5f88
commit b06623d0ce
11 changed files with 386 additions and 149 deletions
+14
View File
@@ -28,6 +28,17 @@ describe("platform web theme palettes", () => {
expect(palette.variables["--sparkle-gold"]).toContain("rgba");
expect(palette.variables["--panel-material"]).toContain("var");
expect(palette.variables["--menu-item-bg"]).toContain("gradient");
expect(palette.variables["--orbital-construct-image"]).toBe(
palette.id === "magical-girl" ? "url(\"/theme/magical-circle.svg\")" : "url(\"/theme/stellar-megastructure.svg\")"
);
expect(palette.variables["--orbital-construct-filter"]).toContain("drop-shadow");
expect(palette.variables["--orbital-construct-filter"]).not.toContain("invert(");
expect(palette.variables["--orbital-construct-filter"]).not.toContain("hue-rotate(");
expect(palette.variables["--orbital-construct-filter"]).not.toContain("sepia(");
expect(palette.variables["--orbital-construct-filter"]).not.toContain("brightness(");
expect(palette.variables["--magic-lightfall"]).toContain("linear-gradient");
expect(palette.variables["--magic-side-rays"]).toContain("linear-gradient");
expect(palette.variables["--command-ring-sheen"]).toContain("radial-gradient");
expect(palette.variables["--frame-accessory-top"]).toContain("data:image/svg+xml");
expect(palette.variables["--frame-accessory-bottom"]).toContain("data:image/svg+xml");
expect(palette.variables["--frame-accessory-opacity"]).toMatch(/^0\.\d{2}$/);
@@ -92,7 +103,10 @@ describe("platform web theme palettes", () => {
applyThemePalette("mecha-black");
expect(removeProperty).toHaveBeenCalledWith("--frame-accessory-heart");
expect(removeProperty).toHaveBeenCalledWith("--orbital-construct-image");
expect(removeProperty).toHaveBeenCalledWith("--magic-side-rays");
expect(setProperty).toHaveBeenCalledWith("--accent", "#48e6ff");
expect(setProperty).toHaveBeenCalledWith("--orbital-construct-image", "url(\"/theme/stellar-megastructure.svg\")");
expect(dispatchEvent).toHaveBeenCalledWith(
expect.objectContaining({
type: themePaletteChangeEvent,