kollors
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Rei
2023-02-15 18:46:29 +01:00
parent 703b611dfd
commit dc7e82b143
4 changed files with 57 additions and 52 deletions

View File

@@ -1,14 +1,10 @@
import React, {Children, useState} from "react"; import React, { useState } from "react";
import {AiFillLeftCircle} from 'react-icons/ai'; import { AiFillLeftCircle } from "react-icons/ai";
export const ImageSlide = ({ children }: any) => { export const ImageSlide = ({ children }: any) => {
const [current, setCurrent] = useState(0); const [current, setCurrent] = useState(0);
const length = children.length; const length = children.length;
const array = Children.toArray(children);
console.log(array)
const nextSlide = () => { const nextSlide = () => {
setCurrent(current === length - 1 ? 0 : current + 2); setCurrent(current === length - 1 ? 0 : current + 2);
}; };
@@ -18,20 +14,24 @@ export const ImageSlide = ({children}:any) => {
}; };
if (children.length <= 0) { if (children.length <= 0) {
return null; return null;
}; }
return ( return (
<section className='slider'> <section className="slider">
<AiFillLeftCircle className='left-arrow' onClick={prevSlide} /> <AiFillLeftCircle className="left-arrow" onClick={prevSlide} />
<AiFillLeftCircle className='right-arrow' onClick={nextSlide} /> <AiFillLeftCircle className="right-arrow" onClick={nextSlide} />
{children.map((slide: any, index: any) => { {children.map((slide: any, index: any) => {
return ( return (
<div <div
className={index === current ? 'slide active' : 'slide'} className={index === current ? "slide active" : "slide"}
key={index} key={index}
> >
{index === current && ( {index === current && (
<img src={slide.props.children[0]} alt='travel image' className='image' /> <img
src={slide.props.children[0]}
alt="travel image"
className="image"
/>
)} )}
</div> </div>
); );

View File

@@ -13,7 +13,7 @@ export const Navbar = () => {
const [showMenu, setShowMenu] = useState(false); const [showMenu, setShowMenu] = useState(false);
return ( return (
<nav className="py-4 xl:px-10 px-4 flex flex-row justify-between sticky top-0 bg-slate-100 dark:bg-gradient-dark z-50 border-b dark:border-gradient-light border-gray-200"> <nav className="py-4 xl:px-10 px-4 flex flex-row justify-between sticky top-0 z-50 bg-gradient-to-b from-black/50 to-black/30">
<Link <Link
href="/" href="/"
id="logo" id="logo"
@@ -28,7 +28,7 @@ export const Navbar = () => {
<div className="hidden xl:flex flex-row gap-10 items-center font-medium font-mono"> <div className="hidden xl:flex flex-row gap-10 items-center font-medium font-mono">
{links.map(({ name, href }) => ( {links.map(({ name, href }) => (
<Link href={href} key={name}> <Link href={href} key={name}>
<button className="px-10 py-1 rounded-sm bg-primary hover:bg-primary/50 transition-all duration-150 ease-out text-white"> <button className="px-10 py-1 rounded-sm bg-gradient-to-r from-indigo-500/30 to-fuchsia-500/20 hover:bg-primary/50 transition-all duration-150 ease-out text-white">
{name} {name}
</button> </button>
</Link> </Link>

View File

@@ -1,8 +1,8 @@
import { useRef, useMemo } from 'react' import { useRef, useMemo } from "react";
import { Canvas, useFrame } from '@react-three/fiber' import { Canvas, useFrame } from "@react-three/fiber";
import { BufferGeometry, Material, MathUtils, Mesh } from "three"; import { BufferGeometry, Material, MathUtils, Mesh } from "three";
import { vertexShader } from './Shaders/Background/vertex'; import { vertexShader } from "./Shaders/Background/vertex";
import { fragmentShader } from './Shaders/Background/fragment'; import { fragmentShader } from "./Shaders/Background/fragment";
const Fragment = () => { const Fragment = () => {
// This reference will give us direct access to the mesh // This reference will give us direct access to the mesh
@@ -26,7 +26,8 @@ const Fragment = () => {
} }
const { clock } = state; const { clock } = state;
//@ts-ignore //@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 //@ts-ignore
meshRef.current.material.uniforms.u_intensity.value = MathUtils.lerp( meshRef.current.material.uniforms.u_intensity.value = MathUtils.lerp(
//@ts-ignore //@ts-ignore
@@ -37,7 +38,12 @@ const Fragment = () => {
}); });
return ( return (
<mesh ref={meshRef} position={[0, 0, 0]} rotation={[-Math.PI/17, Math.PI/20, 0]} scale={1.5}> <mesh
ref={meshRef}
position={[0, 0, 0]}
rotation={[-Math.PI / 17, Math.PI / 20, 0]}
scale={1.5}
>
<planeGeometry args={[30, 30, 200, 200]} /> <planeGeometry args={[30, 30, 200, 200]} />
<shaderMaterial <shaderMaterial
fragmentShader={fragmentShader} fragmentShader={fragmentShader}
@@ -49,10 +55,9 @@ const Fragment = () => {
); );
}; };
export const R3Gradient = () => { export const R3Gradient = () => {
return ( return (
<div className='-z-40 h-screen w-screen fixed bg-black opacity-60'> <div className="-z-40 h-screen w-screen fixed bg-black opacity-60 top-0 left-0">
<Canvas camera={{ position: [0.0, 0.0, 5.0] }}> <Canvas camera={{ position: [0.0, 0.0, 5.0] }}>
<Fragment /> <Fragment />
</Canvas> </Canvas>

View File

@@ -3,7 +3,7 @@ export default function Home() {
return ( return (
<MainLayout> <MainLayout>
<div className="grid lg:grid-cols-2 grid-cols-1 xl:mt-10 gap-10 items-center"> <div className="grid lg:grid-cols-2 grid-cols-1 xl:mt-10 gap-10 items-center">
<div className="bg-primary-dark p-10 rounded-lg flex flex-col gap-10 h-fit 3xl:w-2/3 w-full text-lg text-primary-text/90 shadow-lg shadow-gradient-dark/20"> <div className="bg-primary-dark/30 border-white/30 border p-10 rounded-lg flex flex-col gap-10 h-fit 3xl:w-2/3 w-full text-lg text-primary-text/90 shadow-lg shadow-gradient-dark/20">
<div> <div>
<span className="font-bold text-xl text-primary-text"> <span className="font-bold text-xl text-primary-text">
Lorem ipsum dolor{" "} Lorem ipsum dolor{" "}