SVG Hover Animations

Developer
Size
10,557 Kb
Views
10,120

How do I make an svg hover animations?

Messing around with SVG animations.. What is a svg hover animations? How do you make a svg hover animations? This script and codes were developed by Kyle Brumm on 07 January 2023, Saturday.

SVG Hover Animations Previews

SVG Hover Animations - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SVG Hover Animations</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='css/iledn.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="header"> <h1>SVG Hover Animations</h1> <p>By: Kyle Brumm</p>
</div>
<a class="container" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Kyle Brumm</div> </svg>
</a>
<a class="container2" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Sriracha Synth</div> </svg>
</a>
<a class="container3" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Jean Hoodie</div> </svg>
</a>
<a class="container4" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Authentic Chic</div> </svg>
</a>
<a class="container4-5" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Fixie Tofu</div> </svg>
</a>
<a class="container5" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Kale Leggings</div> </svg>
</a>
<a class="container6" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Viral Mustache</div> </svg>
</a>
<a class="container7" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Organic Banjo</div> </svg>
</a>
<a class="container8" href="http://kylebrumm.com" target="_blank"> <svg height="100%" width="100%" xmlns="http://www.w3.org/2000/svg"> <rect class="outline" height="100%" width="100%" /> <div class="text">Cosby sweater </div> </svg>
</a> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

SVG Hover Animations - Script Codes CSS Codes

$teal: #56D7C6 !default;
$purple: #B96CFF !default;
$dark-blue: #222232 !default;
html { background: $dark-blue; text-align: center; color: $teal; *, *:before, *:after { @include transition(1s); @include box-sizing(border-box); }
}
[class^="container"] { display: block; position: relative; color: $teal; text-decoration: none; @include size(250px, 50px); margin: 50px auto; overflow: hidden; .outline { @include coverer; stroke: $teal; stroke-width: 2px; fill: transparent; } .text { @include relative(-40px); font-family: 'Helvetica'; font-size: 1.5rem; line-height: 1; letter-spacing: 1px; text-transform: uppercase; } &:hover { .outline { stroke: $purple; } .text { color: $purple; } }
}
.container { .outline { stroke-dasharray: 25 25; stroke-dashoffset: -588; } &:hover { .outline { stroke-dasharray: 50 50; stroke-dashoffset: -275; } }
}
.container2 { .outline { stroke-dasharray: 50 250; stroke-dashoffset: -575; } &:hover { .outline { stroke-dasharray: 50 100; stroke-dashoffset: -75; } }
}
.container3 { .outline { stroke-dasharray: 70 230; stroke-dashoffset: 60; } &:hover { .outline { stroke-dashoffset: -350; } }
}
.container4 { .outline { stroke-dasharray: 50 600; stroke-dashoffset: -550; @include transition(0.5s); } &:hover { .outline { stroke-dashoffset: -250; } }
}
@include keyframes(woop) { 0% { stroke-dasharray: 50 600; stroke-dashoffset: -550; } 40%, 50% { stroke-dasharray: 50 600; stroke-dashoffset: -250; } 100% { stroke-dasharray: 600 0; stroke-dashoffset: 25; }
}
.container4-5 { .outline { stroke-dasharray: 50 600; stroke-dashoffset: -550; @include transition(1s); } &:hover { .outline { stroke-dasharray: 600 0; stroke-dashoffset: 25; @include animation(woop 1s linear); } }
}
.container5 { .outline { stroke-dasharray: 100 500; stroke-dashoffset: 225; @include transition(0.5s); } &:hover { .outline { stroke-dasharray: 600 0; stroke-dashoffset: 475; } }
}
.container6 { .outline { stroke-dasharray: 50 550; stroke-dashoffset: 200; @include transition(0.5s); } &:hover { .outline { stroke-dasharray: 50 250; stroke-dashoffset: 500; } }
}
@include keyframes(bounceRight) { 0% { @include translateX(-100%); } 30% { @include translateX(-100%); } 40%, 60%, 80%, 100% { @include translateX(0); } 50% { @include translateX(-30%); } 70% { @include translateX(-15%); } 90% { @include translateX(-7.5%); }
}
.container7 { .outline { stroke-width: 0; fill: $purple; @include translateX(-100%); @include transition(0.5s); } &:hover { .outline { @include translateX(0); @include animation(bounceRight 1s linear); } .text { color: $dark-blue; } }
}
@include keyframes(bounceDown) { 0% { @include translateY(-100%); } 30% { @include translateY(-100%); } 40%, 60%, 80%, 100% { @include translateY(0); } 50% { @include translateY(-30%); } 70% { @include translateY(-15%); } 90% { @include translateY(-7.5%); }
}
.container8 { .outline { stroke-width: 0; fill: $purple; @include translateY(-100%); @include transition(0.5s); } &:hover { .outline { @include translateY(0); @include animation(bounceDown 1s linear); } .text { color: $dark-blue; } }
}
SVG Hover Animations - Script Codes
SVG Hover Animations - Script Codes
Home Page Home
Developer Kyle Brumm
Username kjbrum
Uploaded January 07, 2023
Rating 4.5
Size 10,557 Kb
Views 10,120
Do you need developer help for SVG Hover Animations?

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!

Kyle Brumm (kjbrum) Script Codes
Create amazing SEO content 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!