Last active
October 15, 2016 05:34
-
-
Save HelloWorld017/2fc07e6954192a93bd942bc608478505 to your computer and use it in GitHub Desktop.
Scripts which are used to create loading animation
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
create = (r, r2, cx, cy, className) => { | |
str = ''; | |
for(let _angle = 0; _angle < 360; _angle += 30){ | |
angle = _angle * Math.PI / 180; | |
let cos = Math.cos(angle); | |
let sin = Math.sin(angle); | |
str += `<line x1="${Math.round(cx + cos * r)}" y1="${Math.round(cy + sin * r)}" x2="${Math.round(cx + cos * r2)}" y2="${Math.round(cy + sin * r2)}" class="line-outer ${className}"/>\n`; | |
} | |
console.log(str); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment