Created
September 24, 2015 10:13
-
-
Save kdzwinel/9a39e79d0c9231766cb1 to your computer and use it in GitHub Desktop.
stroke effect generator
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 color = 'white'; | |
var r = 1.4;//circle readius | |
var x = -0.15;//circle center | |
var y = 0.15; | |
function getXY(angle) { | |
return { | |
x: r * Math.cos(angle) + x, | |
y: r * Math.sin(angle) + y | |
}; | |
} | |
var shadow = ''; | |
for(var a = 0; a<360; a+=60) { | |
var p = getXY(a); | |
shadow += `drop-shadow(${p.x}px ${p.y}px 0 ${color}) `; | |
} | |
// ready to use with `filter:` | |
return shadow; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment