Here’s an example<\/a> that does things their own way that’s pretty interesting.<\/p>\n","protected":false},"excerpt":{"rendered":"JavaScript is the last of the ways we’ll cover on animating SVG. We looked at CSS, which is great and pretty comfortable, but it can’t do a number of SVG properties that you might want to animate. Then we looked at SMIL, which is a declarative syntax right in the SVG code itself, which is […]<\/p>\n","protected":false},"author":3,"featured_media":0,"parent":177022,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"lodge-video.php","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"sig_custom_text":"","sig_image_type":"featured-image","sig_custom_image":0,"sig_is_disabled":false,"inline_featured_image":false,"c2c_always_allow_admin_comments":false,"footnotes":""},"tags":[612,432,469],"acf":[],"jetpack-related-posts":[{"id":190764,"url":"https:\/\/css-tricks.com\/video-screencasts\/135-three-ways-animate-svg\/","url_meta":{"origin":187264,"position":0},"title":"#135: Three Ways to Animate SVG","date":"December 14, 2014","format":false,"excerpt":"Animating SVG is a bit unique in that there are three distinctly different ways you can approach animating it. 1. Animating with CSS @keyframes SVG elements can be targeted and styled with CSS. Meaning, you can apply animation through @keyframes. Like this: .left-leg { fill: orange; animation: dance 2s infinite\u2026","rel":"","context":"In \"animation\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":186540,"url":"https:\/\/css-tricks.com\/lodge\/svg\/23-animating-svg-smil\/","url_meta":{"origin":187264,"position":1},"title":"23: Animating SVG with SMIL","date":"October 18, 2014","format":false,"excerpt":"Even though animating SVG with CSS might be more comfortable for the average front-end person, SVG has another way do animation built right into the SVG syntax itself. This is exactly what we cover in brief in this video, but if you want a complete reference guide definitely check out\u2026","rel":"","context":"In \"animation\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":243521,"url":"https:\/\/css-tricks.com\/almanac\/properties\/o\/offset-path\/","url_meta":{"origin":187264,"position":2},"title":"offset-path","date":"July 19, 2016","format":false,"excerpt":"This property began life as motion-path. This, and all other related motion-* properties, are being renamed offset-* in the spec. We're changing the names here in the almanac. If you want to use it right now, probably best to use both syntaxes. The offset-path property in CSS defines a movement\u2026","rel":"","context":"In \"animation\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":186539,"url":"https:\/\/css-tricks.com\/lodge\/svg\/22-animating-svg-css\/","url_meta":{"origin":187264,"position":3},"title":"22: Animating SVG with CSS","date":"October 18, 2014","format":false,"excerpt":"When you use inline SVG, all that SVG code is right in the HTML, and thus in the DOM. You can style them just like you would a , , or any other HTML element. CSS styling brings the possibility of animations and transitions. A simple example: See the Pen\u2026","rel":"","context":"With 3 comments","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":246112,"url":"https:\/\/css-tricks.com\/snippets\/javascript\/convert-polygon-path-data\/","url_meta":{"origin":187264,"position":4},"title":"Convert Polygon to Path Data","date":"October 3, 2016","format":false,"excerpt":"I've had to do this a few times recently so I thought I'd save the method. StackOverflow has a method that works great: [].forEach.call(polys,convertPolyToPath); function convertPolyToPath(poly){ var svgNS = poly.ownerSVGElement.namespaceURI; var path = document.createElementNS(svgNS,'path'); var points = poly.getAttribute('points').split(\/\\s+|,\/); var x0=points.shift(), y0=points.shift(); var pathdata = 'M'+x0+','+y0+'L'+points.join(' '); if (poly.tagName=='polygon') pathdata+='z'; path.setAttribute('id',poly.getAttribute('id'));\u2026","rel":"","context":"Similar post","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":254303,"url":"https:\/\/css-tricks.com\/snippets\/svg\/shape-morphing-icons-button-click\/","url_meta":{"origin":187264,"position":5},"title":"Shape Morphing Icons in Button on Click","date":"May 4, 2017","format":false,"excerpt":"The idea here is use an SVG icon in a button and swap that icon out for another when the button is clicked. A button click often suggests an action has been taken, so switching icons can be a nice UI touch to show the change in context and confirm\u2026","rel":"","context":"In \"shape morphing\"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/187264"}],"collection":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/comments?post=187264"}],"version-history":[{"count":4,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/187264\/revisions"}],"predecessor-version":[{"id":344055,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/187264\/revisions\/344055"}],"up":[{"embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/pages\/177022"}],"wp:attachment":[{"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/media?parent=187264"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/css-tricks.com\/wp-json\/wp\/v2\/tags?post=187264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}