Skip to content

Commit

Permalink
feat: hero section complete
Browse files Browse the repository at this point in the history
  • Loading branch information
kirinnee committed Dec 28, 2024
1 parent 16d8eef commit 537798b
Show file tree
Hide file tree
Showing 14 changed files with 320 additions and 14 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"astro": "^5.1.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"framer-motion": "^11.15.0",
"lucide-react": "^0.469.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
Expand Down
1 change: 1 addition & 0 deletions src/assets/cloud.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/dark_app_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/light_app_logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions src/components/Nav.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
import { Button } from "./ui/button";
import logo from "../assets/light_app_logo.svg";
import { RainbowButton } from "@/components/ui/rainbow-button";
---

<div class="flex w-full justify-between items-center px-8 py-4 border-b-2 h-16">
<div class="logo">
<img class="w-[36px]" src={logo.src} alt="logo"/>
</div>
<Button className="py-4 px-4">Get Started</Button>
</div>
64 changes: 52 additions & 12 deletions src/components/index/Hero.astro
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,77 @@
import astroLogo from '../../assets/astro.svg';
import background from '../../assets/background.svg';
import logo from '../../assets/light_full_logo.svg';
import cloud from '../../assets/cloud.svg';
import mascot from "../../assets/mascot.png";
import splash from "../../assets/splash.svg";
import PulsatingButton from "@/components/ui/pulsating-button";
import {Button} from "../ui/button"
import {Input} from "../ui/input"
---

<div id="container">
<main class="gap-24">
<div class="flex flex-wrap items-center justify-center gap-12 w-[1000px]">
<div class="w-1/2 flex items-center justify-center" style="position: relative;">
<img style="position: absolute; z-index: 0" class="w-full" src={splash.src} alt="splash"/>
<div class="flex flex-wrap md:flex-nowrap items-center justify-center gap-2 md:gap-12 max-w-[1000px]">
<div class="w-2/3 md:w-1/2 flex items-center justify-center" style="position: relative;">
<img class="w-11/12 right-cloud" src={cloud.src} alt="cloud1"/>
<img class="w-11/12 left-cloud" src={cloud.src} alt="cloud2"/>
<img style="z-index: 1" src={mascot.src} alt="mascot" class="object-contain"/>
</div>
<div class="w-2/5 flex flex-col justify-center items-center gap-8">
<div class="text-sm text-center bg-[#FFF4DC] text-pink-600 py-2 px-8 header">WORKOUTS ARE FINALLY FUN</div>
<div class="w-2/3 md:w-2/5 flex flex-col justify-center items-center gap-4 md:gap-8">
<div class="text-xs md:text-sm text-center bg-[#FFF4DC] text-pink-600 py-2 px-8 header rounded-lg">
JOIN THE KKOMMUNITY
</div>
<div class="w-full">
<img src={logo.src} alt="logo"/>
</div>
<div class="text-xl font-light text-light text-sky-800"> We make you want to move move</div>
<div class="slogan text-lg md:text-xl font-light text-justify text-light text-sky-800">
feel the fun, make the move
</div>
<div class="w-full flex flex-col text-sm justify-center gap-4 center">
<Input className="text-center text-md" type="email" placeholder="Email"/>
<PulsatingButton className="text-md">Reserve your Spot</PulsatingButton>
</div>
</div>
</div>
<div class="w-[450px] flex flex-col text-sm justify-center gap-4 center">
<Input className="text-xl text-center" type="email" placeholder="Email"/>
<Button className="bg-sky-800">Join the Waitlist</Button>
</div>

</main>
</div>

<style>

@keyframes moveLeftRight {
0% {
transform: translateX(20px);
}
50% {
transform: translateX(-20px); /* Move to the right */
}
100% {
transform: translateX(20px); /* Move back to the original position */
}
}

.right-cloud {
position: absolute;
z-index: 0;
top: -9%;
left: 15%;
animation: moveLeftRight 4.5s infinite ease-in-out;
}


.left-cloud {
position: absolute;
z-index: 0;
top: -28%;
left:-30%;
animation: moveLeftRight 5s infinite ease-in-out;
}

.slogan {
font-family: 'Poppins', sans-serif;
}

.header {
font-family: 'DM Sans', sans-serif;
letter-spacing: 0.2em;
Expand All @@ -44,10 +85,9 @@ import {Input} from "../ui/input"
}

main {
height: 100vh;
height: calc( 100vh - 6rem - 2px );
display: flex;
flex-direction: column;
//background: #FFF4DC;
margin: auto;
align-items: center;
justify-content: center;
Expand Down
37 changes: 37 additions & 0 deletions src/components/ui/pulsating-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
'use client';

import React from 'react';

import { cn } from '@/lib/utils';

interface PulsatingButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
pulseColor?: string;
duration?: string;
}

