Instantly share code, notes, and snippets.
Design Engineer from Austria
- Graz, Austria
- https://michael.fm
- https://twitter.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client' | |
import React, { useEffect, useState } from 'react'; | |
import { motion, useMotionValue, useTransform, animate } from 'framer-motion'; | |
import { IoArrowBackOutline, IoArrowForwardOutline } from "react-icons/io5"; | |
const SlideButton: React.FC = () => { | |
const [isOn, setIsOn] = useState(false); | |
const trackRef = React.useRef<HTMLDivElement>(null); | |
const handleRef = React.useRef<HTMLDivElement>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use client' | |
import { useState, useRef, useEffect } from 'react' | |
import { motion, cubicBezier, useMotionValue, useTransform, AnimatePresence } from 'framer-motion'; | |
import Particles from './particles'; | |
import Explosion from './explosion'; | |
import { PiCheckFatFill } from "react-icons/pi"; | |
// Custom easing function | |
const customEase = cubicBezier(0.05, 0.3, 0.2, 1); |