CSS animated notification badge
How do I make an css animated notification badge?
CSS3 animated notification badge which animates on value change. What is a css animated notification badge? How do you make a css animated notification badge? This script and codes were developed by Sjmcpherson on 24 September 2022, Saturday.
CSS animated notification badge - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>CSS animated notification badge</title> <link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/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! */ @import url(http://weloveiconfonts.com/api/?family=entypo);
[class*="entypo-"]:before {font-family: 'entypo', sans-serif;font-size:50px;color:#555;}
html, body {height: 100%;}
body {align-items: center;display: flex;font-family: sans-serif;justify-content: center;}
.container{position:relative;-webkit-perspective: 1000;-webkit-backface-visibility: hidden;}
.badge-num { box-sizing:border-box; font-family: 'Trebuchet MS', sans-serif; background: #ff0000; cursor:default; border-radius: 50%; color: #fff; font-weight:bold; font-size: 16px; height: 30px; letter-spacing:-1px; line-height:1.55em; top:-4px; right:-12px; border:3px solid #fff; position: absolute; text-align: center; width: 30px; box-shadow: 1px 1px 5px rgba(0,0,0, .2); animation: pulse 1.5s 1;
}
.badge-num:after { content: ''; position: absolute; top:-2px; left:-2px; border:2px solid rgba(255,0,0,.5); opacity:0; border-radius: 50%; width:100%; height:100%; animation: sonar 1.5s 1;
}
@keyframes sonar { 0% {transform: scale(.9); opacity:1;} 100% {transform: scale(2);opacity: 0;}
}
@keyframes pulse { 0% {transform: scale(1);} 20% {transform: scale(1.4); } 50% {transform: scale(.9);} 80% {transform: scale(1.2);} 100% {transform: scale(1);}
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body>
<div class="container" id="badge"> <a class="entypo-bell"></a>
</div> <script src="js/index.js"></script>
</body>
</html>
CSS animated notification badge - Script Codes CSS Codes
@import url(http://weloveiconfonts.com/api/?family=entypo);
[class*="entypo-"]:before {font-family: 'entypo', sans-serif;font-size:50px;color:#555;}
html, body {height: 100%;}
body {align-items: center;display: flex;font-family: sans-serif;justify-content: center;}
.container{position:relative;-webkit-perspective: 1000;-webkit-backface-visibility: hidden;}
.badge-num { box-sizing:border-box; font-family: 'Trebuchet MS', sans-serif; background: #ff0000; cursor:default; border-radius: 50%; color: #fff; font-weight:bold; font-size: 16px; height: 30px; letter-spacing:-1px; line-height:1.55em; top:-4px; right:-12px; border:3px solid #fff; position: absolute; text-align: center; width: 30px; box-shadow: 1px 1px 5px rgba(0,0,0, .2); animation: pulse 1.5s 1;
}
.badge-num:after { content: ''; position: absolute; top:-2px; left:-2px; border:2px solid rgba(255,0,0,.5); opacity:0; border-radius: 50%; width:100%; height:100%; animation: sonar 1.5s 1;
}
@keyframes sonar { 0% {transform: scale(.9); opacity:1;} 100% {transform: scale(2);opacity: 0;}
}
@keyframes pulse { 0% {transform: scale(1);} 20% {transform: scale(1.4); } 50% {transform: scale(.9);} 80% {transform: scale(1.2);} 100% {transform: scale(1);}
}
CSS animated notification badge - Script Codes JS Codes
(function(d){ var i = 1; var badge = document.getElementById('badge'); var int = window.setInterval(function(){ updateBadge(i++); }, 2000); //Update the badge ever 5 seconds var badgeNum; function updateBadge(alertNum){//To rerun the animation the element must be re-added back to the DOM var badgeChild = badge.children[0]; if(badgeChild.className==='badge-num') badge.removeChild(badge.children[0]); badgeNum = document.createElement('div'); badgeNum.setAttribute('class','badge-num'); badgeNum.innerText = alertNum; var insertedElement = badge.insertBefore(badgeNum,badge.firstChild); }
})(document);
![CSS animated notification badge - Script Codes](http://shots.codepen.io/sjmcpherson/pen/qFeJL-512.jpg)
Developer | Sjmcpherson |
Username | sjmcpherson |
Uploaded | September 24, 2022 |
Rating | 4 |
Size | 3,231 Kb |
Views | 273,240 |
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!
Name | Size |
Display popup on first visit only | 2,094 Kb |
AngularJS View only DOM manipulation | 1,817 Kb |
File API demo | 2,178 Kb |
CSS Only Animated Tooltip | 3,218 Kb |
CSS animated notification badge | 3,231 Kb |
A Pen by sjmcpherson | 2,105 Kb |
Shake Me Error Signup Form using Angular | 6,758 Kb |
Overiding fixed image sizing for Responsive websites | 1,467 Kb |
CSS3 3D Shirt Flipper | 2,242 Kb |
Expanding Info Box | 2,992 Kb |
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!
Name | Username | Size |
CodeCamp Tribute Page | JonathanDeJesus | 6,860 Kb |
A Pen by Manoz | Manoz | 2,424 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
RRC wrapSwitch | Pshrmn | 2,922 Kb |
Table Exercise | Fresco | 9,585 Kb |
Base64 SVG Me | MrBambule | 44,786 Kb |
Sassy Buttons | Elyseholladay | 2,299 Kb |
Animated rainbow wave on canvas | Icodeforlove | 2,777 Kb |
A Pen by boilzzz | Boilzzz | 2,761 Kb |
AngularJS Skills | Supro | 3,312 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!