Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

52 changes: 30 additions & 22 deletions src/Pages/Demo/marqu.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@

import { motion } from "framer-motion";
import { motion, useReducedMotion } from "framer-motion";
import { ImageIcon, FolderSync, Search, Code } from "lucide-react";

export default function TechMarquee() {
const shouldReduceMotion = useReducedMotion();

const technologies = [
{
text: "PictoAI",
{
text: "PictoAI",
icon: <ImageIcon className="inline-block ml-1 text-green-500" />,
},
{
text: "SmartSort",
{
text: "SmartSort",
icon: <FolderSync className="inline-block ml-1 text-yellow-500" />,
},
{
text: "QuickView",
{
text: "QuickView",
icon: <Search className="inline-block ml-1 text-green-500" />,
},
{
text: "CodeAI",
{
text: "CodeAI",
icon: <Code className="inline-block ml-1 text-yellow-500" />,
}
];

const duplicatedTechnologies = Array(16).fill(technologies).flat();

return (
<div className="relative w-full overflow-hidden
bg-white
Expand All @@ -30,22 +34,26 @@ export default function TechMarquee() {
dark:shadow-[0_0_50px_rgba(255,255,255,0.1)]
transition-shadow duration-500">
<motion.div
className="flex space-x-6 items-center"
initial={{ x: '0%' }}
animate={{ x: '100%' }}
transition={{
duration: 15,
ease: "linear",
repeat: Infinity,
repeatType: "loop"
}}
className="flex w-max items-center"
initial={shouldReduceMotion ? undefined : { x: "-50%" }}
animate={shouldReduceMotion ? { x: 0 } : { x: "0%" }}
transition={
shouldReduceMotion
? { duration: 0 }
: {
duration: 45,
ease: "linear",
repeat: Infinity,
repeatType: "loop",
}
}
>
{[...technologies, ...technologies, ...technologies].map((tech, index) => (
{duplicatedTechnologies.map((tech, index) => (
<div
key={index}
className="flex-shrink-0 flex items-center text-gray-600 dark:text-gray-300 text-xs font-medium"
>
<motion.span
<motion.span
className="flex items-center
bg-gray-100 dark:bg-white/5
hover:bg-gray-200 dark:hover:bg-white/10
Expand All @@ -54,7 +62,7 @@ export default function TechMarquee() {
transition-all duration-300
border border-gray-200 dark:border-white/10
shadow-sm"
whileHover={{
whileHover={{
scale: 1.05,
transition: { duration: 0.2 }
}}
Expand All @@ -65,7 +73,7 @@ export default function TechMarquee() {
{tech.icon}
</span>
</motion.span>
<span className="mx-3 text-gray-300 dark:text-gray-600">•</span>
<span className="mx-6 text-gray-300 dark:text-gray-600">•</span>
</div>
))}
</motion.div>
Expand Down
Loading