diff --git a/components/ImageSlide.tsx b/components/ImageSlide.tsx index 397f59f..e53264d 100644 --- a/components/ImageSlide.tsx +++ b/components/ImageSlide.tsx @@ -1,41 +1,41 @@ -import React, {Children, useState} from "react"; -import {AiFillLeftCircle} from 'react-icons/ai'; +import React, { useState } from "react"; +import { AiFillLeftCircle } from "react-icons/ai"; +export const ImageSlide = ({ children }: any) => { + const [current, setCurrent] = useState(0); + const length = children.length; -export const ImageSlide = ({children}:any) => { - const [current, setCurrent] = useState(0); - const length = children.length; - - const array = Children.toArray(children); - console.log(array) - - const nextSlide = () => { - setCurrent(current === length - 1 ? 0 : current + 2); - }; + const nextSlide = () => { + setCurrent(current === length - 1 ? 0 : current + 2); + }; - const prevSlide = () => { - setCurrent(current === 0 ? length - 1 : current - 2); - }; - if(children.length <= 0){ - return null; - }; + const prevSlide = () => { + setCurrent(current === 0 ? length - 1 : current - 2); + }; + if (children.length <= 0) { + return null; + } - return( - - - - {children.map((slide : any, index : any) => { - return ( - - {index === current && ( - - )} - - ); - })} - - ); -}; \ No newline at end of file + return ( + + + + {children.map((slide: any, index: any) => { + return ( + + {index === current && ( + + )} + + ); + })} + + ); +}; diff --git a/components/Navbar.tsx b/components/Navbar.tsx index 375f7c5..2c55f18 100644 --- a/components/Navbar.tsx +++ b/components/Navbar.tsx @@ -13,7 +13,7 @@ export const Navbar = () => { const [showMenu, setShowMenu] = useState(false); return ( - + { {links.map(({ name, href }) => ( - + {name} diff --git a/components/R3Background.tsx b/components/R3Background.tsx index c6b4062..4d1a77c 100644 --- a/components/R3Background.tsx +++ b/components/R3Background.tsx @@ -1,8 +1,8 @@ -import { useRef, useMemo } from 'react' -import { Canvas, useFrame } from '@react-three/fiber' +import { useRef, useMemo } from "react"; +import { Canvas, useFrame } from "@react-three/fiber"; import { BufferGeometry, Material, MathUtils, Mesh } from "three"; -import { vertexShader } from './Shaders/Background/vertex'; -import { fragmentShader } from './Shaders/Background/fragment'; +import { vertexShader } from "./Shaders/Background/vertex"; +import { fragmentShader } from "./Shaders/Background/fragment"; const Fragment = () => { // This reference will give us direct access to the mesh @@ -21,12 +21,13 @@ const Fragment = () => { ); useFrame((state) => { - if(!meshRef.current){ - return; + if (!meshRef.current) { + return; } const { clock } = state; //@ts-ignore - meshRef.current.material.uniforms.u_time.value = 0.4 * clock.getElapsedTime()/5; + meshRef.current.material.uniforms.u_time.value = + (0.4 * clock.getElapsedTime()) / 5; //@ts-ignore meshRef.current.material.uniforms.u_intensity.value = MathUtils.lerp( //@ts-ignore @@ -37,7 +38,12 @@ const Fragment = () => { }); return ( - + { ); }; - export const R3Gradient = () => { - return ( - + return ( + - ); + ); }; diff --git a/pages/index.tsx b/pages/index.tsx index 687689b..79cbc49 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -3,7 +3,7 @@ export default function Home() { return ( - + Lorem ipsum dolor{" "}