@@ -91,6 +124,6 @@ export default function TestimonialsSection() {
to { transform: translateX(-50%); }
}
`}
-
+
);
}
diff --git a/src/widgets/landing/components/reactbits/BlurText.jsx b/src/widgets/landing/components/reactbits/BlurText.jsx
new file mode 100644
index 0000000..2c0253a
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/BlurText.jsx
@@ -0,0 +1,107 @@
+import { createElement, useEffect, useMemo, useRef, useState } from "react";
+import { motion } from "framer-motion";
+
+const buildKeyframes = (from, steps) => {
+ const keys = new Set([...Object.keys(from), ...steps.flatMap(s => Object.keys(s))]);
+
+ const keyframes = {};
+ keys.forEach(k => {
+ keyframes[k] = [from[k], ...steps.map(s => s[k])];
+ });
+ return keyframes;
+};
+
+const BlurText = ({
+ as: Component = "p",
+ text = '',
+ delay = 200,
+ className = '',
+ animateBy = 'words',
+ direction = 'top',
+ threshold = 0.1,
+ rootMargin = '0px',
+ animationFrom = undefined,
+ animationTo = undefined,
+ easing = t => t,
+ onAnimationComplete = undefined,
+ stepDuration = 0.35
+}) => {
+ const elements = animateBy === 'words' ? text.split(' ') : text.split('');
+ const [inView, setInView] = useState(false);
+ const ref = useRef(null);
+
+ useEffect(() => {
+ if (!ref.current) return;
+ const observer = new IntersectionObserver(
+ ([entry]) => {
+ if (entry.isIntersecting) {
+ setInView(true);
+ observer.unobserve(ref.current);
+ }
+ },
+ { threshold, rootMargin }
+ );
+ observer.observe(ref.current);
+ return () => observer.disconnect();
+ }, [threshold, rootMargin]);
+
+ const defaultFrom = useMemo(
+ () =>
+ direction === 'top' ? { filter: 'blur(10px)', opacity: 0, y: -50 } : { filter: 'blur(10px)', opacity: 0, y: 50 },
+ [direction]
+ );
+
+ const defaultTo = useMemo(
+ () => [
+ {
+ filter: 'blur(5px)',
+ opacity: 0.5,
+ y: direction === 'top' ? 5 : -5
+ },
+ { filter: 'blur(0px)', opacity: 1, y: 0 }
+ ],
+ [direction]
+ );
+
+ const fromSnapshot = animationFrom ?? defaultFrom;
+ const toSnapshots = animationTo ?? defaultTo;
+
+ const stepCount = toSnapshots.length + 1;
+ const totalDuration = stepDuration * (stepCount - 1);
+ const times = Array.from({ length: stepCount }, (_, i) => (stepCount === 1 ? 0 : i / (stepCount - 1)));
+
+ return createElement(
+ Component,
+ {
+ ref,
+ className,
+ style: { display: "flex", flexWrap: "wrap" },
+ },
+ elements.map((segment, index) => {
+ const animateKeyframes = buildKeyframes(fromSnapshot, toSnapshots);
+
+ const spanTransition = {
+ duration: totalDuration,
+ times,
+ delay: (index * delay) / 1000
+ };
+ spanTransition.ease = easing;
+
+ return (
+
+ {segment === ' ' ? '\u00A0' : segment}
+ {animateBy === 'words' && index < elements.length - 1 && '\u00A0'}
+
+ );
+ }),
+ );
+};
+
+export default BlurText;
diff --git a/src/widgets/landing/components/reactbits/BubbleMenu.css b/src/widgets/landing/components/reactbits/BubbleMenu.css
new file mode 100644
index 0000000..7950177
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/BubbleMenu.css
@@ -0,0 +1,268 @@
+.bubble-menu {
+ left: 0;
+ right: 0;
+ top: 2em;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 16px;
+ padding: 0 2em;
+ pointer-events: none;
+ z-index: 99;
+}
+
+.bubble-menu.fixed {
+ position: fixed;
+}
+
+.bubble-menu.absolute {
+ position: absolute;
+}
+
+.bubble-menu .bubble {
+ --bubble-size: 48px;
+ width: var(--bubble-size);
+ height: var(--bubble-size);
+ border-radius: 50%;
+ background: #fff;
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ pointer-events: auto;
+}
+
+.bubble-menu .logo-bubble,
+.bubble-menu .toggle-bubble {
+ will-change: transform;
+}
+
+.bubble-menu .logo-bubble {
+ width: auto;
+ min-height: var(--bubble-size);
+ height: var(--bubble-size);
+ padding: 0 16px;
+ border-radius: calc(var(--bubble-size) / 2);
+ gap: 8px;
+}
+
+.bubble-menu .toggle-bubble {
+ width: var(--bubble-size);
+ height: var(--bubble-size);
+}
+
+.bubble-menu .bubble-logo {
+ max-height: 60%;
+ max-width: 100%;
+ object-fit: contain;
+ display: block;
+}
+
+.bubble-menu .logo-content {
+ --logo-max-height: 60%;
+ --logo-max-width: 100%;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ width: 120px;
+ height: 100%;
+}
+
+.bubble-menu .logo-content > .bubble-logo,
+.bubble-menu .logo-content > img,
+.bubble-menu .logo-content > svg {
+ max-height: var(--logo-max-height);
+ max-width: var(--logo-max-width);
+}
+
+.bubble-menu .menu-btn {
+ border: none;
+ background: #fff;
+ cursor: pointer;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ justify-content: center;
+ padding: 0;
+}
+
+.bubble-menu .menu-line {
+ width: 26px;
+ height: 2px;
+ background: #111;
+ border-radius: 2px;
+ display: block;
+ margin: 0 auto;
+ transition:
+ transform 0.3s ease,
+ opacity 0.3s ease;
+ transform-origin: center;
+}
+
+.bubble-menu .menu-line + .menu-line {
+ margin-top: 6px;
+}
+
+.bubble-menu .menu-btn.open .menu-line:first-child {
+ transform: translateY(4px) rotate(45deg);
+}
+
+.bubble-menu .menu-btn.open .menu-line:last-child {
+ transform: translateY(-4px) rotate(-45deg);
+}
+
+@media (min-width: 768px) {
+ .bubble-menu .bubble {
+ --bubble-size: 56px;
+ }
+
+ .bubble-menu .logo-bubble {
+ padding: 0 16px;
+ }
+}
+
+.bubble-menu-items {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ pointer-events: none;
+ z-index: 98;
+}
+
+.bubble-menu-items.fixed {
+ position: fixed;
+}
+
+.bubble-menu-items.absolute {
+ position: absolute;
+}
+
+.bubble-menu-items .pill-list {
+ list-style: none;
+ margin: 0;
+ padding: 0 24px;
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0;
+ row-gap: 4px;
+ width: 100%;
+ max-width: 1600px;
+ margin-left: auto;
+ margin-right: auto;
+ pointer-events: auto;
+ justify-content: stretch;
+}
+
+.bubble-menu-items .pill-list .pill-spacer {
+ width: 100%;
+ height: 0;
+ pointer-events: none;
+}
+
+.bubble-menu-items .pill-list .pill-col {
+ display: flex;
+ justify-content: center;
+ align-items: stretch;
+ flex: 0 0 calc(100% / 3);
+ box-sizing: border-box;
+}
+
+.bubble-menu-items .pill-list .pill-col:nth-child(4):nth-last-child(2) {
+ margin-left: calc(100% / 6);
+}
+
+.bubble-menu-items .pill-list .pill-col:nth-child(4):last-child {
+ margin-left: calc(100% / 3);
+}
+
+.bubble-menu-items .pill-link {
+ --pill-bg: #ffffff;
+ --pill-color: #111;
+ --pill-border: rgba(0, 0, 0, 0.12);
+ --item-rot: 0deg;
+ --pill-min-h: 160px;
+ --hover-bg: #f3f4f6;
+ --hover-color: #111;
+ width: 100%;
+ min-height: var(--pill-min-h);
+ padding: clamp(1.5rem, 3vw, 8rem) 0;
+ font-size: clamp(1.5rem, 4vw, 4rem);
+ font-weight: 400;
+ line-height: 0;
+ border-radius: 999px;
+ background: var(--pill-bg);
+ color: var(--pill-color);
+ text-decoration: none;
+ box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: relative;
+ transition:
+ background 0.3s ease,
+ color 0.3s ease;
+ will-change: transform;
+ box-sizing: border-box;
+ white-space: nowrap;
+ overflow: hidden;
+ height: 10px;
+}
+
+@media (min-width: 900px) {
+ .bubble-menu-items .pill-link {
+ transform: rotate(var(--item-rot));
+ }
+
+ .bubble-menu-items .pill-link:hover {
+ transform: rotate(var(--item-rot)) scale(1.06);
+ background: var(--hover-bg);
+ color: var(--hover-color);
+ }
+
+ .bubble-menu-items .pill-link:active {
+ transform: rotate(var(--item-rot)) scale(0.94);
+ }
+}
+
+.bubble-menu-items .pill-link .pill-label {
+ display: inline-block;
+ will-change: transform, opacity;
+ height: 1.2em;
+ line-height: 1.2;
+}
+
+@media (max-width: 899px) {
+ .bubble-menu-items {
+ padding-top: 0px;
+ align-items: flex-start;
+ padding-top: 120px;
+ }
+
+ .bubble-menu-items .pill-list {
+ row-gap: 16px;
+ }
+
+ .bubble-menu-items .pill-list .pill-col {
+ flex: 0 0 100%;
+ margin-left: 0 !important;
+ overflow: visible;
+ }
+
+ .bubble-menu-items .pill-link {
+ font-size: clamp(1.2rem, 3vw, 4rem);
+ padding: clamp(1rem, 2vw, 2rem) 0;
+ min-height: 80px;
+ }
+
+ .bubble-menu-items .pill-link:hover {
+ transform: scale(1.06);
+ background: var(--hover-bg);
+ color: var(--hover-color);
+ }
+
+ .bubble-menu-items .pill-link:active {
+ transform: scale(0.94);
+ }
+}
diff --git a/src/widgets/landing/components/reactbits/BubbleMenu.jsx b/src/widgets/landing/components/reactbits/BubbleMenu.jsx
new file mode 100644
index 0000000..e0f7608
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/BubbleMenu.jsx
@@ -0,0 +1,232 @@
+import { useState, useRef, useEffect } from 'react';
+import { gsap } from 'gsap';
+import Image from 'next/image';
+
+import './BubbleMenu.css';
+
+const DEFAULT_ITEMS = [
+ {
+ label: 'home',
+ href: '#',
+ ariaLabel: 'Home',
+ rotation: -8,
+ hoverStyles: { bgColor: '#3b82f6', textColor: '#ffffff' }
+ },
+ {
+ label: 'about',
+ href: '#',
+ ariaLabel: 'About',
+ rotation: 8,
+ hoverStyles: { bgColor: '#10b981', textColor: '#ffffff' }
+ },
+ {
+ label: 'projects',
+ href: '#',
+ ariaLabel: 'Documentation',
+ rotation: 8,
+ hoverStyles: { bgColor: '#f59e0b', textColor: '#ffffff' }
+ },
+ {
+ label: 'blog',
+ href: '#',
+ ariaLabel: 'Blog',
+ rotation: 8,
+ hoverStyles: { bgColor: '#ef4444', textColor: '#ffffff' }
+ },
+ {
+ label: 'contact',
+ href: '#',
+ ariaLabel: 'Contact',
+ rotation: -8,
+ hoverStyles: { bgColor: '#8b5cf6', textColor: '#ffffff' }
+ }
+];
+
+export default function BubbleMenu(props) {
+ const {
+ logo,
+ onMenuClick = () => {},
+ className = '',
+ style = {},
+ menuAriaLabel = 'Toggle menu',
+ menuBg = '#fff',
+ menuContentColor = '#111',
+ useFixedPosition = false,
+ items,
+ animationEase = 'back.out(1.5)',
+ animationDuration = 0.5,
+ staggerDelay = 0.12
+ } = props;
+
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
+ const [showOverlay, setShowOverlay] = useState(false);
+
+ const overlayRef = useRef(null);
+ const bubblesRef = useRef([]);
+ const labelRefs = useRef([]);
+
+ const menuItems = items?.length ? items : DEFAULT_ITEMS;
+ const containerClassName = ['bubble-menu', useFixedPosition ? 'fixed' : 'absolute', className]
+ .filter(Boolean)
+ .join(' ');
+ const overlayClassName = ['bubble-menu-items', useFixedPosition ? 'fixed' : 'absolute', className]
+ .filter(Boolean)
+ .join(' ');
+
+ const handleToggle = () => {
+ const nextState = !isMenuOpen;
+ if (nextState) setShowOverlay(true);
+ setIsMenuOpen(nextState);
+ onMenuClick?.(nextState);
+ };
+
+ const handleItemClick = (event, item) => {
+ item.onClick?.(event);
+ setIsMenuOpen(false);
+ };
+
+ useEffect(() => {
+ const overlay = overlayRef.current;
+ const bubbles = bubblesRef.current.filter(Boolean);
+ const labels = labelRefs.current.filter(Boolean);
+
+ if (!overlay || !bubbles.length) return;
+
+ if (isMenuOpen) {
+ gsap.set(overlay, { display: 'flex' });
+ gsap.killTweensOf([...bubbles, ...labels]);
+ gsap.set(bubbles, { scale: 0, transformOrigin: '50% 50%' });
+ gsap.set(labels, { y: 24, autoAlpha: 0 });
+
+ bubbles.forEach((bubble, i) => {
+ const delay = i * staggerDelay + gsap.utils.random(-0.05, 0.05);
+ const tl = gsap.timeline({ delay });
+
+ tl.to(bubble, {
+ scale: 1,
+ duration: animationDuration,
+ ease: animationEase
+ });
+ if (labels[i]) {
+ tl.to(
+ labels[i],
+ {
+ y: 0,
+ autoAlpha: 1,
+ duration: animationDuration,
+ ease: 'power3.out'
+ },
+ `-=${animationDuration * 0.9}`
+ );
+ }
+ });
+ } else if (showOverlay) {
+ gsap.killTweensOf([...bubbles, ...labels]);
+ gsap.to(labels, {
+ y: 24,
+ autoAlpha: 0,
+ duration: 0.2,
+ ease: 'power3.in'
+ });
+ gsap.to(bubbles, {
+ scale: 0,
+ duration: 0.2,
+ ease: 'power3.in',
+ onComplete: () => {
+ gsap.set(overlay, { display: 'none' });
+ setShowOverlay(false);
+ }
+ });
+ }
+ }, [isMenuOpen, showOverlay, animationEase, animationDuration, staggerDelay]);
+
+ useEffect(() => {
+ const handleResize = () => {
+ if (isMenuOpen) {
+ const bubbles = bubblesRef.current.filter(Boolean);
+ const isDesktop = window.innerWidth >= 900;
+
+ bubbles.forEach((bubble, i) => {
+ const item = menuItems[i];
+ if (bubble && item) {
+ const rotation = isDesktop ? (item.rotation ?? 0) : 0;
+ gsap.set(bubble, { rotation });
+ }
+ });
+ }
+ };
+
+ window.addEventListener('resize', handleResize);
+ return () => window.removeEventListener('resize', handleResize);
+ }, [isMenuOpen, menuItems]);
+
+ return (
+ <>
+
+ {showOverlay && (
+
+ )}
+ >
+ );
+}
diff --git a/src/widgets/landing/components/reactbits/DotGrid.css b/src/widgets/landing/components/reactbits/DotGrid.css
new file mode 100644
index 0000000..fbb7b4c
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/DotGrid.css
@@ -0,0 +1,29 @@
+.dot-grid {
+ display: block;
+ height: 100%;
+ width: 100%;
+ position: relative;
+ overflow: hidden;
+ overscroll-behavior: none;
+ scrollbar-width: none;
+ -ms-overflow-style: none;
+}
+
+.dot-grid::-webkit-scrollbar {
+ display: none;
+}
+
+.dot-grid__wrap {
+ width: 100%;
+ height: 100%;
+ position: relative;
+ overflow: hidden;
+}
+
+.dot-grid__canvas {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ pointer-events: none;
+}
diff --git a/src/widgets/landing/components/reactbits/DotGrid.jsx b/src/widgets/landing/components/reactbits/DotGrid.jsx
new file mode 100644
index 0000000..92098bf
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/DotGrid.jsx
@@ -0,0 +1,270 @@
+'use client';
+import { useRef, useEffect, useCallback, useMemo } from 'react';
+import { gsap } from 'gsap';
+import { InertiaPlugin } from 'gsap/InertiaPlugin';
+
+import './DotGrid.css';
+
+gsap.registerPlugin(InertiaPlugin);
+
+const throttle = (func, limit) => {
+ let lastCall = 0;
+ return function (...args) {
+ const now = performance.now();
+ if (now - lastCall >= limit) {
+ lastCall = now;
+ func.apply(this, args);
+ }
+ };
+};
+
+function hexToRgb(hex) {
+ const m = hex.match(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i);
+ if (!m) return { r: 0, g: 0, b: 0 };
+ return {
+ r: parseInt(m[1], 16),
+ g: parseInt(m[2], 16),
+ b: parseInt(m[3], 16)
+ };
+}
+
+const DotGrid = ({
+ dotSize = 16,
+ gap = 32,
+ baseColor = '#5227FF',
+ activeColor = '#5227FF',
+ proximity = 150,
+ speedTrigger = 100,
+ shockRadius = 250,
+ shockStrength = 5,
+ maxSpeed = 5000,
+ resistance = 750,
+ returnDuration = 1.5,
+ className = '',
+ style
+}) => {
+ const wrapperRef = useRef(null);
+ const canvasRef = useRef(null);
+ const dotsRef = useRef([]);
+ const pointerRef = useRef({
+ x: 0,
+ y: 0,
+ vx: 0,
+ vy: 0,
+ speed: 0,
+ lastTime: 0,
+ lastX: 0,
+ lastY: 0
+ });
+
+ const baseRgb = useMemo(() => hexToRgb(baseColor), [baseColor]);
+ const activeRgb = useMemo(() => hexToRgb(activeColor), [activeColor]);
+
+ const circlePath = useMemo(() => {
+ if (typeof window === 'undefined' || !window.Path2D) return null;
+
+ const p = new window.Path2D();
+ p.arc(0, 0, dotSize / 2, 0, Math.PI * 2);
+ return p;
+ }, [dotSize]);
+
+ const buildGrid = useCallback(() => {
+ const wrap = wrapperRef.current;
+ const canvas = canvasRef.current;
+ if (!wrap || !canvas) return;
+
+ const { width, height } = wrap.getBoundingClientRect();
+ const dpr = window.devicePixelRatio || 1;
+
+ canvas.width = width * dpr;
+ canvas.height = height * dpr;
+ canvas.style.width = `${width}px`;
+ canvas.style.height = `${height}px`;
+ const ctx = canvas.getContext('2d');
+ if (ctx) ctx.scale(dpr, dpr);
+
+ const cols = Math.floor((width + gap) / (dotSize + gap));
+ const rows = Math.floor((height + gap) / (dotSize + gap));
+ const cell = dotSize + gap;
+
+ const gridW = cell * cols - gap;
+ const gridH = cell * rows - gap;
+
+ const extraX = width - gridW;
+ const extraY = height - gridH;
+
+ const startX = extraX / 2 + dotSize / 2;
+ const startY = extraY / 2 + dotSize / 2;
+
+ const dots = [];
+ for (let y = 0; y < rows; y++) {
+ for (let x = 0; x < cols; x++) {
+ const cx = startX + x * cell;
+ const cy = startY + y * cell;
+ dots.push({ cx, cy, xOffset: 0, yOffset: 0, _inertiaApplied: false });
+ }
+ }
+ dotsRef.current = dots;
+ }, [dotSize, gap]);
+
+ useEffect(() => {
+ if (!circlePath) return;
+
+ let rafId;
+ const proxSq = proximity * proximity;
+
+ const draw = () => {
+ const canvas = canvasRef.current;
+ if (!canvas) return;
+ const ctx = canvas.getContext('2d');
+ if (!ctx) return;
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
+
+ const { x: px, y: py } = pointerRef.current;
+
+ for (const dot of dotsRef.current) {
+ const ox = dot.cx + dot.xOffset;
+ const oy = dot.cy + dot.yOffset;
+ const dx = dot.cx - px;
+ const dy = dot.cy - py;
+ const dsq = dx * dx + dy * dy;
+
+ let style = baseColor;
+ if (dsq <= proxSq) {
+ const dist = Math.sqrt(dsq);
+ const t = 1 - dist / proximity;
+ const r = Math.round(baseRgb.r + (activeRgb.r - baseRgb.r) * t);
+ const g = Math.round(baseRgb.g + (activeRgb.g - baseRgb.g) * t);
+ const b = Math.round(baseRgb.b + (activeRgb.b - baseRgb.b) * t);
+ style = `rgb(${r},${g},${b})`;
+ }
+
+ ctx.save();
+ ctx.translate(ox, oy);
+ ctx.fillStyle = style;
+ ctx.fill(circlePath);
+ ctx.restore();
+ }
+
+ rafId = requestAnimationFrame(draw);
+ };
+
+ draw();
+ return () => cancelAnimationFrame(rafId);
+ }, [proximity, baseColor, activeRgb, baseRgb, circlePath]);
+
+ useEffect(() => {
+ buildGrid();
+ let ro = null;
+ if ('ResizeObserver' in window) {
+ ro = new ResizeObserver(buildGrid);
+ if (wrapperRef.current) {
+ ro.observe(wrapperRef.current);
+ }
+ } else {
+ window.addEventListener('resize', buildGrid);
+ }
+ return () => {
+ if (ro) ro.disconnect();
+ else window.removeEventListener('resize', buildGrid);
+ };
+ }, [buildGrid]);
+
+ useEffect(() => {
+ const onMove = e => {
+ const now = performance.now();
+ const pr = pointerRef.current;
+ const dt = pr.lastTime ? now - pr.lastTime : 16;
+ const dx = e.clientX - pr.lastX;
+ const dy = e.clientY - pr.lastY;
+ let vx = (dx / dt) * 1000;
+ let vy = (dy / dt) * 1000;
+ let speed = Math.hypot(vx, vy);
+ if (speed > maxSpeed) {
+ const scale = maxSpeed / speed;
+ vx *= scale;
+ vy *= scale;
+ speed = maxSpeed;
+ }
+ pr.lastTime = now;
+ pr.lastX = e.clientX;
+ pr.lastY = e.clientY;
+ pr.vx = vx;
+ pr.vy = vy;
+ pr.speed = speed;
+
+ const rect = canvasRef.current.getBoundingClientRect();
+ pr.x = e.clientX - rect.left;
+ pr.y = e.clientY - rect.top;
+
+ for (const dot of dotsRef.current) {
+ const dist = Math.hypot(dot.cx - pr.x, dot.cy - pr.y);
+ if (speed > speedTrigger && dist < proximity && !dot._inertiaApplied) {
+ dot._inertiaApplied = true;
+ gsap.killTweensOf(dot);
+ const pushX = dot.cx - pr.x + vx * 0.005;
+ const pushY = dot.cy - pr.y + vy * 0.005;
+ gsap.to(dot, {
+ inertia: { xOffset: pushX, yOffset: pushY, resistance },
+ onComplete: () => {
+ gsap.to(dot, {
+ xOffset: 0,
+ yOffset: 0,
+ duration: returnDuration,
+ ease: 'elastic.out(1,0.75)'
+ });
+ dot._inertiaApplied = false;
+ }
+ });
+ }
+ }
+ };
+
+ const onClick = e => {
+ const rect = canvasRef.current.getBoundingClientRect();
+ const cx = e.clientX - rect.left;
+ const cy = e.clientY - rect.top;
+ for (const dot of dotsRef.current) {
+ const dist = Math.hypot(dot.cx - cx, dot.cy - cy);
+ if (dist < shockRadius && !dot._inertiaApplied) {
+ dot._inertiaApplied = true;
+ gsap.killTweensOf(dot);
+ const falloff = Math.max(0, 1 - dist / shockRadius);
+ const pushX = (dot.cx - cx) * shockStrength * falloff;
+ const pushY = (dot.cy - cy) * shockStrength * falloff;
+ gsap.to(dot, {
+ inertia: { xOffset: pushX, yOffset: pushY, resistance },
+ onComplete: () => {
+ gsap.to(dot, {
+ xOffset: 0,
+ yOffset: 0,
+ duration: returnDuration,
+ ease: 'elastic.out(1,0.75)'
+ });
+ dot._inertiaApplied = false;
+ }
+ });
+ }
+ }
+ };
+
+ const throttledMove = throttle(onMove, 50);
+ window.addEventListener('mousemove', throttledMove, { passive: true });
+ window.addEventListener('click', onClick);
+
+ return () => {
+ window.removeEventListener('mousemove', throttledMove);
+ window.removeEventListener('click', onClick);
+ };
+ }, [maxSpeed, speedTrigger, proximity, resistance, returnDuration, shockRadius, shockStrength]);
+
+ return (
+
+ );
+};
+
+export default DotGrid;
diff --git a/src/widgets/landing/components/reactbits/TextType.css b/src/widgets/landing/components/reactbits/TextType.css
new file mode 100644
index 0000000..c735f34
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/TextType.css
@@ -0,0 +1,14 @@
+.text-type {
+ display: inline-block;
+ white-space: pre-wrap;
+}
+
+.text-type__cursor {
+ margin-left: 0.25rem;
+ display: inline-block;
+ opacity: 1;
+}
+
+.text-type__cursor--hidden {
+ display: none;
+}
diff --git a/src/widgets/landing/components/reactbits/TextType.jsx b/src/widgets/landing/components/reactbits/TextType.jsx
new file mode 100644
index 0000000..0297809
--- /dev/null
+++ b/src/widgets/landing/components/reactbits/TextType.jsx
@@ -0,0 +1,182 @@
+'use client';
+
+import { useEffect, useRef, useState, createElement, useMemo, useCallback } from 'react';
+import { gsap } from 'gsap';
+import './TextType.css';
+
+const TextType = ({
+ text,
+ as: Component = 'div',
+ typingSpeed = 50,
+ initialDelay = 0,
+ pauseDuration = 2000,
+ deletingSpeed = 30,
+ loop = true,
+ className = '',
+ showCursor = true,
+ hideCursorWhileTyping = false,
+ cursorCharacter = '|',
+ cursorClassName = '',
+ cursorBlinkDuration = 0.5,
+ textColors = [],
+ variableSpeed = undefined,
+ onSentenceComplete = undefined,
+ startOnVisible = false,
+ reverseMode = false,
+ ...props
+}) => {
+ const [displayedText, setDisplayedText] = useState('');
+ const [currentCharIndex, setCurrentCharIndex] = useState(0);
+ const [isDeleting, setIsDeleting] = useState(false);
+ const [currentTextIndex, setCurrentTextIndex] = useState(0);
+ const [isVisible, setIsVisible] = useState(!startOnVisible);
+ const cursorRef = useRef(null);
+ const containerRef = useRef(null);
+
+ const textArray = useMemo(() => (Array.isArray(text) ? text : [text]), [text]);
+ const textSignature = useMemo(() => textArray.join('\u0000'), [textArray]);
+
+ useEffect(() => {
+ setDisplayedText('');
+ setCurrentCharIndex(0);
+ setIsDeleting(false);
+ setCurrentTextIndex(0);
+ }, [textSignature, reverseMode]);
+
+ const getRandomSpeed = useCallback(() => {
+ if (!variableSpeed) return typingSpeed;
+ const { min, max } = variableSpeed;
+ return Math.random() * (max - min) + min;
+ }, [variableSpeed, typingSpeed]);
+
+ const getCurrentTextColor = () => {
+ if (textColors.length === 0) return 'inherit';
+ return textColors[currentTextIndex % textColors.length];
+ };
+
+ useEffect(() => {
+ if (!startOnVisible || !containerRef.current) return;
+
+ const observer = new IntersectionObserver(
+ entries => {
+ entries.forEach(entry => {
+ if (entry.isIntersecting) {
+ setIsVisible(true);
+ }
+ });
+ },
+ { threshold: 0.1 }
+ );
+
+ observer.observe(containerRef.current);
+ return () => observer.disconnect();
+ }, [startOnVisible]);
+
+ useEffect(() => {
+ if (showCursor && cursorRef.current) {
+ gsap.set(cursorRef.current, { opacity: 1 });
+ gsap.to(cursorRef.current, {
+ opacity: 0,
+ duration: cursorBlinkDuration,
+ repeat: -1,
+ yoyo: true,
+ ease: 'power2.inOut'
+ });
+ }
+ }, [showCursor, cursorBlinkDuration]);
+
+ useEffect(() => {
+ if (!isVisible) return;
+
+ let timeout;
+ const currentText = textArray[currentTextIndex];
+ const processedText = reverseMode ? currentText.split('').reverse().join('') : currentText;
+
+ const executeTypingAnimation = () => {
+ if (isDeleting) {
+ if (displayedText === '') {
+ setIsDeleting(false);
+ if (currentTextIndex === textArray.length - 1 && !loop) {
+ return;
+ }
+
+ if (onSentenceComplete) {
+ onSentenceComplete(textArray[currentTextIndex], currentTextIndex);
+ }
+
+ setCurrentTextIndex(prev => (prev + 1) % textArray.length);
+ setCurrentCharIndex(0);
+ timeout = setTimeout(() => {}, pauseDuration);
+ } else {
+ timeout = setTimeout(() => {
+ setDisplayedText(prev => prev.slice(0, -1));
+ }, deletingSpeed);
+ }
+ } else {
+ if (currentCharIndex < processedText.length) {
+ timeout = setTimeout(
+ () => {
+ setDisplayedText(prev => prev + processedText[currentCharIndex]);
+ setCurrentCharIndex(prev => prev + 1);
+ },
+ variableSpeed ? getRandomSpeed() : typingSpeed
+ );
+ } else if (textArray.length >= 1) {
+ if (!loop && currentTextIndex === textArray.length - 1) return;
+ timeout = setTimeout(() => {
+ setIsDeleting(true);
+ }, pauseDuration);
+ }
+ }
+ };
+
+ if (currentCharIndex === 0 && !isDeleting && displayedText === '') {
+ timeout = setTimeout(executeTypingAnimation, initialDelay);
+ } else {
+ executeTypingAnimation();
+ }
+
+ return () => clearTimeout(timeout);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [
+ currentCharIndex,
+ displayedText,
+ isDeleting,
+ typingSpeed,
+ deletingSpeed,
+ pauseDuration,
+ textArray,
+ currentTextIndex,
+ loop,
+ initialDelay,
+ isVisible,
+ reverseMode,
+ variableSpeed,
+ onSentenceComplete
+ ]);
+
+ const shouldHideCursor =
+ hideCursorWhileTyping && (currentCharIndex < textArray[currentTextIndex].length || isDeleting);
+
+ return createElement(
+ Component,
+ {
+ ref: containerRef,
+ className: `text-type ${className}`,
+ ...props
+ },
+
+ {displayedText}
+ ,
+ showCursor && (
+
+ {cursorCharacter}
+
+ )
+ );
+};
+
+export default TextType;