Quantcast
Channel: Outline effect to text - Stack Overflow
Viewing all articles
Browse latest Browse all 18

Answer by punosound for Outline effect to text

$
0
0

Multiple text-shadows..
Something like this:

var steps = 10,    i,    R = 0.6,    x,    y,    theStyle = '1vw 1vw 3vw #005dab';for (i = -steps; i <= steps; i += 1) {    x = (i / steps) / 2;    y = Math.sqrt(Math.pow(R, 2) - Math.pow(x, 2));    theStyle = theStyle +','+ x.toString() +'vw '+ y.toString() +'vw 0 #005dab';    theStyle = theStyle +','+ x.toString() +'vw -'+ y.toString() +'vw 0 #005dab';    theStyle = theStyle +','+ y.toString() +'vw '+ x.toString() +'vw 0 #005dab';    theStyle = theStyle +',-'+ y.toString() +'vw '+ x.toString() +'vw 0 #005dab';}document.getElementsByTagName("H1")[0].setAttribute("style", "text-shadow:"+ theStyle);

Demo: http://jsfiddle.net/punosound/gv6zs58m/


Viewing all articles
Browse latest Browse all 18

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>