Created
June 6, 2018 15:50
-
-
Save ZAYEC77/67319cd2830b7aa09721b23a64910c45 to your computer and use it in GitHub Desktop.
svg css animation generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var buff = ""; | |
var perc = 0; | |
var step = 1; | |
buff2 = ""; | |
document.getElementById('largeFire').childNodes.forEach(function(item) { | |
if (item.attributes && item.attributes.d) { | |
buff += perc + "% {\n"; | |
buff += "\t d: path('" + item.attributes.d.value + "');\n"; | |
buff += "}\n"; | |
perc += step; | |
buff2tmp = (100-perc) + "% {\n"; | |
buff2tmp += "\t d: path('" + item.attributes.d.value + "');\n"; | |
buff2tmp += "}\n"; | |
buff2 = buff2tmp + buff2; | |
} | |
}) | |
console.log(buff + buff2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment