This features button transforms into a modal with a smooth morphing animation.
Optimized for all screen sizes
Optimized for smooth animations
The morph animation transforms UI elements through smooth, organic transitions that maintain context and visual continuity. This technique creates a magical connection between different interface states by:
function createMorph(startEl, endEl) {
// Capture dimensions and position
const startRect = startEl.getBoundingClientRect();
const endRect = endEl.getBoundingClientRect();
// Create morphing element
const morph = document.createElement('div');
document.body.appendChild(morph);
// Animate properties
animate({
element: morph,
from: {
width: `${startRect.width}px`,
height: `${startRect.height}px`,
borderRadius: '50px',
top: `${startRect.top}px`,
left: `${startRect.left}px`
},
to: {
width: `${endRect.width}px`,
height: `${endRect.height}px`,
borderRadius: '20px',
top: `${endRect.top}px`,
left: `${endRect.left}px`
},
duration: 600,
easing: 'cubic-bezier(0.34, 1.56, 0.64, 1)'
});
}
Smooth Morphing Animation • Transform User Experiences