Skip to content
Merged
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
18 changes: 16 additions & 2 deletions src/pages/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useRef } from "react";
import { Link } from "react-router-dom";
import React, { useRef, useEffect } from "react";
import { Link, useLocation } from "react-router-dom";
import { motion } from "framer-motion";
import {
Sparkles,
Expand All @@ -24,6 +24,20 @@ import logo from "../assets/logo.png";

export const Home = () => {
const featureRailRef = useRef(null);
const location = useLocation();

useEffect(() => {
if (location.hash === "#features") {
setTimeout(() => {
const element = document.getElementById("features");
if (element) {
element.scrollIntoView({ behavior: "smooth" });
}
}, 100);
} else if (!location.hash) {
window.scrollTo({ top: 0, behavior: "smooth" });
}
}, [location]);

const scrollFeatures = (direction) => {
const rail = featureRailRef.current;
Expand Down
Loading