SVG Path Animation using CSS3

Size
5,961 Kb
Views
36,432

How do I make an svg path animation using css3?

SVG Path Animation using CSS3. What is a svg path animation using css3? How do you make a svg path animation using css3? This script and codes were developed by Ahsan K. Rathore on 04 July 2022, Monday.

SVG Path Animation using CSS3 Previews

SVG Path Animation using CSS3 - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>SVG Path Animation using CSS3</title> <link rel="stylesheet" href="css/style.css">
</head>
<body>
<div style="position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%;">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="321px" height="273px" xml:space="preserve">
<g id="bp_svg"> <path fill="#18739E" d="M99.432,2.218H69.986V69.85c1.019-0.75,1.82-1.677,2.976-2.518c0.523-0.381,1.26-0.827,1.608-1.324	c0.456-0.65,0.746-1.16,1.006-1.668c0.815-1.59,4.188-2.744,5.738-3.784c1.365-0.917,2.536-1.725,3.96-2.551	c1.484-0.861,2.687-1.442,4.035-2.286c0.902-0.563,1.751-1.696,2.76-2.138v-0.052h0.119c0.356-0.134,0.735-0.178,1.145-0.076	c0.121,0.032,0.271,0.056,0.436,0.076h6.638c19.163,0,30.094-8.771,30.094-25.007v-0.434C130.5,11.636,120.651,2.218,99.432,2.218z	"/>	<path fill="#18739E" d="M50.5,39.563c8.662-2.274,13.101-8.01,13.101-16.673v-0.433c0-12.013-7.795-20.239-26.09-20.239H2.976	V54.66c0.166-0.134,0.333-0.269,0.502-0.401c0.948-0.745,2.072-1.202,2.725-2.134c0.629-0.9,0.393-1.634,1.248-2.344	c0.88-0.732,2.187-0.386,3.021-0.807c1.297-0.654,1.048-1.314,2.056-2.321c2.385-2.38,5.056,0.37,7.237,1.386	c1.479,0.69,3.263,0.456,4.622,1.528c1.336,1.053,1.954,2.898,2.98,4.258c0.509,0.103,0.996,0.246,1.398,0.402	c0.651,0.252,0.712,0.574,1.166,1.027c0.27,0.268,0.539,0.457,0.786,0.69c1.103,0.346,1.785,1.113,2.771,1.81	c2.955,2.086,5.602,4.48,8.269,6.82c0.317,0.276,0.703,0.599,1.113,0.952c0.225,0.107,0.451,0.217,0.668,0.32	c1.561,0.744,7.42,0.549,7.785,2.622c0.586,0.196,1.172,0.39,1.767,0.556c1.09,0.308,2.027,0.681,3.003,1.191	c0.848,0.286,1.679,0.601,2.469,0.974c0.18,0.035,0.358,0.07,0.553,0.094c0.857,0.102,1.704,0.147,2.551,0.263	c2.899-3.459,4.318-7.979,4.318-13.473V57.64C65.983,46.923,60.027,41.187,50.5,39.563z M46.483,17.25	c-0.13,0.26-0.325,0.472-0.586,0.65c-0.292,0.196-0.569,0.391-0.828,0.618c-0.537,0.471-1.156,0.846-1.822,1.138	c-0.05,0.016-0.098,0.033-0.164,0.065c0,0.017,0,0.032,0,0.032c0,0.017,0,0.033-0.015,0.033c-0.277,0.309-0.587,0.553-0.928,0.781	c-0.081,0.212-0.194,0.407-0.326,0.569c0.114-0.017,0.245-0.017,0.358-0.017c0.309-0.065,0.568,0,0.765,0.195	c0.032,0.017,0.049,0.065,0.065,0.114c0,0,0,0.016-0.017,0.016c0,0.032,0,0.048,0,0.065l-0.017,0.016	c-0.016,0-0.016,0.017-0.016,0.017c0,0.016,0,0.033,0,0.049v0.015c-0.195,0.537-0.521,0.976-0.959,1.317	c0.015,0.245-0.083,0.472-0.294,0.684c-0.13,0.129-0.293,0.243-0.455,0.325c-0.05,0.033-0.098,0.049-0.146,0.081	c0.097,0.31,0.049,0.57-0.163,0.797c-0.048,0.049-0.131,0.082-0.242,0.065c-0.165-0.033-0.311-0.098-0.44-0.195	c-0.08-0.049-0.146-0.114-0.212-0.163c-0.082-0.065-0.18-0.146-0.261-0.211c0,0,0,0-0.016,0c0.228,0.179,0.39,0.375,0.537,0.635	c0,0,0,0.016,0.018,0.016c0.08,0.097,0.177,0.179,0.275,0.244c0.049,0.016,0.082,0.065,0.114,0.114	c0.015,0.244-0.082,0.423-0.294,0.586c-0.065,0.065-0.096,0.163-0.129,0.26v0.017c-0.017,0.033-0.017,0.033-0.017,0.049	c0,0.016,0,0.016,0.017,0.016c0.033,0.032,0.081,0.065,0.113,0.098c0.016,0.113,0,0.244-0.032,0.358c0,0.016,0,0.032,0,0.065	c-0.018,0.016-0.018,0.016-0.033,0.032c0,0,0,0.017-0.015,0.017c0.015,0.064,0,0.13-0.05,0.195c0,0.016-0.017,0.016-0.017,0.016	c0,0.082,0,0.147,0,0.212c0,0.032,0,0.032,0,0.048c-0.228,0.195-0.455,0.163-0.65-0.098c-0.098-0.129-0.196-0.243-0.293-0.325	c0.063,0.179,0.13,0.375,0.177,0.569c0.084,0.098,0.18,0.179,0.278,0.261c0.081,0.585-0.13,0.976-0.667,1.203	c-0.048,0.016-0.098,0.033-0.146,0.049c0.099,0.146,0.114,0.326,0.082,0.553c-0.017,0.098-0.033,0.212-0.063,0.325	c-0.052,0.228-0.197,0.39-0.392,0.505c0,0.015,0,0.015,0,0.015c-0.017,0.065-0.05,0.114-0.082,0.13c0,0.064,0,0.13,0,0.179	c-0.016,0.374-0.179,0.602-0.521,0.683c0,0.016,0,0.032,0,0.049c0,0.016,0,0.032,0,0.032c-0.049,0.082-0.082,0.163-0.146,0.245	c0,0.032,0,0.082,0,0.13c0,0.016,0,0.032,0,0.049c-0.131,0.26-0.342,0.422-0.636,0.472c0,0.13-0.016,0.276-0.048,0.407v0.016	c-0.131,0.146-0.293,0.228-0.488,0.228c0,0.098-0.048,0.195-0.13,0.276c-0.034,0.098-0.082,0.179-0.146,0.26	c-0.082,0.049-0.178,0.049-0.277,0.016c-0.049,0.179-0.162,0.276-0.341,0.309h-0.019c0.053,0.065,0.099,0.146,0.133,0.228	c0,0,0,0.017,0.017,0.032c0.064,0.082,0.129,0.163,0.178,0.261c0.017,0.016,0.017,0.016,0.032,0.032v0.017c0,0.016,0,0.016,0,0.033	c0.017,0.016,0.032,0.049,0.05,0.082c0.017,0,0.017,0.016,0.017,0.032s-0.017,0.033-0.034,0.049v0.016	c-0.032,0.016-0.081,0.016-0.113,0.033c0,0,0,0,0,0.016c0.521,0.326,1.058,0.634,1.628,0.912c0.211,0.097,0.405,0.227,0.585,0.389	c0,0.017,0,0.017,0,0.033c-0.018,0-0.018,0.017-0.034,0.017c-0.162-0.065-0.323-0.147-0.487-0.228	c0.017,0.033,0.065,0.049,0.098,0.081c0.993,0.488,2.001,0.943,3.025,1.366c0.017,0,0.05,0.017,0.065,0.033	c0.292,0.097,0.553,0.228,0.78,0.422c0.195,0.082,0.391,0.179,0.585,0.277c0,0,0,0,0.019,0c0-0.016,0.016-0.016,0.032-0.016	c0.243,0.016,0.39,0.113,0.438,0.309c0.017,0,0.017,0,0.017,0.017c0.016,0.065-0.017,0.097-0.082,0.114	c-0.112,0.032-0.228,0.064-0.358,0.064c-0.179,0.229-0.423,0.343-0.73,0.31c-0.132,0-0.261-0.016-0.392-0.016	c0,0.032-0.017,0.049-0.048,0.064c-0.017,0.017-0.033,0.017-0.049,0.033c0,0.033,0,0.049,0,0.082	c0.032,0.032,0.065,0.064,0.113,0.097c0,0.017,0,0.017,0.017,0.032c-0.017,0.017-0.017,0.033-0.033,0.049v0.016	c-0.129,0-0.243-0.016-0.357-0.049c-0.098,0-0.161,0.016-0.244,0.016c-0.064,0.033-0.114,0.081-0.163,0.114	c0.066,0.097,0.13,0.179,0.18,0.277c0.017,0.032,0.017,0.065-0.017,0.081c-0.13-0.016-0.261-0.064-0.39-0.129	c-0.017,0.016-0.017,0.016-0.033,0.032c-0.033,0.049-0.081,0.097-0.114,0.13c-0.161,0.164-0.356,0.228-0.587,0.228	c0.019,0.016,0.019,0.048,0.035,0.065c0,0.016,0,0.032,0.017,0.048c0,0.017,0.015,0.033,0.015,0.05	c0.018,0.016,0.018,0.032,0.018,0.048c0,0.017,0,0.017,0,0.033c0,0.016-0.018,0.016-0.018,0.032c-0.015,0-0.031,0-0.048,0	c-0.05,0.114-0.113,0.13-0.212,0.049c-0.016-0.017-0.033-0.033-0.049-0.049c0,0.032-0.016,0.065-0.016,0.098	c-0.017,0.017-0.032,0.032-0.066,0.049c-0.016,0.016-0.031,0.032-0.048,0.048c0,0.131-0.033,0.261-0.098,0.375	c-0.017,0.048-0.047,0.098-0.099,0.146c0,0.016,0,0.016,0,0.032v0.017c0,0.016-0.016,0.032-0.03,0.064	c0.015,0.049,0,0.098-0.018,0.131c-0.017,0.032-0.017,0.081-0.017,0.129c-0.017,0.033-0.032,0.049-0.064,0.082l-0.017,0.017	c-0.065,0.016-0.113,0.016-0.163,0.016v0.016c-0.048,0.098-0.048,0.211-0.048,0.326c0.017,0.064,0,0.13-0.033,0.179	c-0.098,0.033-0.178,0.017-0.275-0.048c0,0,0,0,0-0.017v-0.016c-0.277-0.162-0.504-0.39-0.668-0.683	c-0.114-0.179-0.244-0.342-0.406-0.489c-0.032-0.016-0.064-0.048-0.098-0.081c-0.553-0.569-1.122-1.138-1.707-1.691	c-0.116-0.097-0.213-0.212-0.326-0.343c-0.212-0.275-0.423-0.552-0.618-0.829c0.065,0.147,0.082,0.31,0.05,0.473	c-0.017,0-0.034,0.016-0.05,0.016c-0.18-0.178-0.309-0.406-0.374-0.667c-0.066-0.194-0.131-0.39-0.229-0.569	c-0.195-0.147-0.405-0.228-0.684-0.277h-0.016c-0.179,0.115-0.324,0.26-0.472,0.423c-0.163,0.033-0.357,0.033-0.536,0	c-0.179,0.31-0.455,0.407-0.813,0.326c-0.211,0.276-0.471,0.391-0.765,0.31c-0.049,0.032-0.098,0.064-0.146,0.097	c-0.047,0-0.081,0.033-0.114,0.049c-0.26,0.146-0.487,0.146-0.73,0.032c-0.017-0.017-0.017-0.017-0.034-0.017h-0.017	c-0.341,0.293-0.715,0.358-1.121,0.195c-0.018-0.016-0.032-0.032-0.049-0.048h-0.016c-0.083,0.048-0.195,0.065-0.31,0.065	c-0.017,0-0.032,0-0.049,0c-0.261,0.211-0.57,0.293-0.912,0.228c-0.064,0.066-0.128,0.13-0.228,0.179	c-0.211,0.114-0.422,0.13-0.602,0.064c-0.096,0.049-0.212,0.082-0.342,0.114c-0.212,0.033-0.422,0.033-0.65-0.016h-0.032	c-0.194,0.211-0.473,0.293-0.847,0.244c-0.096-0.016-0.194-0.016-0.308-0.033c-0.082-0.064-0.18-0.129-0.244-0.211	c-0.018,0-0.032,0-0.05,0c-0.114,0.049-0.227,0.049-0.356,0.033c-0.099-0.017-0.196-0.033-0.294-0.064	c-0.129,0.553-0.341,1.073-0.65,1.578c-0.211,0.357-0.455,0.683-0.748,0.976c-0.146,0.146-0.294,0.179-0.438,0.082	c0-0.017,0-0.033,0-0.049c0-0.017,0-0.049,0-0.065c0.195-0.618,0.309-1.252,0.341-1.919c0.016-0.179,0.032-0.341,0.082-0.503	c-0.358,0.472-0.813,0.894-1.351,1.22c-0.18,0.13-0.357,0.13-0.521,0.016c0-0.016,0-0.016,0-0.033c0-0.016,0-0.032,0-0.048	c0.017-0.016,0.033-0.033,0.05-0.049c0.016-0.016,0.033-0.016,0.048-0.032c0.228-0.57,0.472-1.139,0.717-1.725	c-0.31,0.228-0.65,0.391-1.025,0.488c-0.261,0.066-0.505,0.049-0.731-0.064c0-0.017,0-0.033,0.016-0.049v-0.017	c0.292-0.276,0.521-0.585,0.684-0.943c0.017-0.015,0.032-0.048,0.05-0.065c-0.033,0-0.066,0-0.082,0c-0.033,0-0.051,0-0.065,0	c-0.228,0.017-0.456,0-0.699-0.048c-0.033,0-0.065-0.017-0.081-0.033c-0.05-0.016-0.082-0.016-0.146-0.032c0-0.017,0-0.017,0-0.017	c0,0.017,0,0.017-0.017,0.017c0.194-0.326,0.52-0.586,0.993-0.797c-0.212-0.017-0.408-0.082-0.603-0.195l-0.163-0.098l0.032-0.049	c0.115-0.017,0.228-0.048,0.342-0.081c0.651-0.179,1.236-0.472,1.789-0.846c0.065-0.033,0.114-0.082,0.179-0.114	c0.051-0.049,0.115-0.098,0.164-0.147c0.129-0.146,0.275-0.292,0.423-0.438c0.064-0.065,0.146-0.147,0.228-0.228	c0.244-0.26,0.536-0.472,0.846-0.65c0.244-0.114,0.487-0.196,0.748-0.212c0.603-0.016,1.204-0.146,1.772-0.325	c0.474-0.146,0.96-0.261,1.464-0.342c0.244-0.049,0.472-0.082,0.718-0.163c0.112-0.049,0.242-0.081,0.372-0.131	c-0.017-0.032-0.032-0.064-0.048-0.097c-0.017-0.049-0.033-0.098-0.051-0.163c-0.031-0.098-0.047-0.211-0.047-0.309	c-0.033,0.033-0.049,0.065-0.049,0.097c-0.018,0.032-0.018,0.065-0.018,0.114c0,0,0,0.032,0,0.049c-0.016,0-0.016,0-0.032,0	c0,0.017-0.016,0.017-0.032,0.033c-0.016-0.016-0.016-0.033-0.031-0.033c-0.099,0-0.181-0.049-0.245-0.146	c-0.033-0.065-0.065-0.114-0.081-0.179c-0.033-0.065-0.048-0.147-0.065-0.228v0.016c-0.017-0.114-0.017-0.163-0.032-0.195	c0.016-0.423,0.179-0.7,0.504-0.862c0.065-0.049,0.163-0.114,0.31-0.163c0.146-0.081,0.309-0.13,0.488-0.162	c0.244-0.049,0.455-0.016,0.649,0.082c0.229,0.113,0.455,0.113,0.651,0c0.146-0.098,0.309-0.18,0.455-0.244	c0.114-0.065,0.212-0.114,0.293-0.163c0.422-0.488,0.749-1.008,1.008-1.61c0.261-0.634,0.522-1.285,0.749-1.952	c0.244-0.651,0.488-1.285,0.764-1.919c0.163-0.358,0.326-0.7,0.487-1.057c0.018-0.033,0.067-0.065,0.099-0.098	c0.049-0.082,0.131-0.163,0.213-0.244c0.325-0.277,0.617-0.569,0.926-0.878c0.568-0.585,1.108-1.204,1.643-1.805	c0.457-0.553,0.896-1.106,1.286-1.708c0.325-0.521,0.65-1.042,0.96-1.578c0.243-0.423,0.472-0.846,0.731-1.269	c0.063-0.13,0.146-0.244,0.261-0.325c0.015,0,0.049,0,0.064,0c0.016,0.016,0.031,0.016,0.049,0.016	c0.065,0.097,0.097,0.194,0.081,0.325c0,0.017,0.016,0.098,0.049,0.244c0.032,0.13-0.016,0.342-0.147,0.651	c0.293-0.309,0.521-0.569,0.668-0.749c0.423-0.521,0.911-0.976,1.464-1.35c0.065-0.065,0.162-0.13,0.276-0.162	c0.033-0.017,0.065-0.017,0.098-0.032c0-0.017,0.017-0.033,0.049-0.049c0,0,0.017,0,0.017-0.017	c0.017,0.017,0.031,0.017,0.05,0.017c0.032,0.032,0.032,0.065,0.032,0.114c0,0,0,0.016,0,0.033	c-0.228,0.65-0.537,1.252-0.945,1.837c0,0,0,0,0,0.017s-0.016,0.017-0.016,0.033c0-0.016,0.016-0.016,0.033-0.033	c0.097-0.113,0.212-0.228,0.326-0.325c0.536-0.505,1.104-0.959,1.707-1.382c0.212-0.163,0.438-0.277,0.684-0.342	c0-0.016,0-0.016,0-0.016c0.016-0.017,0.016-0.017,0.016-0.017c0.016,0,0.032,0,0.032,0c0.017,0.033,0.051,0.064,0.082,0.098	c-0.017,0-0.031,0.016-0.05,0.033c0.019,0.016,0.019,0.016,0.019,0.032c-0.148,0.504-0.393,0.959-0.717,1.366v0.017	c-0.13,0.13-0.244,0.276-0.39,0.407c-0.181,0.163-0.36,0.341-0.521,0.521c-0.018,0-0.018,0-0.018,0.016	c-0.114,0.114-0.229,0.228-0.325,0.342c0.112-0.098,0.243-0.195,0.374-0.293c0,0,0,0,0-0.015c0.357-0.277,0.716-0.553,1.073-0.83	c0.455-0.358,0.928-0.618,1.448-0.797c0.113,0,0.211,0.017,0.292,0.065c0.016,0.016,0.016,0.016,0.033,0.033	c-0.018,0-0.033,0-0.033,0s0,0,0,0.016c-0.081,0.292-0.243,0.569-0.472,0.813c-0.064,0.065-0.13,0.13-0.195,0.179l-1.139,1.203	l-0.731,0.667c-0.032,0.033-0.08,0.049-0.13,0.082c-0.131,0.098-0.259,0.195-0.391,0.293c-0.033,0.016-0.064,0.049-0.099,0.065	v0.016c-0.097,0.065-0.177,0.13-0.26,0.195c0.099-0.048,0.18-0.098,0.294-0.146c0.031-0.016,0.082-0.032,0.113-0.048h0.017	c0.439-0.211,0.877-0.39,1.333-0.57c0-0.016,0-0.016,0-0.016c0.213-0.081,0.423-0.162,0.636-0.243	c0.438-0.18,0.894-0.326,1.365-0.424c0.277-0.114,0.536-0.211,0.813-0.308c0.034,0.016,0.05,0.032,0.083,0.048l0.016,0.017	C46.63,17.135,46.564,17.2,46.483,17.25z"/>
</g>
</svg>
</body>
</html>

