@lemoncat7/dsh-theme-xiaohei 0.3.3 → 0.3.5

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.
@@ -3,6 +3,14 @@ export const TAIL_JOINTS = [
3
3
  [284, 328], [310, 347], [324, 373], [319, 398],
4
4
  [307, 423], [307, 448], [319, 464],
5
5
  ];
6
+ /** Keep the ear root (and any hair below it) fixed; only flex the upper tip. */
7
+ export function earOffset(y, top, root, angle) {
8
+ const span = Math.max(1, root - top);
9
+ const weight = Math.max(0, Math.min(1, (root - y) / span));
10
+ if (weight === 0)
11
+ return 0;
12
+ return Math.sin(angle) * Math.min(20, span * .55) * weight * weight;
13
+ }
6
14
  export function solveBones(rest, angles) {
7
15
  return rest.reduce((out, p, i) => {
8
16
  const parent = out[i - 1];
@@ -47,7 +55,7 @@ export function rigAngles(progress, count, tail) {
47
55
  const envelope = Math.sin(Math.PI * t) ** 2;
48
56
  // Delayed distal joints create follow-through, with zero displacement/velocity
49
57
  // at both ends; no discrete frame lookup and no idle simulation.
50
- return Array.from({ length: count }, (_, i) => envelope * (tail ? (i ? .12 : 0) : .22)
58
+ return Array.from({ length: count }, (_, i) => envelope * (tail ? (i ? .12 : 0) : .32)
51
59
  * Math.sin(t * Math.PI * (tail ? 3 : 4) - i * (tail ? .65 : 1.1)));
52
60
  }
53
61
  //# sourceMappingURL=character-rig.js.map
@@ -5,8 +5,16 @@ export function createSidebarReveal(doc) {
5
5
  let observer;
6
6
  let phase = '', width = 0, waiting = false;
7
7
  const attribute = 'data-xiaohei-sidebar-reveal';
8
- const readPhase = () => shell?.className.includes('_collapsed') ? 'rail'
9
- : shell?.className.includes('_fading') ? 'closing' : 'wide';
8
+ const readPhase = () => {
9
+ const state = shell?.closest('[data-sidebar-collapsed]')?.getAttribute('data-sidebar-collapsed');
10
+ if (state === 'true')
11
+ return 'rail';
12
+ if (state === 'false')
13
+ return 'wide';
14
+ if (shell?.querySelector("button[aria-label='Collapse sidebar'], button[aria-label='收起侧边栏']"))
15
+ return 'wide';
16
+ return 'rail';
17
+ };
10
18
  const apply = () => {
11
19
  if (!shell)
12
20
  return;
@@ -41,7 +49,7 @@ export function createSidebarReveal(doc) {
41
49
  if (!shell)
42
50
  return;
43
51
  observer = new doc.defaultView.MutationObserver(changed);
44
- observer.observe(shell, { attributes: true, attributeFilter: ['class', 'style'] });
52
+ observer.observe(column, { subtree: true, childList: true, attributes: true, attributeFilter: ['data-sidebar-collapsed', 'aria-label', 'style'] });
45
53
  apply();
46
54
  },
47
55
  resize(nextWidth) { width = nextWidth; apply(); },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lemoncat7/dsh-theme-xiaohei",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "A Luo Xiaohei-inspired animated dark theme for DeepSeek Harness",
5
5
  "keywords": [
6
6
  "deepseek-harness",
@@ -30,6 +30,7 @@
30
30
  "lib/**/*.d.ts",
31
31
  "cordis.patch.yml",
32
32
  "README.md",
33
+ "docs/releases/0.3.5.md",
33
34
  "THIRD_PARTY_NOTICES.md",
34
35
  "LICENSE"
35
36
  ],