@iasiv5/dsh-skins 1.5.1 → 1.5.2

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.
Files changed (2) hide show
  1. package/lib/client.js +52 -4
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -306,6 +306,14 @@
306
306
  }
307
307
  const blur = backdrop.blur ?? 0;
308
308
  if (typeof blur !== "number" || !(blur >= 0 && blur <= 24)) return null;
309
+ const desktopBlur = backdrop.desktopBlur ?? null;
310
+ if (desktopBlur !== null) {
311
+ if (!isPlainObject(desktopBlur)) return null;
312
+ for (const key of ["light", "dark"]) {
313
+ const value = desktopBlur[key];
314
+ if (typeof value !== "number" || !Number.isFinite(value) || value < 0 || value > 24) return null;
315
+ }
316
+ }
309
317
  }
310
318
  const tokenOverrides = source.tokenOverrides ?? null;
311
319
  if (tokenOverrides !== null) {
@@ -340,7 +348,8 @@
340
348
  imageDark: backdrop.imageDark ?? null,
341
349
  overlayLight: backdrop.overlayLight ?? null,
342
350
  overlayDark: backdrop.overlayDark ?? null,
343
- blur: backdrop.blur ?? 0
351
+ blur: backdrop.blur ?? 0,
352
+ desktopBlur: backdrop.desktopBlur ?? null
344
353
  },
345
354
  tokenOverrides,
346
355
  cssVariables,
@@ -503,6 +512,23 @@
503
512
  rules.push(`${darkSelector}::after{background-image:${backdrop.overlayDark}}`);
504
513
  }
505
514
  }
515
+ const desktopBlur = backdrop.desktopBlur ?? null;
516
+ if (desktopBlur !== null && (backdrop.imageLight !== null || backdrop.imageDark !== null)) {
517
+ const desktopSelector = `html[data-windows-titlebar] ${selector}`;
518
+ const blurDeclarations = (blur) => `filter:blur(${blur}px);transform:scale(1.02);`;
519
+ if (desktopBlur.light === desktopBlur.dark) {
520
+ if (desktopBlur.light > 0) {
521
+ rules.push(`${desktopSelector}::before{${blurDeclarations(desktopBlur.light)}}`);
522
+ }
523
+ } else {
524
+ if (desktopBlur.light > 0) {
525
+ rules.push(`${desktopSelector}:not([data-ds-dark-theme])::before{${blurDeclarations(desktopBlur.light)}}`);
526
+ }
527
+ if (desktopBlur.dark > 0) {
528
+ rules.push(`${desktopSelector}[data-ds-dark-theme]::before{${blurDeclarations(desktopBlur.dark)}}`);
529
+ }
530
+ }
531
+ }
506
532
  return rules.length === 0 ? null : rules.join("\n");
507
533
  }
508
534
  function variablesCss(effects) {
@@ -2472,6 +2498,7 @@ ${names}`);
2472
2498
  const scrimLight = `linear-gradient(rgba(252, 250, 246, ${s}) 0%, rgba(252, 250, 246, ${s}) 100%)`;
2473
2499
  const scrimDark = `linear-gradient(rgba(16, 16, 26, ${s}) 0%, rgba(16, 16, 26, ${s}) 100%)`;
2474
2500
  const blurPx = Math.round(12 * t * t);
2501
+ const desktopBlurPx = Math.min(24, blurPx + values.panelOpacity / 55);
2475
2502
  const wallpaperUrl = assets?.wallpaper?.url ?? null;
2476
2503
  const imageLight = wallpaperUrl === null ? null : `url("${wallpaperUrl}")`;
2477
2504
  const imageDark = wallpaperUrl === null ? null : `url("${wallpaperUrl}")`;
@@ -2480,7 +2507,14 @@ ${names}`);
2480
2507
  slogans: values.slogan ?? SLOGANS,
2481
2508
  titleBrand: "美人志",
2482
2509
  favicon: { href: MARK_URL, mime: "image/webp" },
