|
1 | | -import { Home, Info, LogIn, Mail,Star, Workflow } from "lucide-react"; |
| 1 | +import { Home, Info, LogIn, Mail, Star, Workflow } from "lucide-react"; |
2 | 2 | import React from "react"; |
3 | 3 |
|
| 4 | +// literally just for UX, clicking on any navbar buttons will scroll to that section instead of jumping instantly to that section |
| 5 | +const scrollTo = (id: string) => { |
| 6 | + // question mark makes function scrolls only if the id is valid (wihout it an invalid id will error react) |
| 7 | + document.getElementById(id)?.scrollIntoView({ |
| 8 | + behavior: "smooth", |
| 9 | + block: "start", |
| 10 | + }); |
| 11 | +}; |
| 12 | + |
4 | 13 | export default function AboutPage() { |
5 | 14 | return ( |
6 | | - <div className="min-h-screen bg-slate-100"> |
| 15 | + <div className="min-h-screen scroll-smooth bg-slate-100"> |
7 | 16 | <nav className="fixed bottom-6 left-1/2 z-50 -translate-x-1/2"> |
8 | 17 | <div className="flex items-center gap-6 rounded-full bg-[#000912] px-8 py-4 text-sm shadow-lg"> |
9 | | - <a |
10 | | - href="#welcome" |
| 18 | + <button |
| 19 | + onClick={() => scrollTo("welcome")} |
11 | 20 | className="flex items-center gap-2 text-gray-300 hover:text-white" |
12 | 21 | > |
13 | | - <Home className="h-5 w-5" /> |
| 22 | + <Home className="h-4 w-4" /> |
14 | 23 | Welcome |
15 | | - </a> |
| 24 | + </button> |
16 | 25 |
|
17 | | - <a |
18 | | - href="#about" |
| 26 | + <button |
| 27 | + onClick={() => scrollTo("about")} |
19 | 28 | className="flex items-center gap-2 text-gray-300 hover:text-white" |
20 | 29 | > |
21 | | - <Info className="h-5 w-5" /> |
| 30 | + <Info className="h-4 w-4" /> |
22 | 31 | About |
23 | | - </a> |
| 32 | + </button> |
24 | 33 |
|
25 | | - <a |
26 | | - href="#how" |
| 34 | + <button |
| 35 | + onClick={() => scrollTo("how")} |
27 | 36 | className="flex items-center gap-2 text-gray-300 hover:text-white" |
28 | 37 | > |
29 | | - <Workflow className="h-5 w-5" /> |
| 38 | + <Workflow className="h-4 w-4" /> |
30 | 39 | How It Works |
31 | | - </a> |
| 40 | + </button> |
32 | 41 |
|
33 | | - <a |
34 | | - href="#why" |
| 42 | + <button |
| 43 | + onClick={() => scrollTo("why")} |
35 | 44 | className="flex items-center gap-2 text-gray-300 hover:text-white" |
36 | 45 | > |
37 | | - <Star className="h-5 w-5" /> |
| 46 | + <Star className="h-4 w-4" /> |
38 | 47 | Why Us |
39 | | - </a> |
| 48 | + </button> |
40 | 49 |
|
41 | | - <a |
42 | | - href="#login" |
| 50 | + <button |
| 51 | + onClick={() => scrollTo("login")} |
43 | 52 | className="flex items-center gap-2 text-gray-300 hover:text-white" |
44 | 53 | > |
45 | | - <LogIn className="h-5 w-5" /> |
| 54 | + <LogIn className="h-4 w-4" /> |
46 | 55 | Get Started |
47 | | - </a> |
| 56 | + </button> |
48 | 57 |
|
49 | | - <a |
50 | | - href="#contact" |
| 58 | + <button |
| 59 | + onClick={() => scrollTo("contact")} |
51 | 60 | className="flex items-center gap-2 text-gray-300 hover:text-white" |
52 | 61 | > |
53 | | - <Mail className="h-5 w-5" /> |
| 62 | + <Mail className="h-4 w-4" /> |
54 | 63 | Contact |
55 | | - </a> |
| 64 | + </button> |
56 | 65 | </div> |
57 | 66 | </nav> |
58 | 67 |
|
|
0 commit comments