Compare commits

...

2 Commits

Author SHA1 Message Date
2d87b7bdfd fix: hero 字母不可见 (渐变不继承) + 升级 text.splitText API
- .hero-letter 加自己的渐变 + -webkit-background-clip:text
  原因: 父 h1 的 -webkit-text-fill-color:transparent 继承到 span 但
  background 不继承,span 变成 box 就切断 background-clip:text 的连贯,
  span 里文字就全透明看不见

- text.split(...) → text.splitText(...)
  修掉 v4.3 的 deprecation warning

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-24 01:18:57 +08:00
aa67005534 auto-save 2026-04-24 01:17 (~1) 2026-04-24 01:17:57 +08:00
2 changed files with 23 additions and 4 deletions

View File

@@ -209,6 +209,20 @@
"message": "chore: gitignore playwright QA 产物",
"hash": "47c45e3",
"files_changed": 1
},
{
"ts": "2026-04-24T01:12:29+08:00",
"type": "commit",
"message": "auto-save 2026-04-24 01:12 (+1, ~2)",
"hash": "71ad32f",
"files_changed": 3
},
{
"ts": "2026-04-24T01:16:46+08:00",
"type": "commit",
"message": "feat: 加 8 个 Live Demo + hero 文字 stagger 动画",
"hash": "d24821c",
"files_changed": 1
}
]
}

View File

@@ -266,8 +266,13 @@
will-change:transform;
}
/* hero animated logo */
h1 .hero-letter{display:inline-block;will-change:transform,opacity,color}
/* hero animated logo —— 每个字母自带渐变剪影(父级 -webkit-text-fill-color:transparent 不继承背景,这里补回) */
h1 .hero-letter{
display:inline-block;will-change:transform,opacity,color;
background:linear-gradient(135deg,var(--accent) 0%,var(--accent3) 55%,var(--accent2) 100%);
-webkit-background-clip:text;background-clip:text;
-webkit-text-fill-color:transparent;
}
/* online badge */
.live-badge{
@@ -1591,8 +1596,8 @@ stickys.<span class="fn">forEach</span>(s =&gt; s.<span class="fn">revert</span>
let splitInstance = null;
function ensureSplit() {
if (splitInstance) splitInstance.revert && splitInstance.revert();
if (text && text.split) {
splitInstance = text.split(textTarget, { chars: { class: 'letter' } });
if (text && text.splitText) {
splitInstance = text.splitText(textTarget, { chars: { class: 'letter' } });
}
}
function textDemo(kind) {