diff --git a/src/components/ui/layout-text-flip.tsx b/src/components/ui/layout-text-flip.tsx new file mode 100644 index 0000000..8578783 --- /dev/null +++ b/src/components/ui/layout-text-flip.tsx @@ -0,0 +1,58 @@ +"use client"; +import React, { useState, useEffect } from "react"; +import { motion, AnimatePresence } from "motion/react"; +import { cn } from "@/lib/utils"; + +export const LayoutTextFlip = ({ + text = "Build Amazing", + words = ["Landing Pages", "Component Blocks", "Page Sections", "3D Shaders"], + duration = 3000, +}: { + text: string; + words: string[]; + duration?: number; +}) => { + const [currentIndex, setCurrentIndex] = useState(0); + + useEffect(() => { + const interval = setInterval(() => { + setCurrentIndex((prevIndex) => (prevIndex + 1) % words.length); + }, duration); + + return () => clearInterval(interval); + }, []); + + return ( + <> + + {text} + + + + + + {words[currentIndex]} + + + + + ); +}; diff --git a/src/components/ui/pointer-highlight.tsx b/src/components/ui/pointer-highlight.tsx new file mode 100644 index 0000000..29cddec --- /dev/null +++ b/src/components/ui/pointer-highlight.tsx @@ -0,0 +1,119 @@ +"use client"; +import { cn } from "@/lib/utils"; +import { motion } from "motion/react"; +import { useRef, useEffect, useState } from "react"; + +export function PointerHighlight({ + children, + rectangleClassName, + pointerClassName, + containerClassName, +}: { + children: React.ReactNode; + rectangleClassName?: string; + pointerClassName?: string; + containerClassName?: string; +}) { + const containerRef = useRef(null); + const [dimensions, setDimensions] = useState({ width: 0, height: 0 }); + + useEffect(() => { + if (containerRef.current) { + const { width, height } = containerRef.current.getBoundingClientRect(); + setDimensions({ width, height }); + } + + const resizeObserver = new ResizeObserver((entries) => { + for (const entry of entries) { + const { width, height } = entry.contentRect; + setDimensions({ width, height }); + } + }); + + if (containerRef.current) { + resizeObserver.observe(containerRef.current); + } + + return () => { + if (containerRef.current) { + resizeObserver.unobserve(containerRef.current); + } + }; + }, []); + + return ( +
+ {children} + {dimensions.width > 0 && dimensions.height > 0 && ( + + + + + + + )} +
+ ); +} + +const Pointer = ({ ...props }: React.SVGProps) => { + return ( + + + + ); +}; diff --git a/src/pages/home/HomeAgent.tsx b/src/pages/home/HomeAgent.tsx new file mode 100644 index 0000000..dbd4917 --- /dev/null +++ b/src/pages/home/HomeAgent.tsx @@ -0,0 +1,65 @@ +import { H2, P } from '@/components/Texts' +import { Button } from '@/components/Button' +import { LayoutTextFlip } from '@/components/ui/layout-text-flip' // make sure this import path is correct + +export function HomeAgent() { + return ( +
+
+
+

+ Deploy your own{" "} + + + +

+ +

+ Mycelium delivers enterprise-grade AI agents with unmatched customizability and the fastest time to production — all in the agent platform designed for real business use cases. +

+ +
+ + + Learn more + +
+
+
+ + +
+ ) +} diff --git a/src/pages/home/HomeCloud.tsx b/src/pages/home/HomeCloud.tsx index d23db96..ac80296 100644 --- a/src/pages/home/HomeCloud.tsx +++ b/src/pages/home/HomeCloud.tsx @@ -40,7 +40,7 @@ export function HomeCloud() { ))}
- + Learn more diff --git a/src/pages/home/HomePage.tsx b/src/pages/home/HomePage.tsx index 785b319..475e18d 100644 --- a/src/pages/home/HomePage.tsx +++ b/src/pages/home/HomePage.tsx @@ -7,8 +7,8 @@ import { HomeHeroDark } from './HomeHeroDark' import { HomeAurora } from './HomeAurora' import { HomeMapSection } from './HomeMap' import { HomeFeatures } from './HomeFeatures' -import { HalfGlobe } from '@/components/ui/HalfGlobe' import { HomeCloud } from './HomeCloud' +import { HomeAgent } from './HomeAgent' export default function HomePage() { return ( @@ -29,6 +29,10 @@ export default function HomePage() { + + + +
) }