|
1 | 1 | import React from "react"; |
2 | 2 | import { ArrowRight, Github } from "lucide-react"; |
3 | 3 | import sort from "../assets/sorting.png" |
| 4 | +import { useNavigate } from "react-router-dom"; |
| 5 | + |
4 | 6 |
|
5 | 7 | const sections = [ |
6 | 8 | { |
7 | 9 | title: "Sorting Algorithms", |
8 | 10 | description: |
9 | 11 | "Visualize step-by-step how sorting algorithms organize data efficiently.", |
10 | 12 | phase: "Phase 1 (MVP)", |
11 | | - img: {sort}, |
| 13 | + img: "https://tamimehsan.github.io/AlgorithmVisualizer/images/sort.png?height=200&width=300", |
| 14 | + link: "/sorting", |
12 | 15 | }, |
13 | 16 | { |
14 | 17 | title: "Searching Algorithms", |
15 | 18 | description: |
16 | 19 | "Understand linear and binary search methods through live visualization.", |
17 | 20 | phase: "Phase 1 (MVP)", |
18 | 21 | img: "", |
| 22 | + link: "/searching" |
19 | 23 | }, |
20 | 24 | { |
21 | 25 | title: "Pathfinding Algorithms", |
22 | 26 | description: |
23 | 27 | "Watch how A*, Dijkstra and BFS explore grids to find the optimal path.", |
24 | 28 | phase: "Phase 1 (MVP)", |
25 | 29 | img: "", |
| 30 | + link: "/pathfinding" |
26 | 31 | }, |
27 | 32 | { |
28 | 33 | title: "Graph Algorithms", |
29 | 34 | description: |
30 | 35 | "Explore BFS, DFS, Kruskal’s, Prim’s, and more — all brought to life interactively.", |
31 | 36 | phase: "Phase 2", |
32 | 37 | img: "", |
| 38 | + link: "/graphs" |
33 | 39 | }, |
34 | 40 | { |
35 | 41 | title: "Recursion & Backtracking", |
36 | 42 | description: |
37 | 43 | "Visualize recursive calls and backtracking patterns like N-Queens or Sudoku.", |
38 | 44 | phase: "Phase 2", |
39 | 45 | img: "", |
| 46 | + link: "/recursion" |
40 | 47 | }, |
41 | 48 | { |
42 | 49 | title: "Data Structures Visualization", |
43 | 50 | description: |
44 | 51 | "Interactively understand stacks, queues, linked lists, trees, and heaps.", |
45 | 52 | phase: "Phase 2", |
46 | 53 | img: "", |
| 54 | + link: "/data-structures" |
47 | 55 | }, |
48 | 56 | { |
49 | 57 | title: "Dynamic Programming", |
50 | 58 | description: |
51 | 59 | "Step through state transitions and table updates to grasp DP intuitively.", |
52 | 60 | phase: "Phase 3", |
53 | 61 | img: "", |
| 62 | + link: "/dynamic-programming" |
54 | 63 | }, |
55 | 64 | ]; |
56 | 65 |
|
57 | 66 |
|
58 | 67 | const Homepage = () => { |
| 68 | + const navigate = useNavigate(); |
| 69 | + |
59 | 70 | return ( |
60 | 71 | <div className="min-h-screen w-full text-white flex flex-col items-center overflow-x-hidden relative"> |
61 | 72 | {/* Full-Page Animated Gradient Background */} |
@@ -93,6 +104,7 @@ const Homepage = () => { |
93 | 104 | {sections.map((section, index) => ( |
94 | 105 | <div |
95 | 106 | key={index} |
| 107 | + onClick={() => section.link && navigate(section.link)} |
96 | 108 | className="relative group bg-white/10 border border-white/10 rounded-2xl overflow-hidden shadow-2xl hover:shadow-indigo-500/40 transition-all duration-300 backdrop-blur-md hover:-translate-y-2" |
97 | 109 | > |
98 | 110 | {/* Image */} |
|
0 commit comments