Search

Back

Copy Link

Library

/

Free

/

40

3D Text Box

40

3D Text Box

Not loading? Preview

Made by

@frameroverrides

override

hover

Override

3D Text Box

Copy

Override

Copied to Clipboard!

Instructions

This object requires a double stack. Add a stack around the object that you apply this effect.

Code Preview

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

export function withInwardBorderHover(Component): ComponentType {
    return (props) => {
        const hoverVariants = {
            initial: {
                transform: "translate(calc(var(--d)/-1), var(--d))",
                clipPath:
                    "polygon(var(--d) 0%, var(--d) 0%, 100% 0%, 100% calc(100% - var(--d)), 100% calc(100% - var(--d)), var(--d) calc(100% - var(--d)))",
            },
            hover: {
                transform: "translate(0, 0)",
                clipPath:
                    "polygon(0% var(--d), var(--d) 0%, 100% 0%, 100% calc(100% - var(--d)), calc(100% - var(--d)) 100%, 0% 100%)",
            },
        }

        return (
            <Component
                {...props}
                as={motion.div}
                initial="initial"
                whileHover="hover"
                style={{
                    ...props.style,
                    "--c": "#3700FF",
                    "--b": ".1em",
                    "--d": "20px",
                    "--_s": "calc(var(--d) + var(--b))",
                    color: "var(--c)",
                    border: "solid #0000",
                    borderWidth: "var(--b) var(--b) var(--_s) var(--_s)",
                    background:
                        "conic-gradient(at left var(--d)  bottom var(--d), #0000 90deg, rgb(255 255 255 /0.3) 0 225deg, rgb(255 255 255 /0.6) 0) border-box, conic-gradient(at left var(--_s) bottom var(--_s), #0000 90deg, var(--c) 0) 0 100%/calc(100% - var(--b)) calc(100% - var(--b)) border-box",
                    transition: "0.5s",
                }}
                variants={hoverVariants}
            >
                {props.children}
            </Component>
        )
    }
}

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.