Search

Back

Copy Link

Library

/

Free

/

35

3D Burst

35

3D Burst

Not loading? Preview

Made by

@frameroverrides

override

hover

Override

3D Burst

Copy

Override

Copied to Clipboard!

Instructions

Code Preview

import type { ComponentType } from "react"
import { motion } from "framer-motion"

const hover3DEffectVariants = {
    initial: {
        scale: 1,
        rotateX: 0,
        rotateY: 0,
        x: 0,
        y: 0,
        boxShadow: "0px 0px 0px rgba(0, 0, 0, 0)",
    },
    hover: {
        // Change scale
        scale: 1.1,
        // Change rotation
        rotateX: -10,
        rotateY: 10,
        x: "-10px",
        y: "-10px",
        boxShadow: "10px 10px 20px rgba(0, 0, 0, 0.15)", // Change the shadow color here
    },
}

export function with3DEffectOnHover(Component): ComponentType {
    return (props) => {
        return (
            <Component
                {...props}
                as={motion.div}
                initial="initial"
                whileHover="hover"
                variants={hover3DEffectVariants}
                transition={{ type: "spring", stiffness: 300, damping: 30 }}
                style={{
                    ...props.style,
                    transformOrigin: "center",
                    perspective: "500px",
                }}
            />
        )
    }
}

Terms of Use for Free Assets

By accessing and using this Framer Override Library, you agree to the following terms:

All code snippets provided are available for your personal and professional use. This includes personal websites, client projects, and other website projects in Framer. You are strictly prohibited from sharing, redistributing, selling these code snippets, or creating derivative works for resale or distribution. Unauthorized sharing, distribution, or selling of these code snippets is a breach of these terms and may result in termination of your access to this library, along with potential legal action.