2483
- backdrop: { imageLight, imageDark, overlayLight: scrimLight, overlayDark: scrimDark, blur: blurPx },
2510
+ backdrop: {
2511
+ imageLight,
2512
+ imageDark,
2513
+ overlayLight: scrimLight,
2514
+ overlayDark: scrimDark,
2515
+ blur: blurPx,
2516
+ desktopBlur: { light: desktopBlurPx, dark: desktopBlurPx }
2517
+ },
2484
2518
  tokenOverrides,
2485
2519
  cssVariables: blurPx > 0 ? { "--dsh-mrz-glass-blur": { light: `${blurPx}px`, dark: `${blurPx}px` } } : null,
2486
2520
  staticCss: blurPx > 0 ? CSS2 + "\n" + GLASS_RULE : CSS2,
@@ -2995,12 +3029,18 @@ ${names}`);
2995
3029
  const imageLight = custom ? `url("${url}")` : BACKGROUND_ART === "" ? PLACEHOLDER_LIGHT : scrimLight;
2996
3030
  const imageDark = custom ? `url("${url}")` : BACKGROUND_ART === "" ? PLACEHOLDER_DARK : scrimDark;
2997
3031
  const blurPx = Math.round(24 * Math.pow(Math.max(0, (P - 55) / 45), 2));
3032
+ const desktopExtraBlurPx = P / 55;
3033
+ const desktopBlur = {
3034
+ light: Math.min(24, blurPx + desktopExtraBlurPx),
3035
+ dark: blurPx
3036
+ // OpenBMC dark remains the approved reference baseline.
3037
+ };
2998
3038
  return {
2999
3039
  bodyAttribute: "dshOpenbmcSkin",
3000
3040
  slogans: values.slogan ?? SLOGANS2,
3001
3041
  titleBrand: "OpenBMC Studio",
3002
3042
  favicon: { href: FAVICON_DATA_URL, mime: FAVICON_MIME },
3003
- backdrop: { imageLight, imageDark, overlayLight: null, overlayDark: null, blur: blurPx },
3043
+ backdrop: { imageLight, imageDark, overlayLight: null, overlayDark: null, blur: blurPx, desktopBlur },
3004
3044
  tokenOverrides,
3005
3045
  cssVariables: blurPx > 0 ? { "--dsh-openbmc-glass-blur": { light: `${blurPx}px`, dark: `${blurPx}px` } } : null,
3006
3046
  staticCss: blurPx > 0 ? CSS3 + "\n" + GLASS_RULE2 : CSS3,
@@ -3308,12 +3348,20 @@ body[data-dsh-uefi-harness][data-ds-dark-theme] .lc-tip {
3308
3348
  const imageLight = custom ? `url("${url}")` : scrimLight;
3309
3349
  const imageDark = custom ? `url("${url}")` : scrimDark;
3310
3350
  const blurPx = Math.round(24 * Math.pow(Math.max(0, (P - 55) / 45), 2));
3351
+ const desktopBlurPx = Math.min(24, blurPx + P / 55);
3311
3352
  return {
3312
3353
  bodyAttribute: "dshUefiHarness",
3313
3354
  slogans: values.slogan ?? SLOGANS2,
3314
3355
  titleBrand: "UEFI Studio",
3315
3356
  favicon: { href: favicon, mime: "image/svg+xml" },
3316
- backdrop: { imageLight, imageDark, overlayLight: null, overlayDark: null, blur: blurPx },
3357
+ backdrop: {
3358
+ imageLight,
3359
+ imageDark,
3360
+ overlayLight: null,
3361
+ overlayDark: null,
3362
+ blur: blurPx,
3363
+ desktopBlur: { light: desktopBlurPx, dark: desktopBlurPx }
3364
+ },
3317
3365
  tokenOverrides,
3318
3366
  cssVariables: blurPx > 0 ? { "--dsh-uefi-glass-blur": { light: `${blurPx}px`, dark: `${blurPx}px` } } : null,
3319
3367
  staticCss: blurPx > 0 ? css + "\n" + GLASS_RULE2 : css,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iasiv5/dsh-skins",
3
3
  "description": "DSH Web 皮肤插件:多套品牌皮肤侧栏热切换。",
4
- "version": "1.5.1",
4
+ "version": "1.5.2",
5
5
  "homepage": "https://github.com/iasiv5/dsh-skins#readme",
6
6
  "repository": {
7
7
  "type": "git",