@@ -409,9 +417,12 @@ const props = withDefaults(defineProps<{
height?: number
// Collapse progress for hero layout
collapseProgress?: number
+ // Home scroll position for floating center capsule
+ heroScrollY?: number
}>(), {
height: 100,
- collapseProgress: 1
+ collapseProgress: 1,
+ heroScrollY: 0
})
defineEmits([
@@ -516,6 +527,8 @@ const getTokenIcon = (type: string) => {
const isHeroLayout = computed(() => props.isHomePage && !props.isClientArea)
const topRowHeight = 100
+const LANDING_CAPSULE_TOP_START = 450
+const LANDING_CAPSULE_TOP_STOP = 2
const rowStyle = computed(() => {
if (isHeroLayout.value) {
@@ -534,6 +547,24 @@ const centerStyle = computed(() => {
return { marginTop: `${top}px` }
})
+const isFloatingHomeCapsule = computed(() => isHeroLayout.value)
+
+const landingCapsuleTop = computed(() => {
+ if (!isFloatingHomeCapsule.value) return LANDING_CAPSULE_TOP_STOP
+ const y = Math.max(0, props.heroScrollY || 0)
+ return Math.max(LANDING_CAPSULE_TOP_STOP, LANDING_CAPSULE_TOP_START - y)
+})
+
+const searchCapsuleClass = computed(() => {
+ if (!isFloatingHomeCapsule.value) return 'w-full'
+ return 'w-full lg:fixed lg:left-1/2 lg:z-40 lg:w-[min(1120px,calc(100%-1.5rem))] lg:-translate-x-1/2 transition-[top] duration-200 ease-out'
+})
+
+const searchCapsuleStyle = computed(() => {
+ if (!isFloatingHomeCapsule.value) return undefined
+ return { top: `${landingCapsuleTop.value}px` }
+})
+
// Use white text on dark backgrounds (collapsed or home page with animation)
const useWhiteText = computed(() => props.isCollapsed || props.isHomePage)
diff --git a/app/components/page/CatalogPage.vue b/app/components/page/CatalogPage.vue
index 83a518c..a83e3b5 100644
--- a/app/components/page/CatalogPage.vue
+++ b/app/components/page/CatalogPage.vue
@@ -26,7 +26,7 @@
{{ $t('common.loading') }}
@@ -35,7 +35,7 @@