Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhgray committed Oct 30, 2023
2 parents 6e5d3be + 95fa67d commit 1d6172b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
3 changes: 2 additions & 1 deletion web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@

import './globals.css'
import { Unbounded } from 'next/font/google'
import localFont from "next/font/local"

const unbounded = Unbounded({ subsets: ['latin'], variable: '--font-unbounded' })
const unbounded = Unbounded({ subsets: ['latin'], variable: '--font-unbounded', display: 'swap' })
const neue_machina = localFont({
src: '/NeueMachina-Regular.otf',
variable: '--font-neuemachina'
Expand Down
2 changes: 1 addition & 1 deletion web/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export default function Home() {


return <main id='main-thing' ref={mainRef} className='h-[100vh] overflow-auto overflow-x-hidden snap-y'>
<StartAnim onComplete={() => { setStartAnimationComplete(true) }} />
{!startAnimationComplete && <StartAnim onComplete={() => { setStartAnimationComplete(true) }} />}
{
startAnimationComplete &&
<>
Expand Down
11 changes: 6 additions & 5 deletions web/components/StartAnim.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

import { Player, PlayerEvent } from "@lottiefiles/react-lottie-player";
import LoadingAnimation from "../animations/loading_anim.json";
import { useEffect } from "react";
import { CSSProperties, useEffect } from "react";
type Props = {
onComplete: () => void
onComplete: () => void;
style?: CSSProperties
}
const StartAnim = ({ onComplete }: Props) => {
const StartAnim = ({ onComplete, style }: Props) => {

useEffect(() => {
const timeout = setTimeout(() => { onComplete() }, 15100)
Expand All @@ -15,10 +16,10 @@ const StartAnim = ({ onComplete }: Props) => {
}
})

return <div className="fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center bg-dark -z-10"><Player
return <div className="fixed top-0 bottom-0 left-0 right-0 flex items-center justify-center overflow-hidden bg-dark -z-10" style={style} ><Player
src={LoadingAnimation}
autoplay
style={{ minHeight: '100vh', minWidth: '100vw', aspectRatio: 16 / 9, zIndex: 10, backgroundColor: "transparent" }}
style={{ minHeight: '100vh', minWidth: '100vw', aspectRatio: 16 / 9, zIndex: 0, backgroundColor: "transparent" }}

/></div>
}
Expand Down

0 comments on commit 1d6172b

Please sign in to comment.