export default function PulsatingButton({
className,
children,
pulseColor = '#0096ff',
duration = '1.5s',
...props
}: PulsatingButtonProps) {
return (
<button
className={cn(
'relative flex cursor-pointer items-center justify-center rounded-lg bg-blue-500 px-4 py-2 text-center text-white dark:bg-blue-500 dark:text-black',
className,
)}
style={
{
'--pulse-color': pulseColor,
'--duration': duration,
} as React.CSSProperties
}
{...props}
>
<div className="relative z-10">{children}</div>
<div className="absolute left-1/2 top-1/2 size-full -translate-x-1/2 -translate-y-1/2 animate-pulse rounded-lg bg-inherit" />
</button>
);
}
28 changes: 28 additions & 0 deletions src/components/ui/rainbow-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';

import { cn } from '@/lib/utils';
interface RainbowButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {}

export function RainbowButton({ children, className, ...props }: RainbowButtonProps) {
return (
<button
className={cn(
'group relative inline-flex h-11 animate-rainbow cursor-pointer items-center justify-center rounded-xl border-0 bg-[length:200%] px-8 py-2 font-medium text-primary-foreground transition-colors [background-clip:padding-box,border-box,border-box] [background-origin:border-box] [border:calc(0.08*1rem)_solid_transparent] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50',

// before styles
'before:absolute before:bottom-[-20%] before:left-1/2 before:z-0 before:h-1/5 before:w-3/5 before:-translate-x-1/2 before:animate-rainbow before:bg-[linear-gradient(90deg,hsl(var(--color-1)),hsl(var(--color-5)),hsl(var(--color-3)),hsl(var(--color-4)),hsl(var(--color-2)))] before:[filter:blur(calc(0.8*1rem))]',

// light mode colors
'bg-[linear-gradient(#121213,#121213),linear-gradient(#121213_50%,rgba(18,18,19,0.6)_80%,rgba(18,18,19,0)),linear-gradient(90deg,hsl(var(--color-1)),hsl(var(--color-5)),hsl(var(--color-3)),hsl(var(--color-4)),hsl(var(--color-2)))]',

// dark mode colors
'dark:bg-[linear-gradient(#fff,#fff),linear-gradient(#fff_50%,rgba(255,255,255,0.6)_80%,rgba(0,0,0,0)),linear-gradient(90deg,hsl(var(--color-1)),hsl(var(--color-5)),hsl(var(--color-3)),hsl(var(--color-4)),hsl(var(--color-2)))]',

className,
)}
{...props}
>
{children}
</button>
);
}
69 changes: 69 additions & 0 deletions src/components/ui/retro-grid.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import { cn } from '@/lib/utils';

interface RetroGridProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Additional CSS classes to apply to the grid container
*/
className?: string;
/**
* Rotation angle of the grid in degrees
* @default 65
*/
angle?: number;
/**
* Grid cell size in pixels
* @default 60
*/
cellSize?: number;
/**
* Grid opacity value between 0 and 1
* @default 0.5
*/
opacity?: number;
/**
* Grid line color in light mode
* @default "gray"
*/
lightLineColor?: string;
/**
* Grid line color in dark mode
* @default "gray"
*/
darkLineColor?: string;
}

export default function RetroGrid({
className,
angle = 65,
cellSize = 60,
opacity = 0.5,
lightLineColor = 'gray',
darkLineColor = 'gray',
...props
}: RetroGridProps) {
const gridStyles = {
'--grid-angle': `${angle}deg`,
'--cell-size': `${cellSize}px`,
'--opacity': opacity,
'--light-line': lightLineColor,
'--dark-line': darkLineColor,
} as React.CSSProperties;

return (
<div
className={cn(
'pointer-events-none absolute size-full overflow-hidden [perspective:200px]',
`opacity-[var(--opacity)]`,
className,
)}
style={gridStyles}
{...props}
>
<div className="absolute inset-0 [transform:rotateX(var(--grid-angle))]">
<div className="animate-grid [background-image:linear-gradient(to_right,var(--light-line)_1px,transparent_0),linear-gradient(to_bottom,var(--light-line)_1px,transparent_0)] [background-repeat:repeat] [background-size:var(--cell-size)_var(--cell-size)] [height:300vh] [inset:0%_0px] [margin-left:-200%] [transform-origin:100%_0_0] [width:600vw] dark:[background-image:linear-gradient(to_right,var(--dark-line)_1px,transparent_0),linear-gradient(to_bottom,var(--dark-line)_1px,transparent_0)]" />
</div>

<div className="absolute inset-0 bg-gradient-to-t from-white to-transparent to-90% dark:from-black" />
</div>
);
}
Loading

0 comments on commit 537798b

Please sign in to comment.