stretchy morph ui

    by pafemilk

    0

    Physics-based spring engine for creating organic, stretchy, and morphing web micro-interactions.

    Free

    Security scanned

    Works with the AI Agents you already use

    stretchy morph ui

    Example session with this skill installed

    I have a standard React tab bar. Make it feel more fluid using the worm technique where the indicator stretches between tabs.

    • Read your context and instructions
    • Compiled the stretchy morph ui

    I have analyzed the request for a stretchy tab bar. I will implement the "Edge Pair" technique using two springs with swapped stiffness to create the elastic worm effect.

    Stretchy Worm Tabs Implementation

    import React, { useEffect, useRef } from 'react';
    import { Spring } from './stretchy-core';
    
    // Spring presets for the "Worm" effect
    const STIFF = { k: 450, c: 32 };
    const SOFT = { k: 160, c: 18 };
    
    export const StretchyTabs = ({ tabs, activeIndex, onChange }) => {
      const containerRef = useRef(null);
      const indicatorRef = useRef(null);
      const leading = useRef(new Spring(0));
      const trailing = useRef(new Spring(0));
    
      useEffect(() => {
        const target = containerRef.current.children[activeIndex].getBoundingClientRect();
        const isMovingRight = activeIndex > (leading.current.x > target.left ? 1 : 0);
    
        // Swap stiffness: leading edge is always stiffer
        leading.current.config = isMovingRight ? STIFF : SOFT;
        trailing.current.config = isMovingRight ? SOFT : STIFF;
    
        leading.current.to(target.left + target.width);
        trailing.current.to(target.left);
      }, [activeIndex]);
    
      // Animation loop writing directly to DOM for performance
      useEffect(() => {
        let frame;
        const loop = () => {
          leading.current.update();
          trailing.current.update();
          
          if (indicatorRef.current) {
            const left = trailing.current.x;
            const width = leading.current.x - left;
            indicatorRef.current.style.transform = `translateX(${left}px) scaleX(${width})`;
          }
          frame = requestAnimationFrame(loop);
        };
        loop();
        return () => cancelAnimationFrame(frame);
      }, []);
    
      return (
        <div ref={containerRef} style={{ position: 'relative', display: 'flex' }}>
          {tabs.map((tab, i) => (
            <button key={i} onClick={() => onChange(i)} className={i === activeIndex ? 'on' : ''}>
              {tab.label}
            </button>
          ))}
          <div ref={indicatorRef} className="indicator" />
        </div>
      );
    };
    

    Next steps

    1. Copy the stretchy-core.js helpers into your project.
    2. Apply the z-index and isolation styles defined in the Moving Indicators rulebook to prevent the indicator from overlapping text.
    3. Run scripts/check_page.py to verify the "jump strip" for the tab transitions.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    Modern web interfaces often feel static, with state changes that jump instantly or follow rigid, linear easing curves. This lack of fluidity makes apps feel like a series of disconnected screens rather than a cohesive, physical object. This skill replaces standard CSS transitions with a high-performance spring engine, enabling interfaces that squash, stretch, and morph based on physical momentum.

    What it does

    • Physics-driven motion uses a damped harmonic oscillator engine for realistic spring dynamics rather than time-based easing.
    • Dynamic morphing deforms UI elements during transitions, such as buttons transforming into loading indicators or tabs stretching like elastic.
    • Fluid micro-interactions adds organic feedback like volume-preserving squashes, kicks, and lagging followers to standard controls.
    • Code auditing scans existing projects to identify components that would benefit from elastic motion.
    • Accessibility compliance automatically handles reduced-motion preferences to ensure inclusivity.

    How it works

    1. Audit phase: Run scripts/audit_ui.py to scan your codebase for motion candidates and stack compatibility.
    2. Design phase: Write a "morph sentence" for each interaction to define the cause and effect of the stretch.
    3. Implementation: Integrate the stretchy-core.js engine and map UI states to spring values (stiffness and damping).
    4. Verification: Execute scripts/check_page.py to generate contact sheets and verify visual continuity across frames.

    Frameworks & tools

    Built for vanilla JS, React, Vue, and Svelte environments. It utilizes a custom semi-implicit Euler integration engine and headless browser scripts for visual testing.

    Why this beats prompting it yourself

    Writing physical spring logic that handles retargeting without resetting velocity is complex. This skill provides a battle-tested engine and a library of 24 reference components that solve common pitfalls like content reflow and layer ordering.

    Use cases

    • Navigation systems creating "worm" indicators for tabs or segmented controls.
    • Interactive buttons that bulge, squeeze, or morph into status marks.
    • Cart workflows throwing product items into a vibrating cart icon with arc physics.
    • Dashboard transitions where cards expand into modals using split-axis springs.

    Known limitations

    Does not support time-based paths where the specific shape of the curve (like a circular arc) is required without manual coordination. Requires manual re-syncing on window resize or font load.

    How to use

    1. 1

      Connect your agent to the Agensi MCP

      Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup

    2. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before buying a skill.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill goes through the trust checks below.

    Security scanned

    Checked by our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Free to use

    No account required to browse

    Trust & safety

    Security scan

    Security scan passed 9 days ago

    • Free with an Agensi account

    Software
    PythonGit

    Permissions

    Terminal / Shell
    Browser
    Read Files
    Write Files
    Listed9 days ago

    What's inside

    Creator

    pafemilk

    pafemilk

    Frequently Asked Questions

    Traditional CSS transitions use rigid time-based easing, whereas this skill uses a physics-driven spring engine that accounts for momentum and mass, resulting in organic, tactile interactions that feel like physical objects rather than flat digital pixels.

    The package is framework-agnostic and includes optimized hooks and components specifically for React, Vue, and Svelte, as well as a lightweight core for vanilla JavaScript environments.

    You receive the 'stretchy-core.js' spring engine, automated audit and verification scripts, and a comprehensive library of 24 reference components including navigation 'worms' and morphing buttons.

    Yes, the skill includes a built-in accessibility layer that detects 'prefers-reduced-motion' settings and automatically replaces high-velocity spring animations with simplified, static state changes.

    The included 'scripts/audit_ui.py' tool scans your existing codebase to identify the best candidates for elastic motion and provides a roadmap for implementation without requiring a full site rewrite.

    New in Frontend & Web Apps

    Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Frontend & Web Apps.

    Free