Skip to content

Instantly share code, notes, and snippets.

@kdzwinel
Created September 24, 2015 10:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdzwinel/9a39e79d0c9231766cb1 to your computer and use it in GitHub Desktop.
Save kdzwinel/9a39e79d0c9231766cb1 to your computer and use it in GitHub Desktop.
stroke effect generator
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