Convert Figma logo to code with AI

MatejKustec logoSpinThatShit

A set of SCSS mixins for single element loaders and spinners

1,484
130
1,484
3

Top Related Projects

29,203

A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.

8,433

CSS3 Animations with special effects

🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.

49,575

JavaScript animation engine

A simple library to take care of complicated animations.

Quick Overview

SpinThatShit is a comprehensive collection of CSS spinners and loaders created using Sass. It offers a wide variety of customizable loading animations that can be easily integrated into web projects. The library provides a simple and efficient way to add visually appealing loading indicators to websites and web applications.

Pros

  • Large variety of spinner and loader styles
  • Highly customizable using Sass variables
  • Lightweight and easy to integrate
  • Well-documented with clear usage instructions

Cons

  • Requires Sass compilation for customization
  • Some animations may not be suitable for all browser versions
  • Limited browser support information provided
  • Lack of recent updates or maintenance

Code Examples

  1. Basic spinner usage:
@import 'spinners/spinner';
@include spinner;

This code imports the basic spinner and includes it in your Sass file.

  1. Customizing spinner properties:
$spinner-size: 40px;
$spinner-color: #3498db;
$spinner-duration: 1s;

@import 'spinners/spinner';
@include spinner;

This example shows how to customize the size, color, and animation duration of a spinner.

  1. Using a specific spinner type:
@import 'spinners/spinner-circle';
@include spinner-circle;

This code imports and includes the circle spinner variant.

  1. Combining multiple spinners:
@import 'spinners/spinner-circle';
@import 'spinners/spinner-double-bounce';

.loader-1 {
  @include spinner-circle;
}

.loader-2 {
  @include spinner-double-bounce;
}

This example demonstrates how to use multiple spinner types in the same project.

Getting Started

  1. Install SpinThatShit using npm:

    npm install spinthatshit
    
  2. Import the desired spinner in your Sass file:

    @import 'node_modules/spinthatshit/src/spinners/spinner';
    
  3. Include the spinner in your styles:

    .loading-indicator {
      @include spinner;
    }
    
  4. Add the corresponding HTML element:

    <div class="loading-indicator"></div>
    

Competitor Comparisons

29,203

A collection of CSS3 powered hover effects to be applied to links, buttons, logos, SVG, featured images and so on. Easily apply to your own elements, modify or just use for inspiration. Available in CSS, Sass, and LESS.

Pros of Hover

  • More comprehensive collection of hover effects (42 effects)
  • Better documentation and examples
  • Wider browser compatibility

Cons of Hover

  • Larger file size due to more effects
  • May require more customization for specific use cases
  • Some effects might be considered outdated or overused

Code Comparison

Hover:

.hvr-grow {
  display: inline-block;
  vertical-align: middle;
  transform: translateZ(0);
  box-shadow: 0 0 1px rgba(0, 0, 0, 0);
  backface-visibility: hidden;
}

SpinThatShit:

@mixin spinner($size: 40px, $thickness: 4px, $color: #333) {
  width: $size;
  height: $size;
  border: $thickness solid rgba($color, 0.25);
  border-top-color: $color;
  border-radius: 50%;
}

Hover focuses on providing ready-to-use CSS classes for various hover effects, while SpinThatShit offers customizable SCSS mixins for creating loading spinners. Hover's code is more specific to individual effects, whereas SpinThatShit's mixins are more flexible and allow for easy customization of spinner properties.

8,433

CSS3 Animations with special effects

Pros of Magic

  • More comprehensive CSS animation library with a wider range of effects
  • Better documentation and examples for easier implementation
  • Actively maintained with regular updates and improvements

Cons of Magic

  • Larger file size, which may impact page load times
  • More complex syntax for some animations compared to SpinThatShit
  • May require additional customization for specific use cases

Code Comparison

SpinThatShit:

@include spinner($name, $size, $thickness, $color, $speed, $type);

Magic:

.magictime {
  -webkit-animation-duration: 1s;
  animation-duration: 1s;
  -webkit-animation-fill-mode: both;
  animation-fill-mode: both;
}

Summary

Magic offers a more extensive set of animations and better documentation, making it suitable for projects requiring diverse effects. However, its larger file size and potentially more complex syntax may be drawbacks for simpler projects. SpinThatShit focuses specifically on spinner animations with a simpler implementation, which could be advantageous for projects primarily needing loading indicators. The choice between the two depends on the specific requirements of your project and the range of animations needed.

🍿 A cross-browser library of CSS animations. As easy to use as an easy thing.

Pros of animate.css

  • More comprehensive with a wider range of animations
  • Better browser compatibility and support
  • Larger community and more frequent updates

