Interesting Hover Animation
How do I make an interesting hover animation?
A friend was describing a cool hover effect he had in mind to me. Unable to contain my interest, I decided to mock it up. Check out forks of this pen for his full mockup.. What is a interesting hover animation? How do you make a interesting hover animation? This script and codes were developed by Chris Burnell on 16 September 2022, Friday.
Interesting Hover Animation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Interesting Hover Animation</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <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! */ html, body { height: 100%; }
body { position: relative; z-index: 1; }
a { display: block; position: absolute; top: 50%; left: 50%; width: 160px; height: 40px; font: 400 24px/40px "Helvetica Neue", Arial, sans-serif; margin: -20px 0 0 -80px; text-align: center; text-decoration: none; color: blue; overflow: hidden; -webkit-transition: color .5s; transition: color .5s; -webkit-animation: normalEffect .5s 1; animation: normalEffect .5s 1;
}
a:hover { color: white; -webkit-animation: hoverEffect .25s 1; animation: hoverEffect .25s 1;
}
a:after { position: absolute; left: 0; top: -100%; width: 100%; height: 100%; content: ""; display: block; background: blue; z-index: -1; -webkit-animation: afterNormalSlide .5s 1; animation: afterNormalSlide .5s 1;
}
a:hover:after { top: 0; -webkit-animation: afterHoverSlide .5s 1; animation: afterHoverSlide .5s 1;
}
@keyframes normalEffect { 0% { opacity: 0; -webkit-transform: rotateX(180deg); -moz-transform: rotateX(180deg); -ms-transform: rotateX(180deg); transform: rotateX(180deg); } 100% { opacity: 1; -webkit-transform: rotateX(360deg); -moz-transform: rotateX(360deg); -ms-transform: rotateX(360deg); transform: rotateX(360deg); }
}
@keyframes hoverEffect { 0% { line-height: 40px; } 70% { line-height: 32px; } 100% { line-height: 40px; }
}
@keyframes afterNormalSlide { 0% { top: 0; } 100% { top: -100%; }
}
@keyframes afterHoverSlide { 0% { top: 100%; } 100% { top: 0; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <a href="#">Hover me</a> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>
Interesting Hover Animation - Script Codes CSS Codes
html, body { height: 100%; }
body { position: relative; z-index: 1; }
a { display: block; position: absolute; top: 50%; left: 50%; width: 160px; height: 40px; font: 400 24px/40px "Helvetica Neue", Arial, sans-serif; margin: -20px 0 0 -80px; text-align: center; text-decoration: none; color: blue; overflow: hidden; -webkit-transition: color .5s; transition: color .5s; -webkit-animation: normalEffect .5s 1; animation: normalEffect .5s 1;
}
a:hover { color: white; -webkit-animation: hoverEffect .25s 1; animation: hoverEffect .25s 1;
}
a:after { position: absolute; left: 0; top: -100%; width: 100%; height: 100%; content: ""; display: block; background: blue; z-index: -1; -webkit-animation: afterNormalSlide .5s 1; animation: afterNormalSlide .5s 1;
}
a:hover:after { top: 0; -webkit-animation: afterHoverSlide .5s 1; animation: afterHoverSlide .5s 1;
}
@keyframes normalEffect { 0% { opacity: 0; -webkit-transform: rotateX(180deg); -moz-transform: rotateX(180deg); -ms-transform: rotateX(180deg); transform: rotateX(180deg); } 100% { opacity: 1; -webkit-transform: rotateX(360deg); -moz-transform: rotateX(360deg); -ms-transform: rotateX(360deg); transform: rotateX(360deg); }
}
@keyframes hoverEffect { 0% { line-height: 40px; } 70% { line-height: 32px; } 100% { line-height: 40px; }
}
@keyframes afterNormalSlide { 0% { top: 0; } 100% { top: -100%; }
}
@keyframes afterHoverSlide { 0% { top: 100%; } 100% { top: 0; }
Developer | Chris Burnell |
Username | chrisburnell |
Uploaded | September 16, 2022 |
Rating | 3 |
Size | 2,686 Kb |
Views | 38,456 |
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 |
Globule Bleu Jobs Page Anchor Rollover Effect | 2,533 Kb |
The power of transform for centering | 3,747 Kb |
Infinite Square | 2,937 Kb |
Simple CSS Checkbox | 3,244 Kb |
Message Types | 2,987 Kb |
Interaction Jazz | 11,103 Kb |
Modal Container without JS | 3,272 Kb |
Square Illusion | 3,295 Kb |
Student Charter Demo for City University | 5,837 Kb |
Zoomy Anchor Thing | 2,680 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 |
CSS Donut Charts | Seanstopnik | 2,908 Kb |
SVG Animation | Thepheer | 4,793 Kb |
Sass Radar | Jlong | 6,887 Kb |
Pericles mi loro... | Judag | 4,125 Kb |
SVG Circle Progress | JMChristensen | 3,368 Kb |
Learning FlexBox | Alex_rodrigues | 2,821 Kb |
Product item | Mymahesh11 | 2,256 Kb |
Motion Lines - codevember - 02 - 2016 | Caiocares | 2,744 Kb |
Header Line Issue | Charlie-volpe | 1,768 Kb |
A Pen by Paul Sullivan | Pwsm50 | 2,349 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!