Delightful, performance-focused pure css loading animations.

Overview

Loaders.css

Delightful and performance-focused pure css loading animations.

What is this?

See the demo

A collection of loading animations written entirely in css. Each animation is limited to a small subset of css properties in order to avoid expensive painting and layout calculations.

I've posted links below to some fantastic articles that go into this in a lot more detail.

Install

bower install loaders.css
npm i --save loaders.css

Usage

Standard
  • Include loaders.min.css
  • Create an element and add the animation class (e.g. <div class="loader-inner ball-pulse"></div>)
  • Insert the appropriate number of <div>s into that element
jQuery (optional)
  • Include loaders.min.css, jQuery, and loaders.css.js
  • Create an element and add the animation class (e.g. <div class="loader-inner ball-pulse"></div>)
  • loaders.js is a simple helper to inject the correct number of div elements for each animation
  • To initialise loaders that are added after page load select the div and call loaders on them (e.g. $('.loader-inner').loaders())
  • Enjoy

Customising

Changing the background color

Add styles to the correct child div elements

.ball-grid-pulse > div {
  background-color: orange;
}
Changing the loader size

Use a 2D Scale transform

.loader-small .loader-inner {
  transform: scale(0.5, 0.5);
}

Browser support

Check the can I use tables. All recent versions of the major browsers are supported and it has support back to IE9.

Note: The loaders aren't run through autoprefixer, see this issue.

IE 11 Firefox 36 Chrome 41 Safari 8

Contributing

Pull requests are welcome! Create another file in src/animations and load it in src/loader.scss.

In a separate tab run gulp --require coffee-script/register. Open demo/demo.html in a browser to see your animation running.

Further research

Inspired by loaders.css

A few other folks have taken loaders and ported them elsewhere.

Licence

The MIT License (MIT)