SVG Path Animation using CSS3 - Script Codes CSS Codes

html, body { margin: 0; padding: 0;
}
@-webkit-keyframes dash { 70%,80% { stroke-dashoffset: 0; fill-opacity: 0; } 85% { fill-opacity: 0; stroke-opacity: 1; } 95% { stroke: #17739D; stroke-dashoffset: -301; stroke-opacity: 0; } 100% { fill-opacity: 1; stroke-dashoffset: -301; }
}
@-o-keyframes dash { 70%,80% { stroke-dashoffset: 0; fill-opacity: 0; } 85% { fill-opacity: 0; stroke-opacity: 1; } 95% { stroke: #17739D; stroke-dashoffset: -301; stroke-opacity: 0; } 100% { fill-opacity: 1; stroke-dashoffset: -301; }
}
@-moz-keyframes dash { 70%,80% { stroke-dashoffset: 0; fill-opacity: 0; } 85% { fill-opacity: 0; stroke-opacity: 1; } 95% { stroke: #17739D; stroke-dashoffset: -301; stroke-opacity: 0; } 100% { fill-opacity: 1; stroke-dashoffset: -301; }
}
@keyframes dash { 70%,80% { stroke-dashoffset: 0; fill-opacity: 0; } 85% { fill-opacity: 0; stroke-opacity: 1; } 95% { stroke: #17739D; stroke-dashoffset: -301; stroke-opacity: 0; } 100% { fill-opacity: 1; stroke-dashoffset: -301; }
}
#Layer_1 { margin-left: auto; margin-right : auto; top: 50%; position: absolute; left: 50%; margin-left: -65px; margin-top: -35px; }
svg { background: #fff; display: block;
}
svg * { stroke: #666; #stroke: #17739D; stroke-width: 1; fill-opacity: 0; stroke-dasharray: 350; stroke-dashoffset: 440;
}
svg #bp_svg * { -webkit-animation-name : dash; -moz-animation-name : dash; -o-animation-name : dash; animation-name : dash; -webkit-animation-duration: 4s; -moz-animation-duration: 4s; -o-animation-duration: 4s; animation-duration: 4s; -webkit-animation-timing-function : linear; -moz-animation-timing-function : linear; -o-animation-timing-function : linear; animation-timing-function : linear; -webkit-animation-fill-mode : forwards; -moz-animation-fill-mode : forwards; -o-animation-fill-mode : forwards; animation-fill-mode : forwards; -webkit-animation-delay : 1s; -moz-animation-delay : 1s; -o-animation-delay : 1s; animation-delay : 1s;
}
SVG Path Animation using CSS3 - Script Codes
SVG Path Animation using CSS3 - Script Codes
Home Page Home
Developer Ahsan K. Rathore
Username ahsanrathore
Uploaded July 04, 2022
Rating 3
Size 5,961 Kb
Views 36,432
Do you need developer help for SVG Path Animation using CSS3?

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!

Ahsan K. Rathore (ahsanrathore) Script Codes
Create amazing web 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!