File size: 661 Bytes
6e347ba
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
"use client";

import { motion, useScroll, useTransform } from "framer-motion";

export function SkillsParallax({ children }: { children: React.ReactNode }) {
  const { scrollYProgress } = useScroll({ offset: ["start end", "end start"] });
  const y = useTransform(scrollYProgress, [0, 1], [40, -40]);
  const opacity = useTransform(scrollYProgress, [0, 1], [0.6, 1]);
  return (
    <div className="relative">
      <motion.div
        style={{ y, opacity }}
        className="pointer-events-none absolute -inset-x-6 -top-10 -bottom-10 -z-10 rounded-[40px] bg-gradient-to-tr from-teal-500/10 to-amber/10 blur-2xl"
      />
      {children}
    </div>
  );
}