fix: prevent UseCaseSection bubble clipping during pin+scrub

- Remove paddingBottom from vpH in usePinScrub so content text and CTA
  button are not clipped at the bottom of the pinned viewport
- Increase section height to calc(100vh+60px) to contain left bubble at
  rest (top-80 + h-160 = 960px exceeds 100vh on short viewports)
- Split parallax: right bubble keeps y:200 (down), left bubble uses
  y:-60 (up) so neither overflows the section with overflow-hidden

Amp-Thread-ID: https://ampcode.com/threads/T-019d926d-2a12-726c-befa-fa62ffd1d112
Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
DrJKL
2026-04-15 12:00:58 -07:00
parent 97b3e7061e
commit 618af430a1
3 changed files with 5 additions and 7 deletions

View File

@@ -57,13 +57,14 @@ const uid = useId()
const leftBlobId = `left-blob-${uid}`
const rightBlobId = `right-blob-${uid}`
useParallax([leftImgRef, rightImgRef], { trigger: sectionRef })
useParallax([rightImgRef], { trigger: sectionRef })
useParallax([leftImgRef], { trigger: sectionRef, y: -60 })
</script>
<template>
<section
ref="sectionRef"
class="bg-primary-comfy-ink relative flex flex-col items-center overflow-hidden px-8 py-20 lg:h-screen lg:px-0 lg:py-24"
class="bg-primary-comfy-ink relative flex flex-col items-center overflow-hidden px-8 py-20 lg:h-[calc(100vh+60px)] lg:px-0 lg:py-24"
>
<!-- Clip-path definitions for shaped images -->
<svg class="absolute" width="0" height="0" aria-hidden="true">

View File

@@ -61,10 +61,7 @@ export function usePinScrub(refs: PinScrubRefs, options: PinScrubOptions) {
const contentRect = content.getBoundingClientRect()
const sectionStyle = getComputedStyle(section)
contentH = content.scrollHeight
vpH =
window.innerHeight -
parseFloat(sectionStyle.paddingTop) -
parseFloat(sectionStyle.paddingBottom)
vpH = window.innerHeight - parseFloat(sectionStyle.paddingTop)
buttonCenters = Array.from(nav.querySelectorAll(':scope > *')).map(
(btn) => {
const btnRect = btn.getBoundingClientRect()

View File

@@ -109,7 +109,7 @@ const translations = {
'zh-CN': '启动云端'
},
'getStarted.step1.or': {
en: 'or',
en: ' or ',
'zh-CN': '或'
},
'getStarted.step2.title': {