Copyright (c) 2016 Connor Atherton

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Comments
  • Remove prefixing

    Remove prefixing

    Everyone could/should be using Autoprefixer (or some similar/lesser tool) in their development environment. It's usually a bad practice to have prefixing in libraries.

    opened by corysimmons 15
  • Created mixins and fixes missing cross-browsers prefixes

    Created mixins and fixes missing cross-browsers prefixes

    I did some changes as introduce mixins to generate cross-browsers prefixes and fixes some missing styles too. When I built on my local machine, the demo wasn't running as I expected and as demo on your site.

    Thanks

    opened by marcelaraujo 5
  • Animation declaration dropped by Firefox

    Animation declaration dropped by Firefox

    Firefox can't parse this (example):
    animation: line-scale-pulse-out-rapid 0.9s 0 infinite cubic-bezier(.11,.49,.38,.78);

    After changing it to
    animation: line-scale-pulse-out-rapid 0.9s 0s infinite cubic-bezier(.11,.49,.38,.78);
    it works.

    opened by octycs 5
  • Added JS to populate `.loader-inner`s

    Added JS to populate `.loader-inner`s

    Cool library. I wouldn't actually use it if I had to manually insert a random number of divs into an element.

    1. It clutters development markup
    2. It's hard to remember how many divs go into XYZ

    This PR fixes that.

    opened by corysimmons 4
  • 'ball-clip-rotate' shouldn't pulse

    'ball-clip-rotate' shouldn't pulse

    I've removed the pulsing (change in scale) of this loader, as I figured their should be a version that simply spins without any kind of pulsing - just my opinion.

    opened by superelement 2
  • Added support for angularjs

    Added support for angularjs

    Same thing as loaders.css.js but for angular users that don't want to rely on JQuery or whatever js framework.

    This code relies on angular directives to achieve the same result and changes to the loader class will be instantly reflected (provided that you're in a scope digest)

    opened by Masadow 2
  • Angular directive

    Angular directive

    Not really an issue ;) For the need of a project, I wrote a directive which is doing basically the same stuff than the JQuery but for Angular.js. I thought it could be useful for some people.

    Feel free to check it : https://github.com/the-cormoran/angular-loaders

    Thanks for the good work btw.

    opened by alexjoffroy 2
  • Possible to change speed?

    Possible to change speed?

    These are beyond incredible. Is there currently a way to access the speed of the loading animation (slower/faster transitions between a given loader's various states)?

    opened by iggyigner 2
  • New : Android App developed

    New : Android App developed

    Hi,

    I just saw this, and very impressed . so i have decided to created my first android html app using loaders.css

    Play Store Link : https://play.google.com/store/apps/details?id=com.loader.css Github App Repo : https://github.com/technofreaky/Loaders.CSS-Android-App

    opened by varunsridharan 2
  • benchmarks

    benchmarks

    The description says emphasis is on performance, but how does this compare to other libraries (daneden/animate.css@c0abb26ee4a9d320df2ff2da4a133a9fbbe60125) or just an animated gif loader? Both CSS transitions and animated GIF loaders are blocked by JavaScript, but is there some other performance gain from using CSS transition loaders?

    opened by alanhamlett 2
  • Documentation on what browsers this supports

    Documentation on what browsers this supports

    I know i can dig into the code and use caniuse.com to figure this one out but I'm wondering if you know off hand what browsers this supports?

    If so then it would be awesome if you could throw a table into the Readme for quick reference.

    If not then just let me know and I'll jump in and cross reference with caniuse.com and maybe create a PR with the compatibility table :wink:

    opened by mansona 2
  • / deprecation warning outside of calc when processing using SASS package

    / deprecation warning outside of calc when processing using SASS package

    Hi! 👋

    Firstly, thanks for your work on this project! 🙂

    Today I used patch-package to patch [email protected] for the project I'm working on.

    Here is the diff that solved my problem:

    diff --git a/node_modules/loaders.css/src/animations/ball-scale-multiple.scss b/node_modules/loaders.css/src/animations/ball-scale-multiple.scss
    index ecd61fb..dff1fe0 100644
    --- a/node_modules/loaders.css/src/animations/ball-scale-multiple.scss
    +++ b/node_modules/loaders.css/src/animations/ball-scale-multiple.scss
    @@ -30,7 +30,7 @@ $size: 60px;
       @include ball-scale-multiple();
     
       position: relative;
    -  transform: translateY(-$size / 2);
    +  transform: translateY(calc(-$size / 2));
     
       > div {
         @include balls();
    

    This issue body was partially generated by patch-package.

    opened by Waaflee 0
  • This is the best! Just one quick question

    This is the best! Just one quick question

    I think that the license made it clear that I can do this, but just one question. instead of downloading the source, can I just copy this code into a css file and link it to my index.html like you did on your website? here is the css I am talking about: click here. I was just wondering if this would work, or if I need to give attribution, or if I am even allowed to.

    opened by stub-official-band 0
  • Add a new animation.

    Add a new animation.

    Hey, I am a new open source contributer who is interested in html, css, js. I was wondering if can add a new animation to your library. I can explain further if interested.

    opened by Rishi1314 0
  • How to scale the loader's size? Here is the right code

    How to scale the loader's size? Here is the right code

    css .loader-small .loader-inner { transform: scale(0.5, 0.5); }

    HTML <div class="loader-small"> <div class="loader-inner ball-pulse"> <div></div> <div></div> <div></div> </div><span class="tooltip"> <p>ball-pulse</p></span> </div>

    opened by heiyeliuying 0
Loading widget based on a Flare animation, allow you to create beautiful custom loading widgets or dialogs

flare_loading Loading widget based on a Flare animation, allow you to create custom loading widgets or dialogs If you're using Rive instead of Flare p

Jimmy Aumard 25 Apr 16, 2021
Shimmer loading - A Flutter project to show how to add shimmer loading animation

shimmer_loading A Flutter project to show how to add shimmer loading animation.

null 0 Feb 6, 2022
Render After Effects animations natively on Flutter. This package is a pure Dart implementation of a Lottie player.

Lottie for Flutter Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with Bodymovin and rende

Xavier H. 894 Jan 2, 2023
🚅Flutter out-of-the-box collection animations written in pure dart.

LoadingIndicator A collection of out of the box loading animations written in pure dart, no extra dependency, inspired by loaders.css and NVActivityIn

Tino 170 Jan 1, 2023
A Flutter package with a selection of simple yet very customizable set of loading animations.

Flutter Loading Animations A simple yet very customizable set of loading animations for Flutter projects. Installation Add the following to your pubsp

Andre Cytryn 171 Sep 23, 2022
Android loading animations

Android-SpinKit Android loading animations(I wrote a android edition according SpinKit) Demo Apk Preview Gradle Dependency dependencies { implement

ybq 8.4k Dec 30, 2022
A collection of awesome loading animations

NVActivityIndicatorView ⚠️ Check out LoaderUI (ready to use with Swift Package Mananger supported) for SwiftUI implementation of this. ?? Introduction

Vinh Nguyen 10.3k Jan 3, 2023
A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations.

flutter_animated_dialog A new Flutter dialog with a series of beautiful animations, slide fade rotate size scale rotate3D animations. Dialog barrier i

null 20 Dec 3, 2022
Create powerful animations in Flutter and use the hero animation for complex animations

Hero Animation - Locations UI - Flutter Create powerful animations in Flutter and use the hero animation for complex animations. ⚡  Social Media  Twit

null 3 Dec 11, 2021
Simple to use yet powerfull style widgets with syntax inspired by CSS.

Division Simple to use yet powerfull style widgets with syntax inspired by CSS. Please check out styled_widget which is a replacement of Division! The

Rein Gundersen Bentdal 266 Nov 20, 2022
Animation package for Flutter, inspired by Animate.css

animator Enables you to create stunning flutter animations, faster, efficient and with less code. Null safety: For null safety please use flutter_anim

Sjoerd van Den Berg 136 Dec 6, 2022
A growing collection of cool, elegant, efficient and performance-optimized animation widgets.

im_animations About A growing collection of cool, elegant, efficient and performance-optimized animation widgets. Feedback For any feedback please fil

iMujtaba Nazki 17 Nov 13, 2022
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.

✨ Flutter Spinkit A collection of loading indicators animated with flutter. Heavily inspired by @tobiasahlin's SpinKit. ?? Installing dependencies:

Jeremiah Ogbomo 2.7k Dec 30, 2022
Loading Animation With Flutter

Flutter Loading Animation loading.ista.mp4 A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few re

Join Flutter 17 Oct 13, 2022
Lazy Loading Flutter Plugin

flutter_placeholder_textlines A simple plugin to generate placeholder lines that emulates text in a UI, useful for displaying placeholder content whil

Victor HG 21 Apr 12, 2022
✨A clean and lightweight loading/toast widget for Flutter, easy to use without context, support iOS、Android and Web

Flutter EasyLoading English | 简体中文 Live Preview ?? https://nslog11.github.io/flutter_easyloading Installing Add this to your package's pubspec.yaml fi

nslog11 1k Jan 9, 2023
Help you to build pull-down refresh and pull-up loading in the simplest way.

frefresh Help you to build pull-down refresh and pull-up loading in the simplest way. Although unprecedented simplicity, but the effect is amazing. It

Fliggy Mobile 427 Nov 26, 2022
A Flutter library for loading skeletons

TODO: Put a short description of the package here that helps potential users know whether this package might be useful for them. Features TODO: List w

Daniel 0 Jan 6, 2022
Flutter ListView and GridView that shows Loading Widgets before the real data is loaded.

loadinglistview This package provide an easy way to show loading indicator(Widget) in a listview or a gridview while the app is still fetching the rea

null 3 Dec 8, 2021