// ============================================================================
// Poster
// ============================================================================

////
/// 
/// Pulse Animations Mixin Module
/// ===========================================================================
/// 
/// This module ...
/// 
/// 
/// @group Animations
/// @author Scape Agency
/// @link https://move.gl
/// @since 0.1.0 initial release
/// @todo None
/// @access public
/// 
////


// ============================================================================
// Use
// ============================================================================

@use "../dev" as *;
@use "../variables" as *;
@use "../keyframes" as *;
@use "base" as *;


// ============================================================================
// Mixins
// ============================================================================


///
/// Pulse Animation
/// Creates a pulsing animation where the element scales between the minimum
/// and maximum scale values.
/// 
/// @name animate_pulse
/// @param {Number} $scale_min [1] - The minimum scale of the pulse.
/// @param {Number} $scale_max [1.1] - The maximum scale of the pulse.
/// @param {Number|String} $duration [$animate_base_duration] - The duration of the pulse animation.
/// @param {String} $timing_function [linear] - The timing function for the pulse animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_pulse(
    $scale_min: 1, 
    $scale_max: 1.1, 
    $duration: $animate_base_duration, 
    $timing_function: linear, 
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_pulse,
        $duration,
        $timing_function,
        $iteration_count
    );
    @keyframes animate_pulse {
        0%, 100% { transform: scale($scale_min); }
        50% { transform: scale($scale_max); }
    }
}



// Slow Pulse Animation
// ----------------------------------------------------------------------------

///
/// Slow Pulse Animation
/// Creates a slower pulsing animation with more subtle scale changes.
/// @name animate_pulse_slow
/// @param {Number} $scale_min [0.95] - The minimum scale of the pulse.
/// @param {Number} $scale_max [1.05] - The maximum scale of the pulse.
/// @param {Number|String} $duration [$animate_base_duration_slow] - The duration of the pulse animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the pulse animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_pulse_slow(
    $scale_min: 0.95, 
    $scale_max: 1.05, 
    $duration: $animate_base_duration_slow,
    $timing_function: ease-in-out, 
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_pulse_slow,
        $duration,
        $timing_function,
        $iteration_count
    );
    @keyframes animate_pulse_slow {
        0%, 100% { transform: scale($scale_min); }
        50% { transform: scale($scale_max); }
    }
}



// Rapid Pulse Animation
// ----------------------------------------------------------------------------

///
/// Rapid Pulse Animation
/// Creates a rapid pulsing animation with more pronounced scale changes.
/// @name animate_pulse_fast
/// @param {Number} $scale_min [0.9] - The minimum scale of the pulse.
/// @param {Number} $scale_max [1.2] - The maximum scale of the pulse.
/// @param {Number|String} $duration [$animate_base_duration_fast] - The duration of the pulse animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the pulse animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_pulse_fast(
    $scale_min: 0.9, 
    $scale_max: 1.2, 
    $duration: $animate_base_duration_fast,
    $timing_function: ease-in-out, 
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_pulse_fast,
        $duration,
        $timing_function,
        $iteration_count
    );
    @keyframes animate_pulse_fast {
        0%, 100% { transform: scale($scale_min); }
        50% { transform: scale($scale_max); }
    }
}



// Color Pulse Animation
// ----------------------------------------------------------------------------

///
/// Color Pulse Animation
/// Creates a pulsing animation where the background color of the element transitions between two colors.
/// @name animate_pulse_color
/// @param {Color} $color_start [$animate_base_color_start] - The starting color of the pulse.
/// @param {Color} $color_end [$animate_base_color_end] - The ending color of the pulse.
/// @param {Number|String} $duration [$animate_base_duration] - The duration of the pulse animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the pulse animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_pulse_color(
    $color_start: $animate_base_color_start, 
    $color_end: $animate_base_color_end, 
    $duration: $animate_base_duration, 
    $timing_function: ease-in-out, 
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_pulse_color,
        $duration,
        $timing_function,
        $iteration_count
    );
    @keyframes animate_pulse_color {
        0%, 100% { background-color: $color_start; }
        50% { background-color: $color_end; }
    }
}



// originally authored by Nick Pettit - https://github.com/nickpettit/glide

// @-webkit-keyframes pulse {
//     from {
//       -webkit-transform: scale3d(1, 1, 1);
//       transform: scale3d(1, 1, 1);
//     }
  
//     50% {
//       -webkit-transform: scale3d(1.05, 1.05, 1.05);
//       transform: scale3d(1.05, 1.05, 1.05);
//     }
  
//     100% {
//       -webkit-transform: scale3d(1, 1, 1);
//       transform: scale3d(1, 1, 1);
//     }
//   }
  
//   @keyframes pulse {
//     from {
//       -webkit-transform: scale3d(1, 1, 1);
//       transform: scale3d(1, 1, 1);
//     }
  
//     50% {
//       -webkit-transform: scale3d(1.05, 1.05, 1.05);
//       transform: scale3d(1.05, 1.05, 1.05);
//     }
  
//     100% {
//       -webkit-transform: scale3d(1, 1, 1);
//       transform: scale3d(1, 1, 1);
//     }
//   }
  
//   .pulse {
//     -webkit-animation-name: pulse;
//     animation-name: pulse;
//   }
  