Breathe Effect
Sinusoidal floating animation that adds a gentle up-and-down motion to elements.

See Also

All JavaScript Effects Pulse Scribe Reveal Scramble Counter Ripple Shake Twinkle

Domma.effects.breathe()

Creates a gentle up-and-down floating motion using sinusoidal easing. Perfect for stat cards, feature highlights, pricing tiers, and call-to-action elements.

// Basic usage
Domma.effects.breathe('.stat-card');

// With configuration
const breathe = Domma.effects.breathe('.element', {
  amplitude: 6,       // Vertical distance in pixels
  duration: 3000,     // Animation cycle time in ms
  stagger: 200,       // Delay between multiple elements
  pauseOnHover: true, // Pause when hovering
  iterations: 'infinite'
});

// Control methods
breathe.pause();
breathe.resume();
breathe.stop();
breathe.restart();
breathe.destroy();

Demo: Basic Breathe

Simple floating animation with control methods.

Card 1
Card 2
Card 3

Demo: Stagger Effect

Cascading animations with 150ms delay between elements.

Item 1
Item 2
Item 3
Item 4
Domma.effects.breathe('#breathe-demo-2 .demo-item', {
  amplitude: 8,
  duration: 2500,
  stagger: 150
});

Demo: Amplitude Variations

Different vertical movement distances.

Small (4px)
Medium (8px)
Large (16px)
// Apply different amplitudes to each item
$('#breathe-demo-3 .demo-item').each(function() {
  const amplitude = parseInt($(this).attr('data-amplitude')) || 6;
  Domma.effects.breathe(this, {
    amplitude: amplitude,
    duration: 3000
  });
});

Demo: Pause on Hover

Animation pauses when you hover over elements.

Hover Me 1
Hover Me 2
Hover Me 3
Domma.effects.breathe('#breathe-demo-4 .demo-item', {
  amplitude: 10,
  duration: 2000,
  pauseOnHover: true
});