-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
77 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,45 @@ | ||
import { space_grotesk } from '@/app/font'; | ||
import React from 'react'; | ||
import { RiArrowDownDoubleLine } from 'react-icons/ri'; | ||
import Navbar from './Navbar'; | ||
import InViewAnimateBottom from '../transitions/InViewAnimateBottom'; | ||
import { space_grotesk } from "@/app/font"; | ||
import React from "react"; | ||
import { RiArrowDownDoubleLine } from "react-icons/ri"; | ||
import Navbar from "./Navbar"; | ||
import InViewAnimateBottom from "../transitions/InViewAnimateBottom"; | ||
|
||
const Hero = () => { | ||
return ( | ||
<div> | ||
<div className='relative flex justify-center items-center text-whiteAlpha-900 bg-black xl:pt-11 xl:pb-24 h-[calc(40vh-65px)] md:h-[calc(60vh-65px)] lg:h-[calc(80vh-65px)]'> | ||
<video className='w-full h-full object-cover' autoPlay muted loop> | ||
<source src='/hero.mp4' type='video/mp4' /> | ||
</video> | ||
<div className='absolute bottom-0 hidden xl:block w-full h-[180px] z-10 bg-video-gradient bg-no-repeat' /> | ||
<div className='absolute top-0 hidden xl:block w-full h-[100px] z-10 bg-video-gradient-top bg-no-repeat' /> | ||
<div className='absolute bg-black/60 flex justify-center w-full h-[calc(40vh-65px)] md:h-[calc(60vh-65px)] lg:h-[calc(80vh-65px)] xl:h-[calc(70vh-65px)]'> | ||
<div className='max-w-[1536px] mx-auto'> | ||
<div className='flex flex-col items-center w-full justify-center relative overflow-y-hidden h-full'> | ||
<div className='flex text-center md:text-left items-center md:items-start flex-col justify-start mx-auto gap-1 sm:gap-5 w-full px-4 sm:px-0 max-w-6xl'> | ||
<InViewAnimateBottom> | ||
<h1 | ||
className={`text-2xl sm:text-4xl md:text-5xl animate-fade-in xl:text-[60px] 2xl:text-[70px] !leading-tight text-center font-bold ${space_grotesk.className}`} | ||
> | ||
Building a more intelligent future through the IQ token. | ||
</h1> | ||
</InViewAnimateBottom> | ||
<InViewAnimateBottom className='mx-auto'> | ||
<p className='text-sm sm:text-lg max-w-[513px] lg:max-w-2xl text-center mx-auto lg:text-xl'> | ||
Join our mission to expand the scope of human knowledge with | ||
BrainDAO, the governing DAO powering the IQ ecosystem. | ||
</p> | ||
</InViewAnimateBottom> | ||
<a href={'#iq-token'} className='mt-4 mx-auto animate-bounce'> | ||
<RiArrowDownDoubleLine size={24} /> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
return ( | ||
<div> | ||
<div className="relative flex justify-center items-center text-whiteAlpha-900 bg-black xl:pt-11 xl:pb-24 h-[calc(40vh-65px)] md:h-[calc(60vh-65px)] lg:h-[calc(80vh-65px)]"> | ||
<video className="w-full h-full object-cover" autoPlay muted loop> | ||
<source src="/hero.mp4" type="video/mp4" /> | ||
</video> | ||
<div className="absolute bottom-0 hidden xl:block w-full h-[180px] z-10 bg-video-gradient bg-no-repeat" /> | ||
<div className="absolute top-0 hidden xl:block w-full h-[100px] z-10 bg-video-gradient-top bg-no-repeat" /> | ||
<div className="absolute bg-black/60 flex justify-center w-full h-[calc(40vh-65px)] md:h-[calc(60vh-65px)] lg:h-[calc(80vh-65px)] xl:h-[calc(70vh-65px)]"> | ||
<div className="max-w-[1536px] mx-auto"> | ||
<div className="flex flex-col items-center w-full justify-center relative overflow-y-hidden h-full"> | ||
<div className="flex text-center md:text-left items-center md:items-start flex-col justify-start mx-auto gap-1 sm:gap-5 w-full px-4 sm:px-0 max-w-6xl"> | ||
<InViewAnimateBottom> | ||
<h1 | ||
className={`text-2xl sm:text-4xl md:text-5xl animate-fade-in xl:text-[60px] 2xl:text-[70px] !leading-tight text-center font-bold ${space_grotesk.className}`} | ||
> | ||
Building a more intelligent future through the IQ token. | ||
</h1> | ||
</InViewAnimateBottom> | ||
<InViewAnimateBottom className="mx-auto"> | ||
<p className="text-sm sm:text-lg max-w-[513px] lg:max-w-2xl text-center mx-auto lg:text-xl"> | ||
Join our mission to expand the scope of human knowledge with | ||
BrainDAO, the governing DAO powering the IQ ecosystem. | ||
</p> | ||
</InViewAnimateBottom> | ||
<a href={"#iq-token"} className="mt-4 mx-auto animate-bounce"> | ||
<RiArrowDownDoubleLine size={24} /> | ||
</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Hero; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,48 @@ | ||
'use client'; | ||
"use client"; | ||
|
||
import { useAnimation, motion } from 'framer-motion'; | ||
import React, { useEffect, useState } from 'react'; | ||
import { useInView } from 'react-intersection-observer'; | ||
import { useAnimation, motion } from "framer-motion"; | ||
import React, { useEffect, useState } from "react"; | ||
import { useInView } from "react-intersection-observer"; | ||
|
||
export type TInViewAnimate = { | ||
children: React.ReactNode; | ||
className?: string; | ||
delay?: number; | ||
children: React.ReactNode; | ||
className?: string; | ||
delay?: number; | ||
}; | ||
const InViewAnimateBottom: React.FC<TInViewAnimate> = ({ | ||
children, | ||
className, | ||
delay, | ||
children, | ||
className, | ||
delay, | ||
}) => { | ||
const { ref, inView } = useInView(); | ||
const animation = useAnimation(); | ||
const [hasAnimated, setHasAnimated] = useState(false); | ||
const { ref, inView } = useInView(); | ||
const animation = useAnimation(); | ||
const [hasAnimated, setHasAnimated] = useState(false); | ||
|
||
useEffect(() => { | ||
if (inView && !hasAnimated) { | ||
setHasAnimated(true); | ||
animation.start({ | ||
// y: 0, | ||
opacity: 1, | ||
transition: { | ||
type: 'tween', | ||
duration: 1.5, | ||
}, | ||
}); | ||
} | ||
if (!inView && !hasAnimated) { | ||
animation.start({ | ||
// y: "5vw", | ||
opacity: 0.2, | ||
}); | ||
} | ||
}, [animation, delay, inView, hasAnimated]); | ||
useEffect(() => { | ||
if (inView && !hasAnimated) { | ||
setHasAnimated(true); | ||
animation.start({ | ||
// y: 0, | ||
opacity: 1, | ||
transition: { | ||
type: "tween", | ||
duration: 1.5, | ||
}, | ||
}); | ||
} | ||
if (!inView && !hasAnimated) { | ||
animation.start({ | ||
// y: "5vw", | ||
opacity: 0.2, | ||
}); | ||
} | ||
}, [animation, delay, inView, hasAnimated]); | ||
|
||
return ( | ||
<div ref={ref} className={`${className}`}> | ||
<motion.div animate={animation}>{children}</motion.div> | ||
</div> | ||
); | ||
return ( | ||
<div ref={ref} className={`${className}`}> | ||
<motion.div animate={animation}>{children}</motion.div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default InViewAnimateBottom; |