Giter Site home page Giter Site logo

yuren-tw / material-circular-loader Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 1.0 40 KB

Material Circular Loader in SCSS like a boss. Demo: http://codepen.io/YuRen/details/KdKKax

License: MIT License

CSS 100.00%
loading-spinner loader spinner material material-components material-design web-frontend html css scss

material-circular-loader's Introduction

Material Circular Loader

Google Material design: Progress & activity

Usage

HTML

<div class="circular-loader">
  <div class="stroke">
    <div class="stroke-left"></div>
    <div class="stroke-right"></div>
  </div>
</div> 

SCSS

.circular-loader {
  @include loader_circle(stroke); // class name of stroke
}

Size

Width and height are 2em. (radius of circle is 1em)
Use font-size to change the loader size.

SCSS

.circular-loader {
  @include loader_circle(stroke);
  font-size: 30px; // width and height become 60px
}

Single Color

Use color to change the loader color.

SCSS

.circular-loader {
  @include loader_circle(stroke);
  color: #2a74f6;
}

Multiple Colors

Include mixin loader_stroke_colors to change the loader color.

HTML

<div class="Cir my-color"> <!-- add a class -->
  <div class="S">
    <div class="S-left"></div>
    <div class="S-right"></div>
  </div>
</div> 

SCSS

.Cir {
  @include loader_circle(S);
  @include loader_stroke_colors(
    S,
    my-color,
    (#4285f4, #ea4335, #fbbc05, #34a853)
  );
  // (classNameOfStroke, addedClassName, listOfColors)
}

There are some lists of colors can be used:

List of colors Description Colors
$google_colors Google main colors Blue, Red, Yellow, Green
$google_colors_old (Old version)
$g_plus_colors Colors in Google+ app 7 colors
$google_pride_colors #prideforeveryone 6 colors

Pride For Everyone

Stroke Width

Stroke width defaults to (3/14) * 1em.
Include mixin loader_stroke_width to change the stroke width.

HTML

<div class="Cir new_width"> <!-- add a class -->
  <div class="S">
    <div class="S-left"></div>
    <div class="S-right"></div>
  </div>
</div> 

SCSS

.Cir {
  @include loader_circle(S);
  @include loader_stroke_width(S, new_width, 10px);
  // (classNameOfStroke, addedClassName, widthOfStroke)
}

Rotate Step

Rotate step defaults to 3 / 5. (a 5 pointed star shape)
Include mixin loader_stroke_rotate_step to change the rotate step.

HTML

<div class="Cir seven_star"> <!-- add a class -->
  <div class="S">
    <div class="S-left"></div>
    <div class="S-right"></div>
  </div>
</div> 

SCSS

.Cir {
  @include loader_circle(S);
  @include loader_stroke_rotate_step(seven_star, 3/7);
  // (addedClassName, step)
}

material-circular-loader's People

Contributors

yuren-tw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

2947721120

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.