@aidget-community/grok-acrylic 0.0.0-stage → 0.1.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/agents.md ADDED
@@ -0,0 +1,31 @@
1
+ # grok-acrylic · Grok · 亚克力挂件
2
+
3
+ ## 用途
4
+
5
+ 展示蓝黑配色的 Grok 猫娘亚克力挂件。角色、科技小图案和 Grok 铭牌合为一张透明
6
+ PNG;原照片中的布面、显示器和支架不属于挂件。
7
+
8
+ ## 结构与素材
9
+
10
+ - `main.stage` 是唯一可替换区域 `stage`。位置和尺寸归用户控制,内容更新不得移动窗口。
11
+ - `.pendant-art` 负责显示 `assets/pendant.png`;`.pendant-shine` 用同一 PNG 的透明度作遮罩。
12
+ `.pendant` 按 `--art-ratio` 在窗口内居中,扫光的百分比坐标以这块方形画布为基准,不能
13
+ 改回按矩形窗口铺满。
14
+ - hover 反光由一枚白色径向柔光与一条斜向玻璃高光带组成,不使用角色主题色;两者都被
15
+ PNG 透明度遮罩限制在图案轮廓内。
16
+ - PNG 是包内运行资源,使用相对路径。`assets/screenshot.png` 仅供社区卡片预览。
17
+ - 保留猫耳、蓝色发束、终端和星形装饰、完整人物姿势以及底部 Grok 铭牌;四周透明留白
18
+ 和透明刀模边缘必须完整,不要裁切或加矩形背景。
19
+
20
+ ## 扫光、权限与刷新
21
+
22
+ - 内联脚本只在 `.pendant` 上监听鼠标位置和扫光动画,闲置时回到静止光位;动画收敛后
23
+ 停止申请帧。
24
+ - `prefers-reduced-motion` 下直接到达目标。不要增加常驻循环、远程资源或数据请求。
25
+ - `permissions` 仅保留 `script`,`network` 保持空数组;没有定时刷新。
26
+ - 页面使用 `aidget-surface="none"`,不要添加窗口材质或 `backdrop-filter`。
27
+
28
+ ## 平台
29
+
30
+ - `config.json` 按要求声明 `macos`、`windows` 和 `linux`;实际 Aidget 渲染检查目前只在
31
+ macOS 完成。其他系统出现差异时在实现层修复,不要删掉扫光效果或加平台分支。
Binary file
Binary file
package/config.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "id": "grok-acrylic",
3
+ "title": "Grok · 亚克力挂件",
4
+ "logo": null,
5
+ "screenshots": ["assets/screenshot.png"],
6
+ "platforms": ["macos", "windows", "linux"],
7
+ "size": { "width": 360, "height": 220 },
8
+ "dragMode": "all",
9
+ "permissions": ["script"],
10
+ "network": []
11
+ }
package/index.html ADDED
@@ -0,0 +1,96 @@
1
+ <!doctype html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
+ <meta name="aidget-surface" content="none" />
7
+ <link rel="stylesheet" href="style.css" />
8
+ <title>Grok · 亚克力挂件</title>
9
+ </head>
10
+ <body>
11
+ <main class="stage" data-aidget-region="stage">
12
+ <div class="pendant" role="img" aria-label="Grok 猫娘亚克力挂件">
13
+ <div class="pendant-art" aria-hidden="true"></div>
14
+ <div class="pendant-shine" aria-hidden="true">
15
+ <span class="shine-spot"></span>
16
+ <span class="shine-streak"></span>
17
+ </div>
18
+ </div>
19
+ </main>
20
+ <script>
21
+ (() => {
22
+ const pendant = document.querySelector('.pendant');
23
+ const root = document.documentElement;
24
+ const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
25
+ const REST = { x: 0.3, y: 0.2 };
26
+ const IDLE_GLOW = 0.42;
27
+ const clamp = (value, lo, hi) => Math.min(hi, Math.max(lo, value));
28
+ let target = { ...REST };
29
+ let pos = { ...REST };
30
+ let glow = { value: 0, target: IDLE_GLOW };
31
+ let running = false;
32
+
33
+ function paint() {
34
+ root.style.setProperty('--mx', `${(pos.x * 100).toFixed(2)}%`);
35
+ root.style.setProperty('--my', `${(pos.y * 100).toFixed(2)}%`);
36
+ root.style.setProperty('--shine', glow.value.toFixed(3));
37
+ }
38
+
39
+ function tick() {
40
+ const ease = reduceMotion.matches ? 1 : 0.18;
41
+ pos.x += (target.x - pos.x) * ease;
42
+ pos.y += (target.y - pos.y) * ease;
43
+ glow.value += (glow.target - glow.value) * (reduceMotion.matches ? 1 : 0.12);
44
+ paint();
45
+ const settled =
46
+ Math.abs(target.x - pos.x) < 0.002 &&
47
+ Math.abs(target.y - pos.y) < 0.002 &&
48
+ Math.abs(glow.target - glow.value) < 0.004;
49
+ if (settled) {
50
+ pos = { ...target };
51
+ glow.value = glow.target;
52
+ paint();
53
+ running = false;
54
+ return;
55
+ }
56
+ requestAnimationFrame(tick);
57
+ }
58
+
59
+ function wake() {
60
+ if (!running) {
61
+ running = true;
62
+ requestAnimationFrame(tick);
63
+ }
64
+ }
65
+
66
+ function follow(event) {
67
+ const rect = pendant.getBoundingClientRect();
68
+ if (!rect.width || !rect.height) return;
69
+ target.x = clamp((event.clientX - rect.left) / rect.width, -0.2, 1.2);
70
+ target.y = clamp((event.clientY - rect.top) / rect.height, -0.2, 1.2);
71
+ glow.target = 1;
72
+ wake();
73
+ }
74
+
75
+ function rest() {
76
+ target = { ...REST };
77
+ glow.target = IDLE_GLOW;
78
+ wake();
79
+ }
80
+
81
+ pendant.addEventListener('pointermove', follow);
82
+ pendant.addEventListener('pointerdown', follow);
83
+ pendant.addEventListener('pointerleave', rest);
84
+ window.addEventListener('blur', rest);
85
+ document.addEventListener('visibilitychange', () => {
86
+ if (document.hidden) rest();
87
+ });
88
+ paint();
89
+ wake();
90
+ if (window.aidget && typeof window.aidget.ready === 'function') {
91
+ window.aidget.ready();
92
+ }
93
+ })();
94
+ </script>
95
+ </body>
96
+ </html>
package/package.json CHANGED
@@ -1,6 +1,25 @@
1
1
  {
2
2
  "name": "@aidget-community/grok-acrylic",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Grok 猫娘主题的透明亚克力挂件桌面卡片,带鼠标跟随扫光。",
5
+ "license": "MIT",
6
+ "author": {
7
+ "name": "micooz",
8
+ "url": "https://github.com/micooz"
9
+ },
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/aidget-ai/widgets.git",
13
+ "directory": "packages/grok-acrylic"
14
+ },
15
+ "files": [
16
+ "config.json",
17
+ "index.html",
18
+ "style.css",
19
+ "agents.md",
20
+ "assets"
21
+ ],
22
+ "publishConfig": {
23
+ "access": "public"
24
+ }
25
+ }
package/style.css ADDED
@@ -0,0 +1,107 @@
1
+ :root {
2
+ color-scheme: light;
3
+ --sil: url(assets/pendant.png);
4
+ --art-ratio: 1;
5
+ --mx: 30%;
6
+ --my: 20%;
7
+ --shine: 0;
8
+ }
9
+
10
+ * {
11
+ box-sizing: border-box;
12
+ }
13
+
14
+ html,
15
+ body {
16
+ width: 100%;
17
+ height: 100%;
18
+ margin: 0;
19
+ overflow: hidden;
20
+ background: transparent;
21
+ }
22
+
23
+ .stage {
24
+ position: relative;
25
+ width: 100%;
26
+ height: 100%;
27
+ min-height: 120px;
28
+ display: grid;
29
+ place-items: center;
30
+ user-select: none;
31
+ -webkit-user-select: none;
32
+ }
33
+
34
+ .pendant {
35
+ position: relative;
36
+ width: min(100%, 100vh);
37
+ aspect-ratio: var(--art-ratio);
38
+ isolation: isolate;
39
+ }
40
+
41
+ .pendant-art {
42
+ position: absolute;
43
+ inset: 0;
44
+ z-index: 1;
45
+ background-image: var(--sil);
46
+ background-repeat: no-repeat;
47
+ background-position: center;
48
+ background-size: 100% 100%;
49
+ filter: drop-shadow(0 2px 3px rgb(14 40 64 / 30%));
50
+ }
51
+
52
+ .pendant-shine {
53
+ position: absolute;
54
+ inset: 0;
55
+ z-index: 2;
56
+ opacity: var(--shine);
57
+ mix-blend-mode: screen;
58
+ pointer-events: none;
59
+ -webkit-mask-image: var(--sil);
60
+ mask-image: var(--sil);
61
+ -webkit-mask-repeat: no-repeat;
62
+ mask-repeat: no-repeat;
63
+ -webkit-mask-position: center;
64
+ mask-position: center;
65
+ -webkit-mask-size: 100% 100%;
66
+ mask-size: 100% 100%;
67
+ }
68
+
69
+ .shine-spot,
70
+ .shine-streak {
71
+ position: absolute;
72
+ left: var(--mx);
73
+ top: var(--my);
74
+ }
75
+
76
+ .shine-spot {
77
+ width: 78%;
78
+ height: 78%;
79
+ transform: translate(-50%, -50%);
80
+ background-image: radial-gradient(
81
+ circle,
82
+ rgb(255 255 255 / 24%) 0%,
83
+ rgb(255 255 255 / 6%) 38%,
84
+ rgb(255 255 255 / 0%) 64%
85
+ );
86
+ }
87
+
88
+ .shine-streak {
89
+ width: 190%;
90
+ height: 17%;
91
+ transform: translate(-50%, -50%) rotate(-26deg);
92
+ background-image: linear-gradient(
93
+ 90deg,
94
+ rgb(255 255 255 / 0%) 0%,
95
+ rgb(255 255 255 / 30%) 36%,
96
+ rgb(255 255 255 / 58%) 50%,
97
+ rgb(255 255 255 / 30%) 64%,
98
+ rgb(255 255 255 / 0%) 100%
99
+ );
100
+ filter: blur(3px);
101
+ }
102
+
103
+ @media (prefers-reduced-motion: reduce) {
104
+ .shine-streak {
105
+ filter: blur(4px);
106
+ }
107
+ }
package/README.md DELETED
@@ -1,3 +0,0 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.