Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialAndreas Høj
4,740 PointsSVG animation scale is laggy
Hi, as the title states - while scaling my svg it's a bit laggy and jumpy? Not really sure how to approach this problem. Anyone can help?
* {
margin: 0;
padding: 0;
}
body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
#Layer_1 {
height: 100px;
width: 100px;
color: #fff;
transition:fill 300ms ease-in-out;
transform-origin: center;
transform-box: fill-box;
}
.icon-container {
height: 50px;
width: 50px;
display: flex;
justify-content: center;
align-items: center;
background: #fff;
border-radius: 50% 50%
}
.icon-container:hover {
transition: ease-in-out;
animation: iconHover 1s forwards;
fill: #3B5998;
}
@keyframes iconHover {
0% {
height: 50px;
width: 50px;
background: #fff;
}
100% {
height: 150px;
width: 150px;
background: #3B5998;
}
}
```
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>SVG Social Icons</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<circle class="icon-container">
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 290.6 512"><defs>
<style>.cls-1{fill:#fff;}</style></defs><title>013-facebook</title>
<path class="cls-1" d="M200,493V288H127V192h73S183,14,298,14h86v87s-84-4-84,54,2,33,2,33l74.25,2v91L302,287l-3,206Z" transform="translate(-110.5 1)"/>
<path class="facebook-stroke" d="M290,511H208a24.86,24.86,0,0,1-24.84-24.84V301.23H135.34a24.87,24.87,0,0,1-24.84-24.84V197.14a24.86,24.86,0,0,1,24.84-24.83h47.83V132.63c0-39.35,12.36-72.83,35.73-96.81S275.18-1,313.78-1l62.53.1A24.87,24.87,0,0,1,401.1,23.94V97.52a24.86,24.86,0,0,1-24.83,24.83l-42.1,0c-12.84,0-16.11,2.57-16.81,3.36-1.15,1.31-2.52,5-2.52,15.22V172.3h58.27a25.23,25.23,0,0,1,12.29,3.13,24.91,24.91,0,0,1,12.78,21.72l0,79.24a24.86,24.86,0,0,1-24.83,24.83H314.84V486.16A24.86,24.86,0,0,1,290,511Zm-76.81-30h71.63V287.79a16.6,16.6,0,0,1,16.58-16.58h66.73l0-68.89H301.4a16.6,16.6,0,0,1-16.58-16.58V141c0-11.72,1.19-25.06,10-35.08,10.7-12.12,27.55-13.52,39.3-13.52h36.93V29.11L313.75,29c-62,0-100.56,39.7-100.56,103.61v53.11a16.6,16.6,0,0,1-16.58,16.58H140.52v68.89h56.09a16.6,16.6,0,0,1,16.58,16.58ZM376.25,29.12Z" transform="translate(-110.5 1)"/></svg>
</circle>
</body>
</html>