dsh-cyrene-theme-change 0.11.3 → 0.11.4

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 +33 -6
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -559,6 +559,21 @@ body[data-dsh-cyrene][data-ds-dark-theme]{
559
559
  user-select:none;
560
560
  }
561
561
  .cyre-switch input{accent-color:var(--cy-ui-accent)}
562
+ /* 玻璃不透明度滑块:给个明确的轨道和拇指,默认外观在部分 WebView 上是细线,很难拖 */
563
+ .cyre-range{
564
+ width:120px;height:18px;margin:0 2px;cursor:pointer;
565
+ accent-color:var(--cy-ui-accent,#e8699f);
566
+ }
567
+ .cyre-range::-webkit-slider-runnable-track{
568
+ height:4px;border-radius:999px;
569
+ background:linear-gradient(90deg,var(--cy-ui-accent,#e8699f),rgba(160,120,150,.28));
570
+ }
571
+ .cyre-range::-webkit-slider-thumb{
572
+ -webkit-appearance:none;appearance:none;
573
+ width:14px;height:14px;margin-top:-5px;border-radius:50%;
574
+ background:#fff;border:1.5px solid var(--cy-ui-accent,#e8699f);
575
+ box-shadow:0 1px 4px rgba(160,90,130,.35);
576
+ }
562
577
  .cyre-status{margin-left:auto;font-size:12px;color:var(--cy-ui-soft)}
563
578
  .cyre-status[data-tone="ok"]{color:#3f9d76}
564
579
  .cyre-status[data-tone="error"]{color:#d4518f}
@@ -2573,6 +2588,7 @@ body[data-dsh-cyrene] [data-composer-input][data-placeholder^="Describe what you
2573
2588
  const stickersBox = pick("stickers");
2574
2589
  const petBox = pick("pet");
2575
2590
  const glassHeavyBox = pick("glassHeavy");
2591
+ let sliding = false;
2576
2592
  const glassAlphaRange = pick("glassAlpha");
2577
2593
  const glassAlphaVal = pick("glassAlphaVal");
2578
2594
  const petEmotionLine = pick("pet-emotion");
@@ -2880,7 +2896,8 @@ body[data-dsh-cyrene] [data-composer-input][data-placeholder^="Describe what you
2880
2896
  stickersBox.checked = state.stickers !== false;
2881
2897
  petBox.checked = state.pet === true;
2882
2898
  if (glassHeavyBox !== null) glassHeavyBox.checked = state.glassHeavy === true;
2883
- if (glassAlphaRange !== null) {
2899
+ // 正在拖的时候不要回写,否则每次状态刷新都会把滑块拽回去
2900
+ if (glassAlphaRange !== null && sliding !== true) {
2884
2901
  const alpha = Number.isFinite(state.glassAlpha) ? state.glassAlpha : 0.55;
2885
2902
  glassAlphaRange.value = String(alpha);
2886
2903
  if (glassAlphaVal !== null) glassAlphaVal.textContent = Math.round(alpha * 100) + "%";
@@ -2942,16 +2959,26 @@ body[data-dsh-cyrene] [data-composer-input][data-placeholder^="Describe what you
2942
2959
  });
2943
2960
  petBox.addEventListener("change", () => {
2944
2961
  void save({ pet: petBox.checked }).then(paint);
2945
- if (glassHeavyBox !== null) glassHeavyBox.addEventListener("change", () => {
2962
+ });
2963
+ // 玻璃的两个控件要挂在这一层——之前误放进桌宠的 change 回调里,
2964
+ // 结果只有勾过桌宠之后滑块才"活",表现就是怎么拖都没反应。
2965
+ if (glassHeavyBox !== null) {
2966
+ glassHeavyBox.addEventListener("change", () => {
2946
2967
  void save({ glassHeavy: glassHeavyBox.checked }).then(paint);
2947
2968
  });
2948
- if (glassAlphaRange !== null) glassAlphaRange.addEventListener("input", () => {
2949
- if (glassAlphaVal !== null) glassAlphaVal.textContent = Math.round(Number(glassAlphaRange.value) * 100) + "%";
2969
+ }
2970
+ if (glassAlphaRange !== null) {
2971
+ glassAlphaRange.addEventListener("input", () => {
2972
+ sliding = true;
2973
+ if (glassAlphaVal !== null) {
2974
+ glassAlphaVal.textContent = Math.round(Number(glassAlphaRange.value) * 100) + "%";
2975
+ }
2950
2976
  });
2951
- if (glassAlphaRange !== null) glassAlphaRange.addEventListener("change", () => {
2977
+ glassAlphaRange.addEventListener("change", () => {
2978
+ sliding = false;
2952
2979
  void save({ glassAlpha: Number(glassAlphaRange.value) }).then(paint);
2953
2980
  });
2954
- });
2981
+ }
2955
2982
 
2956
2983
  // 状态筛选只重画卡片,不发请求(筛选是纯本地的)。
2957
2984
  memxFilter.addEventListener("change", () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-cyrene-theme-change",
3
- "version": "0.11.3",
3
+ "version": "0.11.4",
4
4
  "description": "昔涟(Cyrene)主题:粉白渐变毛玻璃 UI + 侧边栏可编辑的人格设定 + 表情包 / 背景图 / 世界书 + 认知记忆(L0/L1/L2 分层、成色衰减、语义召回、账本与健康行、压缩反思)与关系情绪 | A Cyrene (Honkai: Star Rail) theme for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",