Skip to content

Commit 1dae443

Browse files
committed
change requests
1 parent d93f366 commit 1dae443

File tree

3 files changed

+28
-3
lines changed

3 files changed

+28
-3
lines changed

app/[locale]/10years/_components/TenYearGlobe.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ const TenYearGlobe = ({ events }: { events: EventData[] }) => {
7373
if (globeRef.current) {
7474
globeRef.current.controls().autoRotate = true
7575
globeRef.current.controls().enablePan = false
76+
globeRef.current.controls().enableZoom = false
7677
globeRef.current.controls().autoRotateSpeed = 2.0
7778
globeRef.current.pointOfView({ lat: 0, lng: 0, altitude: 1.8 })
7879

@@ -101,6 +102,27 @@ const TenYearGlobe = ({ events }: { events: EventData[] }) => {
101102
)
102103
const [isTooltipHovered, setIsTooltipHovered] = useState(false)
103104
const [isMarkerHovered, setIsMarkerHovered] = useState(false)
105+
const lastScrollY = useRef(0)
106+
107+
useEffect(() => {
108+
const handleScroll = () => {
109+
const currentScrollY = window.scrollY
110+
const scrollDiff = Math.abs(currentScrollY - lastScrollY.current)
111+
112+
// Close tooltip if scrolled more than 20px
113+
if (scrollDiff > 20) {
114+
setHoveredEvent(null)
115+
setTooltipPos(null)
116+
setIsTooltipHovered(false)
117+
setIsMarkerHovered(false)
118+
}
119+
120+
lastScrollY.current = currentScrollY
121+
}
122+
123+
window.addEventListener("scroll", handleScroll)
124+
return () => window.removeEventListener("scroll", handleScroll)
125+
}, [])
104126

105127
// Memoize the Globe to prevent rerender on tooltip state changes
106128
const MemoizedGlobe = (

app/[locale]/10years/_components/TenYearHomeBanner.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@ const TenYearHomeBanner = () => {
1717
alt=""
1818
className="mx-auto -mb-2 -mt-16 max-w-[500px] object-contain sm:-mt-24 md:-mt-32"
1919
/>
20-
<TenYearDesktopText className="mx-auto mb-4 hidden w-full max-w-[800px] object-contain text-body md:block" />
21-
<TenYearMobileText className="mx-auto mb-4 block w-full max-w-[400px] object-contain text-body md:hidden" />
20+
<div className="flex justify-center">
21+
<TenYearDesktopText className="mb-4 hidden object-contain text-body md:block" />
22+
<TenYearMobileText className="mb-4 block object-contain text-body md:hidden" />
23+
</div>
2224
<div className="mb-4 flex flex-col gap-2">
2325
<p>
2426
<strong>On July 30, 2015, at 3:44 p.m. UTC,</strong> the first block

app/[locale]/page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { getRequiredNamespacesForPage } from "@/lib/utils/translations"
2121
import {
2222
BASE_TIME_UNIT,
2323
BLOG_FEEDS,
24+
BLOGS_WITHOUT_FEED,
2425
CALENDAR_DISPLAY_COUNT,
2526
RSS_DISPLAY_COUNT,
2627
} from "@/lib/constants"
@@ -110,7 +111,7 @@ const Page = async ({ params }: { params: Promise<{ locale: Lang }> }) => {
110111
name: source,
111112
href: sourceUrl,
112113
})) as CommunityBlog[]
113-
// blogLinks.push(...BLOGS_WITHOUT_FEED)
114+
blogLinks.push(...BLOGS_WITHOUT_FEED)
114115

115116
const props = {
116117
calendar,

0 commit comments

Comments
 (0)