From 509490347209e1d2dde75dbad9a471de21f7ea4d Mon Sep 17 00:00:00 2001 From: Xevion Date: Thu, 26 Dec 2024 16:29:26 -0600 Subject: [PATCH] CSR only Dots component, tune drop shadow --- src/components/Dots.tsx | 20 +++++++------------- src/pages/index.tsx | 13 +++++++++---- tailwind.config.cjs | 5 ++++- 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/components/Dots.tsx b/src/components/Dots.tsx index 8ff646f..020e1bc 100644 --- a/src/components/Dots.tsx +++ b/src/components/Dots.tsx @@ -69,11 +69,14 @@ const Dots: React.FC = () => { const nx = x + cos(rad) * length; const ny = y + sin(rad) * length; - let opacity = 0.5; - const center_distance = Math.sqrt((x - w / 2) ** 2 + (y - h / 2) ** 2); + let opacity = 1; + + // const center_distance = Math.sqrt((x - w / 2) ** 2 + (y - h / 2) ** 2); // if (center_distance < 350) + // opacity = 0; + // opacity = - stroke(200, 200, 200, (Math.abs(cos(rad)) * 0.8 + 0.2) * p.opacity * 255 * opacity); + stroke(200, 200, 200, (Math.abs(cos(rad)) * 0.8 + 0.2) * p.opacity * 255 * 0.5 * opacity); circle(nx, ny - offsetY, 1); } } @@ -96,22 +99,13 @@ const Dots: React.FC = () => { window.addEventListener('resize', handleResize); - // Uncomment to enable scroll-based animation - // Tho there is some lag when scrolling, not sure if it's solvable - // const handleScroll = () => { - // offsetY = window.scrollY; - // addPoints(); - // }; - // window.addEventListener('scroll', handleScroll, { passive: true }); - return () => { window.removeEventListener('resize', handleResize); - // window.removeEventListener('scroll', handleScroll); unmount(); }; }, []); - return
; + return
; }; export default Dots; \ No newline at end of file diff --git a/src/pages/index.tsx b/src/pages/index.tsx index 6151753..c524079 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -8,7 +8,7 @@ import AppWrapper from "@/components/AppWrapper"; import ItemCard from "@/components/ItemCard"; import directus, { type Project } from "@/utils/directus"; import { useBreakpointValue } from "@/utils/helpers"; -import Dots from "@/components/Dots"; +import dynamic from "next/dynamic"; type IndexProps = { tagline: string; @@ -16,6 +16,11 @@ type IndexProps = { buttons: { text: string; href: string }[]; }; +const DotsDynamic = dynamic( + () => import('@/components/Dots'), + { ssr: false } +) + export async function getStaticProps(): Promise< GetStaticPropsResult > { @@ -63,7 +68,7 @@ const Home: NextPage = ({
- +
-

- XEVION +

+ Xevion

{/*
diff --git a/tailwind.config.cjs b/tailwind.config.cjs index 397a874..5c24d0a 100644 --- a/tailwind.config.cjs +++ b/tailwind.config.cjs @@ -31,6 +31,9 @@ module.exports = { }, }, }, + dropShadow: { + "extreme": "0 0 50px black", + }, fontFamily: { inter: ['"Inter"', "sans-serif"], roboto: ['"Roboto"', "sans-serif"], @@ -44,7 +47,7 @@ module.exports = { "radial-gradient(50% 50% at 50% 50%, var(--tw-gradient-stops))", }, animation: { - bg: "bg 5s ease-in-out forwards", + bg: "fade-in 3s ease-in forwards", "fade-in": "fade-in 3s ease-in-out forwards", title: "title 3s ease-out forwards", "fade-left": "fade-left 3s ease-in-out forwards",