Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/pages/LandingPage/SupportedChains.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const SupportedChains = () => {
}, [chainCount, isTitleInView]);

return (
<section className="px-8 md:px-12 lg:px-24 bg-gray-100 py-8 text-center" id="supported-chains">
<section className="px-8 md:px-12 lg:px-24 bg-gray-100 pt-8 pb-2 text-center" id="supported-chains">
<motion.div
ref={titleRef}
initial={{ opacity: 0, y: 20 }}
Expand Down Expand Up @@ -69,10 +69,10 @@ const SupportedChains = () => {
animate={
areChainsInView
? {
opacity: 1,
y: [0, 0, -20],
transition: { duration: 0.6, delay: (index + Math.ceil(chains.length / 2)) * 0.1 },
}
opacity: 1,
y: [0, 0, -20],
transition: { duration: 0.6, delay: (index + Math.ceil(chains.length / 2)) * 0.1 },
}
: { opacity: 0 }
}
whileHover={{ scale: 1.1, transition: { duration: 0.1, delay: 0 } }}
Expand Down
22 changes: 18 additions & 4 deletions src/pages/LandingPage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const LandingPage = () => {
const velocityRef = useRef({ x: MAX_VELOCITY, y: MAX_VELOCITY }); // Store velocity
const positionRef = useRef({ x: 50, y: 50 }); // Store position
const [isVisible, setIsVisible] = useState(true);
const location = useLocation();
const { pathname, hash, key } = useLocation()

useEffect(() => {
const element = document.querySelector(".spotlight-effect") as HTMLElement;
Expand Down Expand Up @@ -82,15 +82,29 @@ const LandingPage = () => {

useEffect(() => {
// Handle direct route to dataset-playground
if (location.pathname === '/dataset-playground') {
if (pathname === '/dataset-playground') {
const element = document.getElementById('dataset-playground');
if (element) {
setTimeout(() => {
element.scrollIntoView({ behavior: 'smooth', });
}, 100);
}
}
Comment on lines +85 to 92
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose we cannot delete this because we already shared links with this link?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly. would have been better to use this approach from the beginning.

}, [location.pathname]);
}, [pathname]);

useEffect(() => {
if (hash !== '') {
setTimeout(() => {
const id = hash.replace('#', '')
const element = document.getElementById(id)
if (element) {
element.scrollIntoView({
behavior: 'smooth',
})
}
}, 100)
}
}, [pathname, hash, key])

return (
<div className="flex flex-col min-h-screen bg-gray-100 w-full">
Expand Down Expand Up @@ -197,7 +211,7 @@ const LandingPage = () => {
<AboutSection />
<SupportedChains />
{/* Verified contract stats */}
<section className="flex flex-col items-center px-8 md:px-12 lg:px-24 bg-gray-100 py-16">
<section className="flex flex-col items-center px-8 md:px-12 lg:px-24 bg-gray-100 pt-24 pb-16" id="contract-stats">
<VerifiedContracts />
</section>

Expand Down
Loading