////
///
/// Roll Animations Mixin Module
/// ===========================================================================
///
/// Provides rolling animations that combine translation with rotation.
/// Elements appear to roll in or out of view. Useful for dynamic entrances,
/// playful transitions, and physics-inspired 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
// ============================================================================


///
/// Roll Animation
/// ---------------------------------------------------------------------------
/// Creates a rolling animation where the element translates and rotates
/// horizontally.
///
/// @name animate_roll
/// @param {Length} $translate_distance [100%] - Horizontal translation
/// @param {Angle} $rotation_angle [360deg] - Rotation angle for the roll
/// @param {Time} $duration - Animation duration
/// @param {String} $timing_function [ease-in-out] - Timing function
/// @param {Number|String} $iteration_count - Number of iterations
///
/// @example scss - Basic usage
///   .ball {
///     @include animate_roll;
///   }
///
@mixin animate_roll(
    $translate_distance: 100%,
    $rotation_angle: 360deg,
    $duration: $animate_base_duration * 2,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_roll,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_roll($translate_distance, $rotation_angle);
}


///
/// Reverse Roll Animation
/// ---------------------------------------------------------------------------
/// Creates a reverse rolling animation where the element translates and
/// rotates horizontally in the opposite direction.
///
/// @name animate_roll_reverse
/// @param {Length} $translate-distance [-100%] - Horizontal translation
/// @param {Angle} $rotation_angle [-360deg] - Rotation angle for the roll
/// @param {Time} $duration - Animation duration
/// @param {String} $timing_function [ease-in-out] - Timing function
/// @param {Number|String} $iteration_count - Number of iterations
///
/// @example scss - Usage
///   .reverse-ball {
///     @include animate_roll_reverse;
///   }
///
@mixin animate_roll_reverse(
    $translate-distance: -100%,
    $rotation_angle: -360deg,
    $duration: $animate_base_duration * 2,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_roll_reverse,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_roll_reverse($translate-distance, $rotation_angle);
}


// Slow Roll Animation
// ----------------------------------------------------------------------------

///
/// Slow Roll Animation
/// Creates a slower rolling animation where the element translates and rotates horizontally.
/// @name animate_roll_slow
/// @param {Number|String} $translate-distance [100%] - The distance to translate the element horizontally.
/// @param {Number|String} $rotation_angle [360deg] - The rotation angle for the roll.
/// @param {Number|String} $duration [$animate_base_duration_slow/// 2] - The duration of the roll animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the roll animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_roll_slow(
    $translate-distance: 100%,
    $rotation_angle: 360deg,
    $duration: $animate_base_duration_slow * 2,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_roll_slow,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_roll_slow($translate-distance, $rotation_angle);
}



// Vertical Roll Animation
// ----------------------------------------------------------------------------

///
/// Vertical Roll Animation
/// Creates a rolling animation where the element translates and rotates vertically.
/// @name animate_roll_vertical
/// @param {Number|String} $translate-distance [100%] - The distance to translate the element vertically.
/// @param {Number|String} $rotation_angle [360deg] - The rotation angle for the vertical roll.
/// @param {Number|String} $duration [$animate_base_duration/// 2] - The duration of the roll animation.
/// @param {String} $timing_function [ease-in-out] - The timing function for the roll animation.
/// @param {Number|String} $iteration_count [$animate_base_iteration_count] - The number of iterations the animation will run.
///
@mixin animate_roll_vertical(
    $translate-distance: 100%,
    $rotation_angle: 360deg,
    $duration: $animate_base_duration * 2,
    $timing_function: ease-in-out,
    $iteration_count: $animate_base_iteration_count
) {
    @include animate_base(
        animate_roll_vertical,
        $duration,
        $timing_function,
        $iteration_count,
    );
    @include keyframes_animate_roll_vertical($translate-distance, $rotation_angle);
}





// Roll In Animation (from animate.css by Nick Pettit)
// ----------------------------------------------------------------------------

///
/// Roll In Animation
/// Creates a rolling entrance animation where the element rolls in from the left.
/// Originally authored by Nick Pettit - https://github.com/nickpettit/glide
///
/// @name animate_roll_in
/// @param {Duration} $duration [$animate_base_duration] - The duration of the animation.
/// @param {String} $timing_function [ease-out] - The timing function.
///
@mixin animate_roll_in(
    $duration: $animate_base_duration,
    $timing_function: ease-out
) {
    @include animate_base(
        animate_roll_in,
        $duration,
        $timing_function,
        1
    );
    @include keyframes_animate_roll_in();
}


// Roll Out Animation
// ----------------------------------------------------------------------------

///
/// Roll Out Animation
/// Creates a rolling exit animation where the element rolls out to the right.
/// Originally authored by Nick Pettit - https://github.com/nickpettit/glide
///
/// @name animate_roll_out
/// @param {Duration} $duration [$animate_base_duration] - The duration of the animation.
/// @param {String} $timing_function [ease-in] - The timing function.
///
@mixin animate_roll_out(
    $duration: $animate_base_duration,
    $timing_function: ease-in
) {
    @include animate_base(
        animate_roll_out,
        $duration,
        $timing_function,
        1
    );
    @include keyframes_animate_roll_out();
}
