Location
Map Pin Drop
A pin drops on the map, bounces, and the address card slides up.
"use client";
import { useRef } from "react";
import gsap from "gsap";
import { useGSAP } from "@gsap/react";
gsap.registerPlugin(useGSAP);
export type MapPinDropProps = {
/** Name shown on the address card. */
title?: string;
/** Address shown under the name. */
address?: string;
/** Button label on the card. */
action?: string;
/** Color of the pin, the ring and the button. */
accent?: string;
/** Replay forever with a pause between runs. */
loop?: boolean;
className?: string;
};
// Quarteirões e ruas em porcentagem, só para dar cara de mapa. Não é um mapa real.
const BLOCKS = [
{ l: 6, t: 8, w: 26, h: 30 },
{ l: 38, t: 6, w: 22, h: 26 },
{ l: 66, t: 10, w: 28, h: 22 },
{ l: 8, t: 46, w: 20, h: 20 },
{ l: 62, t: 40, w: 30, h: 24 },
];
const ROADS = ["left-0 right-0 top-[36%] h-2.5", "top-0 bottom-0 left-[33%] w-[9px]", "top-0 bottom-0 left-[61%] w-[9px] -skew-x-8"];
export default function MapPinDrop({
title = "Headquarters",
address = "123 Example Street",
action = "Open in maps",
accent = "#1f5bff",
loop = true,
className = "",
}: MapPinDropProps) {
const root = useRef<HTMLDivElement>(null);
useGSAP(
() => {
const q = gsap.utils.selector(root);
const pin = q("[data-pin]")[0];
const shadow = q("[data-shadow]")[0];
const ring = q("[data-ring]")[0];
const card = q("[data-card]")[0];
const btn = q("[data-btn]")[0];
const tl = gsap.timeline({ repeat: loop ? -1 : 0, repeatDelay: 1.4 });
tl.set(pin, { y: -160, autoAlpha: 1 })
.set(shadow, { scale: 0.2, autoAlpha: 0 })
.set(ring, { scale: 0.3, autoAlpha: 0 })
.set(card, { y: 90, autoAlpha: 0 })
.to(pin, { y: 0, duration: 0.55, ease: "bounce.out" }, 0.4)
.to(shadow, { scale: 1, autoAlpha: 1, duration: 0.55, ease: "bounce.out" }, 0.4)
.fromTo(ring, { scale: 0.3, autoAlpha: 0.9 }, { scale: 1.8, autoAlpha: 0, duration: 1.1, ease: "power2.out", repeat: 1 }, 0.95)
.to(card, { y: 0, autoAlpha: 1, duration: 0.5, ease: "back.out(1.4)" }, 1.4)
.to(btn, { scale: 0.94, duration: 0.12, yoyo: true, repeat: 1 }, 2.6)
.to({}, { duration: 1.4 });
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) tl.progress(1).pause();
},
{ scope: root, dependencies: [loop] },
);
return (
<div
ref={root}
className={`relative h-[290px] w-full max-w-[520px] overflow-hidden rounded-xl bg-[#dfe7e3] ${className}`}
>
{BLOCKS.map((b, i) => (
<div
key={i}
className="absolute rounded-[3px] bg-[#eef3f0]"
style={{ left: `${b.l}%`, top: `${b.t}%`, width: `${b.w}%`, height: `${b.h}%` }}
/>
))}
{ROADS.map((road, i) => (
<div key={i} className={`absolute bg-white ${road}`} />
))}
<div className="absolute -inset-x-5 -bottom-8 h-[90px] -rotate-6 bg-[#bcd3d6]" />
{/* O ponto de pouso fica em top 44%. O posicionamento mora nos invólucros: o GSAP anima só o
elemento de dentro, porque o transform dele substitui o translate do próprio elemento. */}
<div className="absolute top-[44%] left-1/2 -translate-x-1/2 -translate-y-1/2">
<div data-ring className="h-20 w-20 rounded-full border-2" style={{ borderColor: accent }} />
</div>
<div className="absolute top-[44%] left-1/2 -translate-x-1/2 -translate-y-1/2">
<div data-shadow className="h-[7px] w-[22px] rounded-full bg-black/25" />
</div>
<div className="absolute top-[calc(44%+2px)] left-1/2 -translate-x-1/2 -translate-y-full">
<div data-pin className="h-[52px] w-10">
<svg viewBox="0 0 40 52" className="block h-[52px] w-10" aria-hidden="true">
<path d="M20 51C20 51 3 31 3 19a17 17 0 0 1 34 0c0 12-17 32-17 32z" fill={accent} />
<circle cx="20" cy="19" r="6.5" fill="#ffffff" />
</svg>
</div>
</div>
<div
data-card
className="absolute inset-x-4 bottom-4 flex items-center justify-between gap-3 rounded-lg bg-white p-3 text-neutral-900 shadow-lg"
>
<div className="min-w-0">
<b className="block text-sm">{title}</b>
<small className="block truncate text-xs text-neutral-600">{address}</small>
</div>
<span
data-btn
className="shrink-0 rounded px-2.5 py-2 text-xs font-semibold text-white"
style={{ backgroundColor: accent }}
>
{action}
</span>
</div>
</div>
);
}
Paste this into Claude Code inside your project. It installs the skills your agent needs, asks for your texts and colors, and recreates this animation in your stack.
SkillsGSAP skillsHyperFrames · optional, for video
Claude Code
Recreate the "Map Pin Drop" animated component from Motionshelf (https://motionshelf-pi.vercel.app) in my current project, adapted to my brand. Answer me in the language I write to you in. Work in this order: 1. Tools: Check whether the official GSAP skills are installed (gsap-core, gsap-timeline, gsap-react). If they are not, ask me and then run `npx skills add https://github.com/greensock/gsap-skills` (choose Claude Code). If they do not show up in this session yet, read the SKILL.md files the installer created for gsap-timeline and gsap-react before writing code. 2. Project: Look at my project: framework (Next.js, Vite, plain HTML…), TypeScript or JavaScript, Tailwind or plain CSS. Build it as one component that fits this stack. In React use gsap and @gsap/react; in plain HTML use GSAP from npm or a CDN. 3. Ask me before coding: Ask me these in a single message, showing the example values as defaults: - the place name, the address and the button label - the accent color of the pin, ring and button - the language of the texts 4. The animation What it looks like: A simple illustrated map (light blocks, white streets, a strip of water). A pin drops on it and an address card slides up from the bottom. Step by step: - At 0.4 s the pin falls from 160 px above and bounces (0.55 s, bounce.out); its shadow grows under it at the same time. - At 0.95 s a ring pulses out from the pin twice (scale 0.3 → 1.8 while fading). - At 1.4 s the address card slides up (back.out(1.4)); at 2.6 s its button gets a quick tap. Rules: - Use one GSAP timeline that loops forever with a short pause between runs (repeat: -1). If the step by step gives the pause, use that value; otherwise repeatDelay about 1.4 s. - Set every starting state with set() at the start of the timeline, never with from(): on the second loop from() starts from the wrong place. - Elements that appear later and would push the layout (new chat bubbles, new rows) stay display:none until their turn; elements that already have their place in the layout (a subtitle, a button) start hidden with autoAlpha 0, so nothing jumps. - If there is a cursor or pointer, it aims at the measured center of its target (getBoundingClientRect), never at fixed pixel coordinates; if the component is scaled, divide by the scale. - Blur only in the middle of a movement and always end at blur(0). - With prefers-reduced-motion, jump to the final frame and stop (tl.progress(1).pause()). - In React, use useGSAP from @gsap/react with a scope ref, so the timeline is cleaned up on unmount. - All example content stays generic (no real brands, logos or people). - The pin's tip lands exactly on the center of its shadow: position the wrapper, animate the pin inside it. - The map is a drawing, not a real map; no map API is needed. 5. Check: Run it and watch the first and the third loop (they must look the same). Check it at 390 px wide with no sideways scroll, with reduced motion turned on, and with a clean console. Tell me what you checked. 6. Video (optional): If I also want this as an MP4 (ads, stories, WhatsApp status), install the HyperFrames plugin with `claude plugin marketplace add heygen-com/hyperframes` and `claude plugin install hyperframes@hyperframes`, then use /hyperframes:hyperframes to render the same animation in 9:16, 1:1 or 16:9. Rendering needs FFmpeg installed, or render with --docker (downloads about 3.3 GB the first time). Ask me before installing. Shortcut: If I only want the ready-made component instead, it installs with `npx shadcn@latest add https://motionshelf-pi.vercel.app/r/map-pin-drop.json`.
Other agentsUsing Cursor, Codex, Gemini CLI or another agent? This version tells it to find its own way to load the same skills before it starts.
Other agents
Recreate the "Map Pin Drop" animated component from Motionshelf (https://motionshelf-pi.vercel.app) in my current project, adapted to my brand. Answer me in the language I write to you in. Work in this order: 1. Tools: These instructions were written for Claude Code, which uses "skills" (folders with a SKILL.md that teach it a technique). First find out how you load skills, rules or instructions, and get the same knowledge: (a) if your agent is supported by the skills installer, ask me and run `npx skills add https://github.com/greensock/gsap-skills --agent <your-agent>` (for example codex, opencode, antigravity); (b) otherwise copy the skill folders from https://github.com/greensock/gsap-skills into your skills or rules directory (in Cursor: Settings → Rules → Remote Rule (GitHub) → greensock/gsap-skills); (c) if you cannot load skills at all, open the SKILL.md files in https://github.com/greensock/gsap-skills and read them as instructions before coding. Tell me which path you used. 2. Project: Look at my project: framework (Next.js, Vite, plain HTML…), TypeScript or JavaScript, Tailwind or plain CSS. Build it as one component that fits this stack. In React use gsap and @gsap/react; in plain HTML use GSAP from npm or a CDN. 3. Ask me before coding: Ask me these in a single message, showing the example values as defaults: - the place name, the address and the button label - the accent color of the pin, ring and button - the language of the texts 4. The animation What it looks like: A simple illustrated map (light blocks, white streets, a strip of water). A pin drops on it and an address card slides up from the bottom. Step by step: - At 0.4 s the pin falls from 160 px above and bounces (0.55 s, bounce.out); its shadow grows under it at the same time. - At 0.95 s a ring pulses out from the pin twice (scale 0.3 → 1.8 while fading). - At 1.4 s the address card slides up (back.out(1.4)); at 2.6 s its button gets a quick tap. Rules: - Use one GSAP timeline that loops forever with a short pause between runs (repeat: -1). If the step by step gives the pause, use that value; otherwise repeatDelay about 1.4 s. - Set every starting state with set() at the start of the timeline, never with from(): on the second loop from() starts from the wrong place. - Elements that appear later and would push the layout (new chat bubbles, new rows) stay display:none until their turn; elements that already have their place in the layout (a subtitle, a button) start hidden with autoAlpha 0, so nothing jumps. - If there is a cursor or pointer, it aims at the measured center of its target (getBoundingClientRect), never at fixed pixel coordinates; if the component is scaled, divide by the scale. - Blur only in the middle of a movement and always end at blur(0). - With prefers-reduced-motion, jump to the final frame and stop (tl.progress(1).pause()). - In React, use useGSAP from @gsap/react with a scope ref, so the timeline is cleaned up on unmount. - All example content stays generic (no real brands, logos or people). - The pin's tip lands exactly on the center of its shadow: position the wrapper, animate the pin inside it. - The map is a drawing, not a real map; no map API is needed. 5. Check: Run it and watch the first and the third loop (they must look the same). Check it at 390 px wide with no sideways scroll, with reduced motion turned on, and with a clean console. Tell me what you checked. 6. Video (optional): If I also want this as an MP4 (ads, stories, WhatsApp status), install the HyperFrames skills with `npx skills add heygen-com/hyperframes` (choose your agent) and render the same animation in 9:16, 1:1 or 16:9. Rendering needs FFmpeg installed, or render with --docker (downloads about 3.3 GB the first time). Ask me before installing. Shortcut: If I only want the ready-made component instead, it installs with `npx shadcn@latest add https://motionshelf-pi.vercel.app/r/map-pin-drop.json`.
Install
npx shadcn@latest add https://motionshelf-pi.vercel.app/r/map-pin-drop.jsonCopies the file into your project. Requires React 19, Tailwind CSS v4 and GSAP (installed as a dependency).
Props
| Name | Type | Default | Description |
|---|---|---|---|
| title | string | "Headquarters" | Name shown on the address card. |
| address | string | "123 Example Street" | Address shown under the name. |
| action | string | "Open in maps" | Button label on the card. |
| accent | string | "#1f5bff" | Color of the pin, the ring and the button. |
| loop | boolean | true | Replay forever with a pause between runs. |
| className | string | "" | Extra classes for the outer element. |
Dependencies
- gsap
- @gsap/react