SVG Loading Animation

Developer
Size
2,786 Kb
Views
6,072

How do I make an svg loading animation?

SVG loading animation with some different easing options.. What is a svg loading animation? How do you make a svg loading animation? This script and codes were developed by Lloydwheeler on 26 January 2023, Thursday.

SVG Loading Animation Previews

SVG Loading Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SVG Loading Animation</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="easing"> <h3>Easing</h3> <select> <option data-easing="linear">Linear</option> <option data-easing="ease">Ease</option> <option data-easing="cubic-bezier-1">Cubic Bezier 1</option> <option data-easing="cubic-bezier-2">Cubic Bezier 2</option> <option data-easing="cubic-bezier-3">Cubic Bezier 3</option> </select>
</div>
<svg height="28" width="28"> <circle cx="14" cy="14" r="12" stroke="#bbb" stroke-width="4" fill="none" />
</svg>
<svg height="28" width="28" class="top linear"> <circle cx="14" cy="14" r="12" stroke="#00467f" stroke-width="4" fill="none" stroke-dasharray="15 80" stroke-dashoffset="-8"/>
</svg> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

SVG Loading Animation - Script Codes CSS Codes

body { background: #eee; color: #333; font-family: Helvetica, Arial, sans-serif;
}
h3 { font-size: .8125em; margin-bottom: .25rem; text-transform: uppercase;
}
select { float: left; margin-left: 60px; margin-top: -21px;
}
svg { position: absolute; top: 50%; left: 50%; margin-left: -14px; margin-top: -14px;
}
.top { z-index: 10; -webkit-animation: rotate 1s infinite; animation: rotate 1s infinite;
}
.top.linear { -webkit-animation-timing-function: linear; animation-timing-function: linear;
}
.top.ease { -webkit-animation-timing-function: ease; animation-timing-function: ease;
}
.top.cubic-bezier-1 { -webkit-animation-duration: 2s; animation-duration: 2s; -webkit-animation-timing-function: cubic-bezier(0.17, 0.67, 0.83, 0.67); animation-timing-function: cubic-bezier(0.17, 0.67, 0.83, 0.67);
}
.top.cubic-bezier-2 { -webkit-animation-duration: 2s; animation-duration: 2s; -webkit-animation-timing-function: cubic-bezier(0.17, 0.67, 0.28, 0.98); animation-timing-function: cubic-bezier(0.17, 0.67, 0.28, 0.98);
}
.top.cubic-bezier-3 { -webkit-animation-duration: 1.5s; animation-duration: 1.5s; -webkit-animation-timing-function: cubic-bezier(0.17, 0.67, 1, 0.31); animation-timing-function: cubic-bezier(0.17, 0.67, 1, 0.31);
}
@-webkit-keyframes rotate { from { -webkit-transform: rotateZ(0deg); transform: rotateZ(0deg); } to { -webkit-transform: rotateZ(360deg); transform: rotateZ(360deg); }
}
@keyframes rotate { from { -webkit-transform: rotateZ(0deg); transform: rotateZ(0deg); } to { -webkit-transform: rotateZ(360deg); transform: rotateZ(360deg); }
}

SVG Loading Animation - Script Codes JS Codes

$('select').change(function(e) { var easing = $(this).find(':selected').data('easing'); $('.top').attr('class', 'top ' + easing);
});
SVG Loading Animation - Script Codes
SVG Loading Animation - Script Codes
Home Page Home
Developer Lloydwheeler
Username lloydwheeler
Uploaded January 26, 2023
Rating 3
Size 2,786 Kb
Views 6,072
Do you need developer help for SVG Loading Animation?

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!

Lloydwheeler (lloydwheeler) Script Codes
Create amazing video scripts 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!