SCSS Loading Circle Mixin

Developer
Size
2,985 Kb
Views
54,648

How do I make an scss loading circle mixin?

Easily add customized loading circles through a scss mixin. Customizable color, size, and speed.. What is a scss loading circle mixin? How do you make a scss loading circle mixin? This script and codes were developed by Chris Barnes on 11 August 2022, Thursday.

SCSS Loading Circle Mixin Previews

SCSS Loading Circle Mixin - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SCSS Loading Circle Mixin</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="load"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

SCSS Loading Circle Mixin - Script Codes CSS Codes

@import "compass/css3";
// mixin: animate
//
// Animation mixin for browser compatability
// params
// - $animation: standard css animation
@mixin animate($animation)
{	-webkit-animation:$animation;	-moz-animation:$animation;	-o-animation:$animation;	animation:$animation;
}
// mixin: frames
//
// Keyframes mixin for browser compatability
// params
// - $title: name of animation
// - @content: keyframes are defined normally
// - i.e. 0%:{...} or to:{...}
@mixin frames($title)
{	@-webkit-keyframes #{$title} { @content; }	@-moz-keyframes #{$title} { @content; }	@-o-keyframes #{$title} { @content; }	@keyframes #{$title} { @content; }
}
// mixin: loader
//
// Creates customizable circle 'loading' animation
// params
// - $color: color of loading circle
// - $size: diameter of circle
// - $speed: speed of animation
@mixin loader($color: #fff, $size: 30px, $speed: .5s)
{ border:2px solid $color; height:$size; width:$size; transition:border $speed; @include border-radius($size); @include animate(cycle $speed infinite reverse);
}
// keyframes: cycle
//
// animation keyframes via frames mixin
// changes border color to transparent for
// top, right, bottom, and left individually
@include frames('cycle')
{ 25%: { border-top-color:transparent; } 50%: { border-right-color:transparent; } 75%: { border-bottom-color:transparent; } 100%: { border-left-color:transparent; }
}
/** * Page Styles */
body
{ background-color:#242424;
}
#load
{ // convenience size var $size: 36px; // positioning the loading circle left:50%; margin-left:-($size/2) - 2px; margin-top:-($size/2) - 2px; position:absolute; top:50%; // call the loading circle mixin @include loader(#ff9900, $size, .6s);
}
SCSS Loading Circle Mixin - Script Codes
SCSS Loading Circle Mixin - Script Codes
Home Page Home
Developer Chris Barnes
Username csbarnes
Uploaded August 11, 2022
Rating 3
Size 2,985 Kb
Views 54,648
Do you need developer help for SCSS Loading Circle Mixin?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Barnes (csbarnes) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!