Skip to content

Commit

Permalink
hero section implemented
Browse files Browse the repository at this point in the history
  • Loading branch information
sanidhyy authored Sep 21, 2024
1 parent e175060 commit ad1e2d3
Show file tree
Hide file tree
Showing 5 changed files with 139 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { Header } from "./sections/Header";
import { Hero } from "./sections/Hero";

export const App = () => {
return (
<main className="overflow-hidden">
<Header />

<Hero />
</main>
);
};
70 changes: 70 additions & 0 deletions src/components/Button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import type { PropsWithChildren } from "react";
import { cn } from "../lib/utils";
import { Marker } from "./Marker";

interface ButtonProps {
icon?: string;
href?: string;
onClick?: () => void;
containerClassName?: string;
markerFill?: string;
}

export const Button = ({
icon,
children,
href,
onClick,
containerClassName,
markerFill,
}: PropsWithChildren<ButtonProps>) => {
const Inner = () => (
<>
<span className="relative flex items-center min-h-[60px] px-4 g4 rounded-2xl inner-before group-hover:before:opacity-100 overflow-hidden">
<span className="absolute -left-[1px]">
<Marker fill={markerFill} />
</span>

{icon && (
<img
src={icon}
alt="circle"
className="size-10 mr-5 object-contain z-10"
/>
)}

<span className="relative z-2 font-poppins base-bold text-p1 uppercase">
{children}
</span>

<span className="glow-before glow-after" />
</span>
</>
);

if (href) {
return (
<a
href={href}
className={cn(
"relative p-0.5 g5 rounded-2xl shadow-500 group",
containerClassName
)}
>
<Inner />
</a>
);
}

return (
<button
onClick={onClick}
className={cn(
"relative p-0.5 g5 rounded-2xl shadow-500 group",
containerClassName
)}
>
<Inner />
</button>
);
};
22 changes: 22 additions & 0 deletions src/components/Marker.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
interface MarkerProps {
fill?: string;
}

export const Marker = ({ fill }: MarkerProps) => {
return (
<svg
width="8"
height="22"
viewBox="0 0 8 22"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
fillRule="evenodd"
clipRule="evenodd"
d="M2.5 0H0.5V4V18V22H2.5V16.25L7.63991 11.7526C8.09524 11.3542 8.09524 10.6458 7.63991 10.2474L2.5 5.75V0Z"
fill={fill || "#2EF2FF"}
/>
</svg>
);
};
8 changes: 5 additions & 3 deletions src/sections/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ export const Header = () => {
return (
<header className="fixed top-0 left-0 z-50 w-full py-10">
<div className="container flex h-14 items-center max-lg:px-5">
<a href="/" className="lg:hidden flex-1 z-2 cursor-pointer">
<img src="/images/xora.svg" width={115} height={55} alt="logo" />
</a>
<div className="lg:hidden flex-1 z-2">
<a href="/" className="block w-fit cursor-pointer">
<img src="/images/xora.svg" width={115} height={55} alt="logo" />
</a>
</div>

<div
className={cn(
Expand Down
39 changes: 39 additions & 0 deletions src/sections/Hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Element, Link as LinkScroll } from "react-scroll";
import { Button } from "../components/Button";

export const Hero = () => {
return (
<section className="relative pt-60 pb-40 max-lg:pt-52 max-lg:pb-36 max-md:pt-36 max-md:pb-32">
<Element name="hero">
<div className="container">
<div className="relative z-2 max-w-512 max-lg:max-w-388">
<div className="caption small-2 uppercase text-p3">
Video Editing
</div>

<h1 className="mb-6 h1 text-p4 uppercase max-lg:mb-7 max-lg:h2 max-md:mb-4 max-md:text-5xl max-md:leading-12">
Amazingly simple
</h1>

<p className="max-2-440 mb-14 body-1 max-md:mb-10">
We designed Xora AI Video Editor to be an easy to use, quick to
learn, and surprisingly powerful.
</p>

<LinkScroll to="features" offset={-100} spy smooth>
<Button icon="/images/zap.svg">Try it now</Button>
</LinkScroll>
</div>

<div className="absolute -top-32 left-[calc(50%_-_340px)] w-[1230px] pointer-events-none hero-img_res">
<img
src="/images/hero.png"
className="size-1230 max-lg:h-auto"
alt="hero"
/>
</div>
</div>
</Element>
</section>
);
};

0 comments on commit ad1e2d3

Please sign in to comment.