Cons of animate.css

  • Larger file size, which may impact page load times
  • More complex to customize or modify animations
  • Potential for overuse, leading to a less unique design

Code Comparison

animate.css:

.animate__animated {
  animation-duration: 1s;
  animation-fill-mode: both;
}

.animate__bounce {
  animation-name: bounce;
  transform-origin: center bottom;
}

SpinThatShit:

@mixin spin($duration: 1s, $timingFunction: linear, $iterationCount: infinite) {
  animation: spin $duration $timingFunction $iterationCount;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

animate.css offers a more declarative approach with predefined classes, while SpinThatShit uses SCSS mixins for more customizable animations. animate.css provides a broader range of animations out-of-the-box, whereas SpinThatShit focuses specifically on spinning animations with greater flexibility in implementation.

49,575

JavaScript animation engine

Pros of anime

  • More versatile and feature-rich animation library
  • Supports a wider range of animation types and properties
  • Larger community and more frequent updates

Cons of anime

  • Larger file size, which may impact page load times
  • Steeper learning curve due to more complex API
  • May be overkill for simple animation needs

Code Comparison

SpinThatShit:

@include spinner($name: spinner, $size: 40px, $thickness: 4px, $color: #000);

anime:

anime({
  targets: '.element',
  rotate: '1turn',
  duration: 2000,
  easing: 'easeInOutQuad'
});

SpinThatShit focuses on generating CSS-based loading spinners using SCSS mixins, while anime is a more comprehensive JavaScript animation library. SpinThatShit is simpler to use for creating loading spinners, but anime offers greater flexibility for various animation types across different properties and elements.

SpinThatShit is ideal for projects that primarily need loading spinners, while anime is better suited for complex animations or projects requiring diverse animation capabilities. The choice between the two depends on the specific animation needs of the project and the developer's preference for CSS or JavaScript-based solutions.

A simple library to take care of complicated animations.

Pros of Choreographer-js

  • More versatile, allowing for complex animations beyond just loading spinners
  • Provides a robust API for creating custom animations and transitions
  • Supports multiple animation types, including scroll-based animations

Cons of Choreographer-js

  • Steeper learning curve due to its more complex API
  • Requires more setup and configuration for basic animations
  • Larger file size, which may impact page load times

Code Comparison

SpinThatShit:

.loading {
  @include loading-spinner($size: 30px, $border-size: 3px, $border-color: #000, $duration: 1s);
}

Choreographer-js:

var choreographer = new Choreographer({
  animations: [
    {
      range: [-1, 1],
      selector: '#myElement',
      type: 'scale',
      style: 'opacity',
      from: 0,
      to: 1
    }
  ]
});

SpinThatShit focuses on simple, easy-to-implement loading spinners using SASS mixins. It's lightweight and straightforward but limited in functionality. Choreographer-js, on the other hand, offers a more powerful and flexible animation system that can handle various types of animations, including scroll-based effects. However, it requires more setup and has a steeper learning curve. The choice between the two depends on the specific animation needs of the project and the developer's familiarity with more complex animation systems.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

⚠️ THIS REPO IS DEPRECATED ⚠️

SpinThatShit

A set of SCSS mixins for single element loaders and spinners

View examples

Getting started

npm install spinthatshit
bower install SpinThatShit

OR

  • Clone or download repo
  • Include src folder to your project

Usage

Create a div with your custom loader class name:

<div class="your-loader"></div>

In your custom class name include a mixin of a loader. All loaders are ordered by number, so you will have to take a look in examples folder for your loader number.

.your-loader {
    @include loader01;
}

In _variables.scss there are default settings for loaders

$loader-color: #0052ec;
$loader-size: 56px;
$loader-height: 20px;
$loader-border-size: 8px;
$loader-gap: 12px;
$loader-animation-duration: 1s;

But you can also change these default settings, while your're including loader

@include loader09($size: 10px, $height: 48px, $gap: 8px, $duration: 1s, $align: middle);

All loaders can be also aligned to center, while including loader with parameter $align, $align: center is just for x axis, $align: middle is for both axis.

PARAMETERS

ParameterTypeDefault value
$sizeNumber$loader-size
$heightNumber$loader-height
$border-sizeNumber$loader-border-size
$colorColor$loader-color
$durationTime$loader-animation-duration
$gapNumber$loader-gap
$alignKeywordnull

NOTE: Some loaders may not need $height and $gap parameters.

Performance issues

Some loaders which are using box-shadow for animation may be causing high cpu usage and lag, I'll need to look into more details and fix it, if it's possible.

Contributing

If you have some new idea for loader/spinner or you want to fix loader just let me know.