Skip to content

Commit

Permalink
fixed the landing page of core
Browse files Browse the repository at this point in the history
  • Loading branch information
woobin committed Jul 17, 2023
1 parent 14359a9 commit 982e3c0
Show file tree
Hide file tree
Showing 17 changed files with 448 additions and 61 deletions.
90 changes: 44 additions & 46 deletions core/components/BuyEggSection/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import CustomLoader from "../CustomLoader";
import { useGetAvailableEggs } from "../../state/zoo/hooks";
import { useGif } from "../../context/GifContext";
import { useZooKeeper } from "../../hooks";

import dynamic from "next/dynamic";
const ModelViewer = dynamic(() => import("components/ModelViewer"), {
ssr: false,
});
interface BuyEggSectionProps {}

const BuyEggSection: FC<BuyEggSectionProps> = ({}) => {
Expand All @@ -19,7 +22,27 @@ const BuyEggSection: FC<BuyEggSectionProps> = ({}) => {
const zookeeper = useZooKeeper();

const [isLoadingEggs, setIsLoadingEggs] = useState(false);

const eggs = [
{
title: "Endangerd Egg",
href: "/",
usdz: "/models/Eggs/origin_endangered_egg_2.usdz",
glb: "/models/Eggs/origin_endangered_egg_2.glb",
},

{
title: "Sublime Egg",
href: "/",
usdz: "/models/Eggs/origin_sublime_egg.usdz",
glb: "/models/Eggs/origin_sublime_egg.glb",
},
{
title: "Rare Egg",
href: "/",
usdz: "/models/Eggs/origin_rare_egg.usdz",
glb: "/models/Eggs/origin_rare_egg.glb",
},
]
useEffect(() => {
if (zookeeper) {
getAvailableEggs(setIsLoadingEggs);
Expand All @@ -31,58 +54,33 @@ const BuyEggSection: FC<BuyEggSectionProps> = ({}) => {
<h1 className="font-bold text-3xl md:text-[44px] leading-[3rem] lg:leading-4 text-center ">

<Link href="/drop">
Buy Gen 0 NFTs.
{"Buy Origin Egg NFTs."}
</Link>

</h1>
<p className="text-sm sm:text-base mt-4 mb-8 sm:mt-12 sm:mb-16 text-center">
<Link href="/drop">
Each Egg from the Gen 0 drop could mint 1,500+ NFT Animals.
{"Each Origin Egg can mint 1,500+ NFTs."}
</Link>
</p>

{isLoadingEggs ? (
<CustomLoader />
) : (
<div className="grid sm:grid-cols-2 lg:grid-cols-3 gap-6">
{availableEggs.map((data: any) => {
return (
<div
className="w-full flex flex-col items-center mb-4 AnimalFamily__nfts bg-black rounded-md pb-4"
key={data.id}
>
<div className="flex flex-col items-center w-full h-[300px] AnimalFamily__image">
<div className="p-px mb-2.5 overflow-hidden h-full w-full">
<div className="overflow-hidden bg-black rounded-md h-full w-full">
<video
autoPlay
loop={true}
playsInline={true}
muted
className="overflow-hidden rounded object-cover object-center max-h-full w-full"
>
<source src={data.animation_url}></source>
</video>
</div>
</div>
</div>
<div className="pr-4 w-full text-center flex justify-end">
<Link href={`/market/egg/${data.id}`} passHref legacyBehavior>
<button className="outline-none rounded-full bg-33 w-12 h-12 flex items-center justify-center ">
<Image
src="/icons/forward-arrow.svg"
width={24}
height={24}
alt=""
/>
</button>
</Link>
</div>
</div>
);
})}
</div>
)}
<div className="flex max-md:flex-col items-center justify-center gap-8">
{eggs.map((data, index) => (
<div className="bg-black w-[220px] h-[288px] p-2 relative">
<ModelViewer className='aspect-square'
usdz={data.usdz}
glb={data.glb}
></ModelViewer>
<Link href={data.href} className="bg-[#333] rounded-full absolute bottom-2 right-2 p-[6px] w-[39px] h-[39px] text-center">
<svg width="27" height="27" viewBox="0 0 27 27" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M15.8708 6.52246L22.5469 13.1985L15.8708 19.8746" stroke="white" stroke-width="1.31982" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
<path d="M3.84943 13.1982H22.3599" stroke="white" stroke-width="1.31982" stroke-miterlimit="10" stroke-linecap="round" stroke-linejoin="round"/>
</svg>

</Link>
</div>
))}
</div>
</div>
</div>
);
Expand Down
139 changes: 131 additions & 8 deletions core/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,133 @@
import React, { FC } from "react";

const Header: FC<React.HTMLAttributes<HTMLDivElement>> = ({
children,
className = "",
}) => (
<>{children}</>
);
import React, { useState } from 'react';
import Link from 'next/link';
import "@fontsource/poppins";
function Header() {
const [isOpen, setIsOpen] = useState(false);

const toggleMenu = () => {
setIsOpen(!isOpen);
};

return (
<nav className="bg-black w-full">
<div className="max-md:fixed w-full max-md:left-0 max-md:z-[999] max-md:bg-black px-4 sm:px-6 lg:px-8 xl:px-12">
<div className="flex items-center justify-between h-20">
<div className="md:hidden">
<button
type="button"
onClick={toggleMenu}
className="text-white inline-flex items-center justify-center p-2 "
aria-controls="mobile-menu"
aria-expanded={isOpen}
>
<span className="sr-only">Open main menu</span>
{!isOpen ? (
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M19 17.5H1V16H19V17.5ZM13 10.5H1V9H13V10.5ZM1 3.5V2H19V3.5H1Z" fill="white"/>
</svg>
) : (
<svg
className="h-6 w-6"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth="2"
d="M6 18L18 6M6 6l12 12"
/>
</svg>
)}
</button>
</div>
<div className="flex items-center max-md:ml-[36px]">
<div className="flex-shrink-0">

<Link
href="/"
className="text-gray-300 hover:text-white px-3 py-2 text-md font-medium">
<img alt="ZOO" src="/zooLogo.svg" style={{ width: 64, height: 64 }} />
</Link>
</div>
</div>
<div className="hidden md:block">
<div className="mx-10 flex items-baseline xl:space-x-16 md:space-x-4 lg:space-x-8 2xl:space-x-20">
<Link
href="/animals"
className="text-gray-300 hover:text-white px-3 py-2 text-md font-medium"
>
Market Place
</Link>
<Link
href="/about"
className="text-gray-300 hover:text-white px-3 py-2 text-md font-medium"
>
Animal Drops
</Link>
<Link
href="/campaign"
className="text-gray-300 hover:text-white px-3 py-2 text-md font-medium"
>
Community
</Link>
<Link
href="/getinvolved"
className="text-gray-300 hover:text-white px-3 py-2 text-md font-medium"
>
Learn

</Link>
{/* Add more links here */}
</div>
</div>
<div className='flex items-center'>
<Link
href="/donation"
className="text-white hover:bg-gray-700 bg-black px-6 py-1 border border-white rounded-full text-md font-medium md:block"
>
Connect Wallet
</Link>
</div>
</div>
</div>
{isOpen && (
<div className="md:hidden fixed z-50 h-[100vh] top-20 w-full bg-black" id="mobile-menu">
<div className="px-2 pt-2 pb-3 space-y-1 sm:px-3">
<Link
href="/animals"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Animals
</Link>

<Link
href="/about"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Mission
</Link>
<Link
href="/campaign"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
Campaign
</Link>
<Link
href="/getinvolved"
className="text-gray-300 hover:bg-gray-700 hover:text-white block px-3 py-2 rounded-md text-base font-medium"
>
<>
Get Involved
</>
</Link>
</div>
</div>
)}
</nav>
);
}

export default Header;
6 changes: 4 additions & 2 deletions core/components/home/HeroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const HeroSection = () => {

return (
<div className=" flex items-center justify-center relative Hero bg-zooo">
<div className="relative m-0 -mt-5 overflow-hidden w-ful">
<div className="relative m-0 overflow-hidden w-ful">
<div
className={`flex w-[100vw] absolute h-full transition duration-1000 ease-in whitespace-nowrap mt-4 `}
>
Expand All @@ -127,7 +127,8 @@ const HeroSection = () => {
{slide.title}
</h1>

<Link href={slide.uri} passHref legacyBehavior>
<Link href={slide.uri}>
<>
<button
onMouseOut={() => videoCurrent?.play()}
onMouseOver={() => videoCurrent?.pause()}
Expand All @@ -137,6 +138,7 @@ const HeroSection = () => {
? `Buy ${capitalize(slide.type)} - $${slide.price}`
: "Explore the Zoo"}
</button>
</>
</Link>
</div>
</div>
Expand Down
5 changes: 3 additions & 2 deletions core/components/home/MarketPlaceSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,16 @@ const MarketPlaceSection = ({ slideData }: any) => {
<Link
href="/partnerships"
className="flex items-center justify-between w-full"
legacyBehavior>
>
<>
<span className="mr-2">Donate Now</span>
<Image
src="/icons/forward-arrow-black.svg"
width={32}
height={32}
alt=""
/>

</>
</Link>
</div>
<div className="px-2 lg:px-6 py-3 text-[16px] font-semibold bg-transparent border border-[#A6A6A6] text-[#A6A6A6] flex items-center justify-between rounded-full w-full md:text-lg md:px-6 hover:cursor-pointer">
Expand Down
Loading

0 comments on commit 982e3c0

Please sign in to comment.