////
///
/// Twist Animations Mixin Module
/// ===========================================================================
///
/// Provides twisting animations that combine rotation with scale changes.
/// Creates dynamic, spiraling effects. Useful for loading indicators,
/// transitions, and attention-grabbing emphasis effects.
///
/// @group Animations
/// @author Scape Agency
/// @link https://move.gl
/// @since 0.1.0 initial release
/// @access public
///
////


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

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


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


///
/// Twist Animation
/// ---------------------------------------------------------------------------
/// Creates a twist effect with scaling and rotating.
///
/// @name animate_twist
/// @param {Number} $scale_end [0.9] - Scale factor at midpoint of animation
/// @param {Angle} $rotation [10deg] - Rotation angle at midpoint
/// @param {Time} $duration [$animate_base_duration] - Animation duration
/// @param {String} $timing_function [ease-in-out] - Timing function
/// @param {Number|String} $iteration_count - Number of iterations
///
/// @example scss - Basic usage
///   .spinner {
///     @include animate_twist;
///   }
///
@mixin animate_twist(
    $scale_end: 0.9,
    $rotation: 10deg,
    $duration: $animate_base_duration,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_twist,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_twist($scale_end, $rotation);
}



// Gentle Twist Animation
// ----------------------------------------------------------------------------

///
/// Gentle Twist Animation
/// A slower and subtler version of the Twist animation.
/// @name animate_twist_slow
/// @param {Number} $scale_end [0.95] - The scale factor at the midpoint of the animation.
/// @param {Angle} $rotation [5deg] - The rotation angle at the midpoint of the animation.
/// @param {Duration} $duration [$animate_base_duration_slow] - The duration of the animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_twist_slow(
    $scale_end: 0.95,
    $rotation: 5deg,
    $duration: $animate_base_duration_slow,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_twist_slow,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_twist_slow($scale_end, $rotation);
}



// Rapid Twist Animation
// ----------------------------------------------------------------------------

///
/// Rapid Twist Animation
/// A faster and more intense version of the Twist animation.
/// @name animate_twist_fast
/// @param {Number} $scale_end [0.85] - The scale factor at the midpoint of the animation.
/// @param {Angle} $rotation [15deg] - The rotation angle at the midpoint of the animation.
/// @param {Duration} $duration [$animate_base_duration_fast] - The duration of the animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_twist_fast(
    $scale_end: 0.85,
    $rotation: 15deg,
    $duration: $animate_base_duration_fast,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_twist_fast,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_twist_fast($scale_end, $rotation);
}



// Twist with Color Change
// ----------------------------------------------------------------------------

///
/// Twist with Color Change Animation
/// Adds a color transition to the Twist animation.
/// @name animate_twist_color
/// @param {Number} $scale_end [0.9] - The scale factor at the midpoint of the animation.
/// @param {Angle} $rotation [10deg] - The rotation angle at the midpoint of the animation.
/// @param {Duration} $duration [$animate_base_duration] - The duration of the animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
/// @param {Color} $color_start [$animate_base_color_start] - The starting color of the animation.
/// @param {Color} $color_end [$animate_base_color_end] - The ending color of the animation.
///
@mixin animate_twist_color(
    $scale_end: 0.9,
    $rotation: 10deg,
    $duration: $animate_base_duration,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count,
    $color_start: $animate_base_color_start,
    $color_end: $animate_base_color_end,
) {
    @include animate_base(
        animate_twist_color,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_twist_color($scale_end, $rotation, $color_start, $color_end);
}
