Delightful, performance-focused pure css loading animations.

Related tags

CSS loaders.css
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
Data-tip.css - Wow, such tooltip, with pure css!

Notice: hint.css has been much better since I complained about it months ago, so try out its new features instead of this one! data-tip.css Wow, such

EGOIST 117 May 26, 2021
Tiny CSS framework with almost no classes and some pure CSS effects

no.css INTERACTIVE DEMO I am tired of adding classes to style my HTML. I just want to include a .css file and I expect it to style the HTML for me. no

null 96 Dec 10, 2022
CSS animations engine

Animatic With Animatic it's easy to animate over a hundred objects at a time. Each item can have it's mass and viscosity to emulate realistic objects!

Yehor Lvivski 1.4k Nov 20, 2022
A powerful little tool for managing CSS animations

NO LONGER BEING SUPPORTED Please consider https://github.com/ThrivingKings/animo instead animo.js A powerful little tool for managing CSS animations.

Daniel Raftery 2.1k Jan 2, 2023
700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

700+ Pure CSS, SVG & Figma UI Icons Available in SVG Sprite, styled-components, NPM & API

Astrit Malsija 8.9k Jan 2, 2023
A pure html and css library for dark mode in your website.

Dark Mode A pure html and css library for dark mode in your website. Features It has a smooth setting and also it changes via system settings aswell.

null 1 Jan 6, 2022
Pure CSS gauge component

Pure CSS gauge v0.2 Basic gauge component made with only CSS style rules. No SVG or canvas used in this component. This component can be easily themed

Otto Salminen 4 Oct 7, 2021
Reseter.css - A Futuristic CSS Reset / CSS Normalizer

Reseter.css A CSS Reset/Normalizer Reseter.css is an awesome CSS reset for a website. It is a great tool for any web designer. Reseter.css resets all

Krish Dev DB 1.1k Jan 2, 2023
A simple, performance-first, SEO-friendly Hugo theme

Hugo Theme Luna A simple, performance-first, SEO-friendly Hugo theme ?? Example | δΈ­ζ–‡ζ–‡ζ‘£ Introduction Using Tailwindcss Custom Themes Many shortcodes Da

Ice-Hazymoon 184 Jan 5, 2023
πŸ–Ό A pure client-side landing page template that you can fork, customize and host freely. Relies on Mailchimp and Google Analytics.

landing-page-boilerplate A pure client-side landing page template that you can freely fork, customize, host and link to your own domain name (e.g. usi

Adrien Joly 129 Dec 24, 2022
Spectre.css - A Lightweight, Responsive and Modern CSS Framework

Spectre.css Spectre.css is a lightweight, responsive and modern CSS framework. Lightweight (~10KB gzipped) starting point for your projects Flexbox-ba

Yan Zhu 11.1k Jan 8, 2023
Low-level CSS Toolkit – the original Functional/Utility/Atomic CSS library

Basscss Low-level CSS toolkit – the original Functional CSS library https://basscss.com Lightning-Fast Modular CSS with No Side Effects Basscss is a l

Basscss 5.8k Dec 31, 2022
Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation

Aphrodite Framework-agnostic CSS-in-JS with support for server-side rendering, browser prefixing, and minimum CSS generation. Support for colocating y

Khan Academy 5.3k Jan 1, 2023
CSS Boilerplate / Starter Kit: Collection of best-practice CSS selectors

Natural Selection Natural Selection is a CSS framework without any styling at all. It is just a collection of selectors that can be used to define glo

FrontAid CMS 104 Dec 8, 2022
Source code for Chrome/Edge/Firefox/Opera extension Magic CSS (Live editor for CSS, Less & Sass)

Live editor for CSS, Less & Sass (Magic CSS) Extension Live editor for CSS, Less & Sass (Magic CSS) for Google Chrome, Microsoft Edge, Mozilla Firefox

null 210 Dec 13, 2022
Easily create css variables without the need for a css file!

Tailwind CSS Variables This plugin allows you to configure CSS variables in the tailwind.config.js Similar to the tailwindcss configurations you are u

Mert Aşan 111 Dec 22, 2022
micro-library for CSS Flexbox and CSS Grid

SpeedGrid micro-library for CSS Flexbox and CSS Grid Overview SpeedGrid dynamically generates inline CSS by specifying the class name. Easy maintenanc

Toshihide Miyake 7 Mar 26, 2022
The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.

Bootstrap Sleek, intuitive, and powerful front-end framework for faster and easier web development. Explore Bootstrap docs Β» Report bug Β· Request feat

Bootstrap 161k Jan 1, 2023
Modern CSS framework based on Flexbox

Bulma Bulma is a modern CSS framework based on Flexbox. Quick install Bulma is constantly in development! Try it out now: NPM npm install bulma or Yar

Jeremy Thomas 46.6k Dec 31, 2022