Skip to content

Commit 262e9cd

Browse files
committed
fix: adjust dog animations vertical alignment to match the grass line
1 parent 692c60b commit 262e9cd

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

contact.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,14 @@ <h2 class="headingfont text-[16px] md:text-[20px] font-bold mb-6 text-center tex
302302
}
303303
}
304304
const curH = gameContainer.offsetHeight;
305-
let dogY = curH * 0.75;
306-
const targetY = isPerfect ? curH * 0.49 : curH * 0.50;
305+
const rootFontSize = parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
306+
const dogHeight = (isPerfect ? 14 : 11) * rootFontSize;
307+
308+
// Start position (hidden under the grass)
309+
let dogY = curH * 0.88;
310+
311+
// Peak position (feet slightly below the grass line at 85%)
312+
const targetY = (curH * 0.86) - dogHeight;
307313

308314
dog.style.top = `${dogY}px`;
309315
dog.classList.remove('hidden');
@@ -318,7 +324,7 @@ <h2 class="headingfont text-[16px] md:text-[20px] font-bold mb-6 text-center tex
318324
const slideDown = setInterval(() => {
319325
dogY += 4;
320326
dog.style.top = `${dogY}px`;
321-
if (dogY >= curH * 0.75) {
327+
if (dogY >= curH * 0.88) {
322328
clearInterval(slideDown);
323329
dog.classList.add('hidden');
324330
dog.style.width = '';

0 commit comments

Comments
 (0)