Skip to content

Instantly share code, notes, and snippets.

@nickhiley
nickhiley / gist:14ff5d8634a87455a8557f77926e505d
Created May 15, 2026 10:41
Magnetic Element Override for Framer
import { useEffect, useRef } from "react"
import { motion, useMotionValue, useSpring } from "framer-motion"
import type { ComponentType } from "react"
// ─── Config ────────────────────────────────────────────────────────────────
// How far (in px) the element can travel from its resting position
const MAX_DISTANCE = 20
// How strong the pull is (0–1). Higher = snaps closer to cursor faster
const PULL_STRENGTH = 0.35
@nickhiley
nickhiley / SpotlightNav.tsx
Created May 13, 2026 09:28
Spotlight Navigation Framer Override
import { createStore } from "https://framer.com/m/framer/store.js@^1.0.0"
import { ComponentType } from "react"
const useStore = createStore({ hoveredId: null })
let counter = 0
export function withNavItem(Component): ComponentType {
const id = String(counter++)