build fixes
This commit is contained in:
parent
a04a665f24
commit
6f0a5cc2fa
@ -27,9 +27,14 @@ export default function Page() {
|
|||||||
</div>
|
</div>
|
||||||
<div className="p-4 space-y-2">
|
<div className="p-4 space-y-2">
|
||||||
{BUTTON_VARIANTS.map((variant) => (
|
{BUTTON_VARIANTS.map((variant) => (
|
||||||
<div className="grid grid-cols-5 gap-4">
|
<div className="grid grid-cols-5 gap-4" key={variant}>
|
||||||
{BUTTON_TYPES.map((type) => (
|
{BUTTON_TYPES.map((type) => (
|
||||||
<Button type={type} variant={variant} className="capitalize">
|
<Button
|
||||||
|
key={type}
|
||||||
|
type={type}
|
||||||
|
variant={variant}
|
||||||
|
className="capitalize"
|
||||||
|
>
|
||||||
{type} button
|
{type} button
|
||||||
</Button>
|
</Button>
|
||||||
))}
|
))}
|
||||||
|
|||||||
@ -13,7 +13,7 @@ export default function Button({
|
|||||||
className?: string;
|
className?: string;
|
||||||
// [x: string]:
|
// [x: string]:
|
||||||
}) {
|
}) {
|
||||||
const btnVariant = variant ?? "filled";
|
// const btnVariant = variant ?? "filled";
|
||||||
return (
|
return (
|
||||||
<button
|
<button
|
||||||
className={cn(
|
className={cn(
|
||||||
|
|||||||
@ -1,12 +1,12 @@
|
|||||||
import { getPayload } from "payload";
|
import { getPayload } from "payload";
|
||||||
import config from "@payload-config";
|
import config from "@payload-config";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import Image from "next/image";
|
// import Image from "next/image";
|
||||||
import { Image as PImage } from "@payload-types";
|
// import { Image as PImage } from "@payload-types";
|
||||||
|
|
||||||
const isValidLogo = (image: number | PImage): image is PImage => {
|
// const isValidLogo = (image: number | PImage): image is PImage => {
|
||||||
return typeof image !== "number";
|
// return typeof image !== "number";
|
||||||
};
|
// };
|
||||||
|
|
||||||
export default async function Header() {
|
export default async function Header() {
|
||||||
const payload = await getPayload({ config });
|
const payload = await getPayload({ config });
|
||||||
|
|||||||
@ -4,13 +4,14 @@ import { RichText } from "@payloadcms/richtext-lexical/react";
|
|||||||
import { motion, useScroll, useTransform } from "motion/react";
|
import { motion, useScroll, useTransform } from "motion/react";
|
||||||
import { useRef, useEffect, useState, useCallback } from "react";
|
import { useRef, useEffect, useState, useCallback } from "react";
|
||||||
import * as d3 from "d3";
|
import * as d3 from "d3";
|
||||||
|
import { HomeHero } from "@payload-types";
|
||||||
|
|
||||||
export default function HeroIntro({
|
export default function HeroIntro({
|
||||||
title,
|
title,
|
||||||
desc,
|
desc,
|
||||||
}: {
|
}: {
|
||||||
title: string;
|
title: string;
|
||||||
desc: any;
|
desc: HomeHero["heroGroup"]["heroDescription"];
|
||||||
}) {
|
}) {
|
||||||
const containerRef = useRef(null);
|
const containerRef = useRef(null);
|
||||||
const { scrollYProgress } = useScroll({
|
const { scrollYProgress } = useScroll({
|
||||||
@ -23,7 +24,7 @@ export default function HeroIntro({
|
|||||||
|
|
||||||
const [windowSize, setWindowSize] = useState<[number, number]>();
|
const [windowSize, setWindowSize] = useState<[number, number]>();
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
window.addEventListener("resize", (e) => {
|
window.addEventListener("resize", () => {
|
||||||
setWindowSize([window.innerWidth, window.innerHeight]);
|
setWindowSize([window.innerWidth, window.innerHeight]);
|
||||||
});
|
});
|
||||||
setWindowSize([window.innerWidth, window.innerHeight]);
|
setWindowSize([window.innerWidth, window.innerHeight]);
|
||||||
@ -48,7 +49,7 @@ export default function HeroIntro({
|
|||||||
const drawArea = d3
|
const drawArea = d3
|
||||||
.area()
|
.area()
|
||||||
.x((p) => xScale(p[0]))
|
.x((p) => xScale(p[0]))
|
||||||
.y0((p) => 0)
|
.y0(() => 0)
|
||||||
.y1((p) => yScale(p[1]));
|
.y1((p) => yScale(p[1]));
|
||||||
return drawArea(beam);
|
return drawArea(beam);
|
||||||
}, [windowSize, beamSize]);
|
}, [windowSize, beamSize]);
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default function HeroData({
|
|||||||
}: {
|
}: {
|
||||||
items: HomeHero["heroGroup"]["heroItems"];
|
items: HomeHero["heroGroup"]["heroItems"];
|
||||||
}) {
|
}) {
|
||||||
const itemKeys: (keyof typeof items)[] = Object.keys(items) as any;
|
const itemKeys = Object.keys(items) as (keyof typeof items)[];
|
||||||
const itemArray = itemKeys.map((k) => ({ key: k, ...items[k] }));
|
const itemArray = itemKeys.map((k) => ({ key: k, ...items[k] }));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -72,7 +72,7 @@ const Item = ({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
className="w-full h-screen max-w-6xl p-12 grid grid-cols-2 gap-12 z-10 items-center text-white"
|
className="w-full h-screen max-w-6xl p-12 grid grid-rows-2 lg:grid-cols-2 gap-12 z-10 items-center text-white"
|
||||||
>
|
>
|
||||||
<motion.div
|
<motion.div
|
||||||
style={{ opacity }}
|
style={{ opacity }}
|
||||||
|
|||||||
@ -2,14 +2,14 @@
|
|||||||
|
|
||||||
import { ReactNode, useEffect } from "react";
|
import { ReactNode, useEffect } from "react";
|
||||||
import Lenis from "lenis";
|
import Lenis from "lenis";
|
||||||
import Snap from "lenis/snap";
|
// import Snap from "lenis/snap";
|
||||||
|
|
||||||
export default function ({
|
export default function SmoothScroll({
|
||||||
children,
|
children,
|
||||||
snapAt,
|
// snapAt,
|
||||||
}: {
|
}: {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
snapAt?: string[];
|
// snapAt?: string[];
|
||||||
}) {
|
}) {
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const lenis = new Lenis();
|
const lenis = new Lenis();
|
||||||
|
|||||||
@ -27,13 +27,16 @@ export default async function Home() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<SmoothScroll snapAt={["section"]}>
|
<SmoothScroll>
|
||||||
<div className="text-white">
|
<div className="text-white">
|
||||||
<div className="absolute h-full mt-[var(--header-height)] w-full opacity-50 ">
|
<div className="absolute h-full mt-[var(--header-height)] w-full opacity-50 ">
|
||||||
<Image src={bgImage} alt="Bg image" objectFit="cover" />
|
<Image
|
||||||
|
src={bgImage}
|
||||||
|
alt="Bg image"
|
||||||
|
className="h-full w-full object-cover"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="h-screen pt-[var(--header-height)] flex flex-col items-center justify-end text-white pb-[10vh] relative">
|
<div className="h-screen pt-[var(--header-height)] flex flex-col items-center justify-end text-white pb-[10vh] relative">
|
||||||
{/* <ScrollingNumbers numbers={randomNumbers} /> */}
|
|
||||||
<h1 className="text-4xl p-8 lg:text-7xl leading-tight max-w-6xl z-10 font-display">
|
<h1 className="text-4xl p-8 lg:text-7xl leading-tight max-w-6xl z-10 font-display">
|
||||||
{titleGroup.title}
|
{titleGroup.title}
|
||||||
</h1>
|
</h1>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user