Skip to content

Commit 63d7536

Browse files
momoclaude
authored andcommitted
Fix rabbit ear clipping: remove will-change that creates stale compositing layer
will-change: left, bottom created a fixed-size compositing layer (30×30px) based on the initial layout box. When sizeBoost scaled the rabbit larger via CSS transform, the ears extending beyond this cached layer were clipped. Hovering triggered a filter transition that forced a layer recomputation, which is why ears appeared correctly on hover but not during normal animation. Removing will-change lets the browser repaint with correct bounds each frame. Also reverts the unnecessary headroom increase from the previous attempt. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 59b8dcc commit 63d7536

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

docs/.vitepress/components/PixelRobots.vue

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ function measureGround() {
164164
const footer = document.querySelector('.VPFooter')
165165
if (footer && container.value) {
166166
const h = footer.offsetHeight
167-
const sh = h + 200
167+
const sh = h + 160
168168
container.value.style.height = sh + 'px'
169169
container.value.style.marginTop = -sh + 'px'
170170
groundY.value = h
@@ -313,7 +313,7 @@ function initScene() {
313313
: 10 + Math.floor(Math.random() * 5)
314314
clouds.value = Array.from({ length: clCount }, (_, ci) => ({
315315
x: Math.random() * (w + 60) - 30,
316-
y: 55 + Math.random() * 70,
316+
y: 45 + Math.random() * 50,
317317
speed: 0.04 + Math.random() * 0.08,
318318
scale: 0.55 + Math.random() * 0.65,
319319
opacity: wt === 'clear' ? 0.25 + Math.random() * 0.15
@@ -330,7 +330,7 @@ function initScene() {
330330
const bright = Math.random()
331331
return {
332332
x: Math.random() * w,
333-
y: 60 + Math.random() * 135,
333+
y: 50 + Math.random() * 105,
334334
r: 0.3 + bright * 0.9,
335335
delay: Math.random() * 5,
336336
duration: 1.8 + Math.random() * 3,
@@ -1735,8 +1735,8 @@ function svgFilter(r) {
17351735
.scene-strip {
17361736
position: relative;
17371737
width: 100%;
1738-
height: 240px;
1739-
margin-top: -240px;
1738+
height: 200px;
1739+
margin-top: -200px;
17401740
z-index: 11;
17411741
user-select: none;
17421742
touch-action: none;
@@ -1836,7 +1836,6 @@ function svgFilter(r) {
18361836
transform: translateX(-15px);
18371837
pointer-events: auto;
18381838
transition: filter 0.2s ease;
1839-
will-change: left, bottom;
18401839
filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
18411840
z-index: 6;
18421841
}

0 commit comments

Comments
 (0)