Progress Button Animation

Developer
Size
3,659 Kb
Views
10,120

How do I make an progress button animation?

Inspired from http://tympanus.net/Development/ProgressButtonStyles/. What is a progress button animation? How do you make a progress button animation? This script and codes were developed by EY-Intuitive on 17 January 2023, Tuesday.

Progress Button Animation Previews

Progress Button Animation - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Progress Button Animation</title> <link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300;
}
.outer { transition: background-color 0.4s ease; box-sizing: border-box; width: 200px; height: 60px; text-align: center; position: relative; background-color: #1abc9c; margin: 20px; color: #fff; cursor: pointer; line-height: 60px; overflow: hidden;
}
.outer:hover { background-color: #1cc9a7;
}
.outer span { transition: opacity 0.3s ease, margin-top 0.3s ease; display: block; font-size: 18px; position: absolute; top: 50%; right: 20px; margin-top: -20px; opacity: 0;
}
.outer .inner { transition: opacity 0.3s ease; width: 100%; height: 4px; background-color: #16a085; position: absolute; left: 0; bottom: 0; opacity: 0;
}
.outer .inner.active { opacity: 1; animation: progressAnimation 3s ease;
}
.outer.done span { opacity: 1; margin-top: -9px;
}
@keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@-webkit-keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@-moz-keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@-o-keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
p { margin: 20px;
}
p a { color: #1abc9c;
}
p a:visited { color: #1abc9c;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="outer"> Progress <div class="inner"></div> <span class="fa fa-check-circle"></span>
</div>
<p>Click the button to see the progress animation</p>
<p>Inspired from <a href="https://tympanus.net/Development/ProgressButtonStyles/" target="_blank">Codrops</a></p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Progress Button Animation - Script Codes CSS Codes

body { font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif; font-weight: 300;
}
.outer { transition: background-color 0.4s ease; box-sizing: border-box; width: 200px; height: 60px; text-align: center; position: relative; background-color: #1abc9c; margin: 20px; color: #fff; cursor: pointer; line-height: 60px; overflow: hidden;
}
.outer:hover { background-color: #1cc9a7;
}
.outer span { transition: opacity 0.3s ease, margin-top 0.3s ease; display: block; font-size: 18px; position: absolute; top: 50%; right: 20px; margin-top: -20px; opacity: 0;
}
.outer .inner { transition: opacity 0.3s ease; width: 100%; height: 4px; background-color: #16a085; position: absolute; left: 0; bottom: 0; opacity: 0;
}
.outer .inner.active { opacity: 1; animation: progressAnimation 3s ease;
}
.outer.done span { opacity: 1; margin-top: -9px;
}
@keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@-webkit-keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@-moz-keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@-o-keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
@keyframes progressAnimation { 0% { width: 0; } 20% { width: 5%; } 40% { width: 20%; } 60% { width: 70%; } 80% { width: 75%; } 100% { width: 100%; }
}
p { margin: 20px;
}
p a { color: #1abc9c;
}
p a:visited { color: #1abc9c;
}

Progress Button Animation - Script Codes JS Codes

$('.outer').click(function(){ $('.inner').addClass('active'); setTimeout(function(){ $('.outer').addClass('done'); }, 3500); setTimeout(function(){ $('.outer').removeClass('done'); $('.inner').removeClass('active'); }, 4500);
});
Progress Button Animation - Script Codes
Progress Button Animation - Script Codes
Home Page Home
Developer EY-Intuitive
Username ey_intuitive
Uploaded January 17, 2023
Rating 3.5
Size 3,659 Kb
Views 10,120
Do you need developer help for Progress Button 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!

EY-Intuitive (ey_intuitive) Script Codes
Create amazing blog posts 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!