Skip to content

Commit

Permalink
feat(www): Added Updated New Hero section
Browse files Browse the repository at this point in the history
  • Loading branch information
alifarooq9 committed May 22, 2024
1 parent dd7fedd commit 4241790
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 185 deletions.
1 change: 1 addition & 0 deletions apps/www/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"@vercel/analytics": "^1.2.2",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.0",
"geist": "^1.3.0",
"lucide-react": "^0.343.0",
"next": "^14.1.0",
"next-themes": "^0.2.1",
Expand Down
3 changes: 2 additions & 1 deletion apps/www/src/app/(marketing)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { MarketingLayout } from "@/components/layout/marketing-layout";
import { Hero } from "@/components/marketing/hero";

export default function HomePage() {
return (
<MarketingLayout>
<h1>Marketing Page</h1>
<Hero />
</MarketingLayout>
);
}
Expand Down
6 changes: 2 additions & 4 deletions apps/www/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import "@/styles/globals.css";
import type { Metadata } from "next";
import { siteConfig } from "@/config/site";
import { Analytics } from "@vercel/analytics/react";
import { fontSans, fontHeading } from "@/lib/fonts";
import { fontSans } from "@/lib/fonts";

const TITLE =
"Rapidlaunch | Open Source Nextjs SaaS Starterkits and Components";
Expand Down Expand Up @@ -49,9 +49,7 @@ export default function RootLayout({
}) {
return (
<html lang="en">
<body
className={`${fontSans.variable} ${fontHeading.variable} font-sans`}
>
<body className={`${fontSans.className} font-sans antialiased`}>
<Providers>
{children}
<Toaster position="top-center" />
Expand Down
57 changes: 22 additions & 35 deletions apps/www/src/components/background.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,29 @@ interface BackgroundProps {
export function Background({ children }: BackgroundProps) {
return (
<>
<div className="absolute left-0 top-0 -z-50 h-full w-full overflow-hidden">
<div className="sticky left-0 top-0 h-full w-full overflow-hidden">
<div className="absolute inset-0 z-[-1] bg-muted-foreground/40" />
<div className="absolute left-[--x] top-[--y] z-[-1] h-56 w-56 -translate-x-1/2 -translate-y-1/2 rounded-full bg-gradient-radial from-muted-foreground/50 from-0% to-transparent to-90% blur-md" />
<svg
xmlns="http://www.w3.org/2000/svg"
width="100%"
height="100%"
<svg
className="absolute inset-0 -z-10 h-full w-full stroke-muted-foreground/15 [mask-image:radial-gradient(50%_80%_at_top,white,transparent)]"
aria-hidden="true"
>
<defs>
<pattern
id="0787a7c5-978c-4f66-83c7-11c213f99cb7"
width={200}
height={200}
x="50%"
y={-1}
patternUnits="userSpaceOnUse"
>
<defs>
<pattern
id="dotted-pattern"
width="16"
height="16"
patternUnits="userSpaceOnUse"
>
<circle cx="2" cy="2" r="1" fill="black" />
</pattern>
<mask id="dots-mask">
<rect width="100%" height="100%" fill="white" />
<rect
width="100%"
height="100%"
fill="url(#dotted-pattern)"
/>
</mask>
</defs>
<rect
width="100%"
height="100%"
fill="hsl(var(--background))"
mask="url(#dots-mask)"
/>
</svg>
</div>
</div>
<path d="M.5 200V.5H200" fill="none" />
</pattern>
</defs>
<rect
width="100%"
height="100%"
strokeWidth={0}
fill="url(#0787a7c5-978c-4f66-83c7-11c213f99cb7)"
/>
</svg>

{children}
</>
Expand Down
24 changes: 24 additions & 0 deletions apps/www/src/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,4 +221,28 @@ export const Icons = {
/>
</svg>
),
externalLink: (props: IconProps) => (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
color={"currentColor"}
fill={"none"}
{...props}
>
<path
d="M11.1005 3.00208C7.45162 3.00864 5.54086 3.09822 4.31974 4.31931C3.00195 5.63706 3.00195 7.75796 3.00195 11.9997C3.00195 16.2415 3.00195 18.3624 4.31974 19.6801C5.63753 20.9979 7.75849 20.9979 12.0004 20.9979C16.2423 20.9979 18.3632 20.9979 19.6811 19.6801C20.9021 18.4591 20.9917 16.5484 20.9983 12.8996"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
<path
d="M20.4809 3.51715L14.9316 9.05114M20.4809 3.51715C19.9869 3.02264 16.6593 3.06873 15.9558 3.07874M20.4809 3.51715C20.9748 4.01166 20.9288 7.34292 20.9188 8.04718"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
strokeLinejoin="round"
/>
</svg>
),
};
6 changes: 3 additions & 3 deletions apps/www/src/components/layout/marketing-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,23 @@ export function MarketingMainNav() {

<span
className={cn(
"flex h-5 w-5 items-center justify-center rounded-sm border-2 border-border",
"flex h-5 w-5 items-center justify-center rounded-sm border border-border",
pathname === item.href
? "bg-secondary"
: "",
)}
>
<Icons.circle
className={cn(
"h-2.5 w-2.5 transition-all",
"h-2 w-2",
pathname === item.href
? "block"
: "hidden",
)}
/>
<Icons.chevronRight
className={cn(
"h-2.5 w-2.5 transition-all",
"h-2.5 w-2.5",
pathname === item.href
? "hidden"
: "block",
Expand Down
15 changes: 15 additions & 0 deletions apps/www/src/components/layout/page-header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export function PageHeaderHeading({ children }: { children: React.ReactNode }) {
return (
<h1 className="text-center font-heading text-6xl font-bold leading-tight tracking-tighter lg:leading-[1.1]">
{children}
</h1>
);
}

export function PageHeaderDescription({
children,
}: {
children: React.ReactNode;
}) {
return <p className="text-center text-2xl font-medium">{children}</p>;
}
25 changes: 25 additions & 0 deletions apps/www/src/components/marketing/announment.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Icons } from "@/components/icons";
import { badgeVariants } from "@/components/ui/badge";
import { BorderBeam } from "@/components/ui/border-beam";
import { siteUrls } from "@/config/urls";
import { cn } from "@/lib/utils";
import Link from "next/link";

export function Announcment() {
return (
<Link
href={siteUrls.marketing.earlyAccess}
className={cn(
badgeVariants({
variant: "outline",
className:
"relative transition-all hover:border-primary/30",
}),
)}
>
Get Early Access for SaaS Starterkit
<Icons.externalLink className="ml-2 h-3.5 w-3.5" />
<BorderBeam size={40} duration={5} borderWidth={2} delay={16} />
</Link>
);
}
24 changes: 24 additions & 0 deletions apps/www/src/components/marketing/hero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { Background } from "@/components/background";
import {
PageHeaderDescription,
PageHeaderHeading,
} from "@/components/layout/page-header";
import { Announcment } from "@/components/marketing/announment";

export function Hero() {
return (
<Background>
<section className="flex flex-col items-center justify-center gap-6 py-16">
<Announcment />

<div className="grid gap-2">
<PageHeaderHeading>Copy. Build. Launch.</PageHeaderHeading>
<PageHeaderDescription>
<span className="font-bold">Open Source </span> SaaS
Starterkit, Building Blocks and Guides
</PageHeaderDescription>
</div>
</section>
</Background>
);
}
10 changes: 1 addition & 9 deletions apps/www/src/components/providers.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"use client";

import type { ReactNode } from "react";
import { ThemeProvider } from "@/components/theme-provider";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

interface ProvidersProps {
Expand All @@ -13,14 +12,7 @@ export default function Providers({ children }: ProvidersProps) {

return (
<QueryClientProvider client={queryClient}>
<ThemeProvider
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
{children}
</ThemeProvider>
{children}
</QueryClientProvider>
);
}
9 changes: 0 additions & 9 deletions apps/www/src/components/theme-provider.tsx

This file was deleted.

37 changes: 0 additions & 37 deletions apps/www/src/components/theme-toggle.tsx

This file was deleted.

17 changes: 13 additions & 4 deletions apps/www/src/components/ui/badge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import type { VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";

const badgeVariants = cva(
"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
"inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
{
variants: {
variant: {
Expand All @@ -15,11 +15,17 @@ const badgeVariants = cva(
"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
destructive:
"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
outline: "text-foreground",
outline: "text-foreground border-border",
},
size: {
sm: "px-2.5 h-8 text-xs",
default: "px-3 h-9 text-sm",
lg: "px-4 py-h-10 text-base",
},
},
defaultVariants: {
variant: "default",
size: "default",
},
},
);
Expand All @@ -28,9 +34,12 @@ export interface BadgeProps
extends React.HTMLAttributes<HTMLDivElement>,
VariantProps<typeof badgeVariants> {}

function Badge({ className, variant, ...props }: BadgeProps) {
function Badge({ className, variant, size, ...props }: BadgeProps) {
return (
<div className={cn(badgeVariants({ variant }), className)} {...props} />
<div
className={cn(badgeVariants({ variant, size }), className)}
{...props}
/>
);
}

Expand Down
51 changes: 51 additions & 0 deletions apps/www/src/components/ui/border-beam.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import { cn } from "@/lib/utils";

interface BorderBeamProps {
className?: string;
size?: number;
duration?: number;
borderWidth?: number;
anchor?: number;
colorFrom?: string;
colorTo?: string;
delay?: number;
}

const BorderBeam = ({
className,
size = 200,
duration = 15,
anchor = 90,
borderWidth = 1.5,
colorFrom = "#ffaa40",
colorTo = "#9c40ff",
delay = 0,
}: BorderBeamProps) => {
return (
<div
style={
{
"--size": size,
"--duration": duration,
"--anchor": anchor,
"--border-width": borderWidth,
"--color-from": colorFrom,
"--color-to": colorTo,
"--delay": `-${delay}s`,
} as React.CSSProperties
}
className={cn(
"absolute inset-[0] rounded-[inherit] [border:calc(var(--border-width)*1px)_solid_transparent]",

// mask styles
"![mask-clip:padding-box,border-box] ![mask-composite:intersect] [mask:linear-gradient(transparent,transparent),linear-gradient(white,white)]",

// pseudo styles
"after:animate-border-beam after:absolute after:aspect-square after:w-[calc(var(--size)*1px)] after:[animation-delay:var(--delay)] after:[background:linear-gradient(to_left,var(--color-from),var(--color-to),transparent)] after:[offset-anchor:calc(var(--anchor)*1%)_50%] after:[offset-path:rect(0_auto_auto_0_round_calc(var(--size)*1px))]",
className,
)}
/>
);
};

export { BorderBeam };
Loading

0 comments on commit 4241790

Please sign in to comment.