[–] danielrw7 10y ago ↗ This bit is great: box = box.replace(/#/g, function() { i++ if (str[i]) { return str[i] } else { return ""; } }); It would be cool if you could select which characters (or all characters except for space) will be replaced with the data URI. [–] [deleted] 10y ago ↗ (comment deleted) [–] yorwba 10y ago ↗ Just replace that /#/g with /[^\s]/g to replace all non-whitespace characters. [–] skeoh 10y ago ↗ Does [^\s] match anything \S doesn't? [–] aehtyb 10y ago ↗ be forewarned that the reason it's asking you to use only #'s and spaces is the effect only works if the ascii image is very contrast-y. if the ascii art makes use of gradients (....:::;;;iiii@@@@) the effect won't be as obvious or work at all.
[–] yorwba 10y ago ↗ Just replace that /#/g with /[^\s]/g to replace all non-whitespace characters. [–] skeoh 10y ago ↗ Does [^\s] match anything \S doesn't? [–] aehtyb 10y ago ↗ be forewarned that the reason it's asking you to use only #'s and spaces is the effect only works if the ascii image is very contrast-y. if the ascii art makes use of gradients (....:::;;;iiii@@@@) the effect won't be as obvious or work at all.
[–] aehtyb 10y ago ↗ be forewarned that the reason it's asking you to use only #'s and spaces is the effect only works if the ascii image is very contrast-y. if the ascii art makes use of gradients (....:::;;;iiii@@@@) the effect won't be as obvious or work at all.
5 comments
[ 4.9 ms ] story [ 26.9 ms ] thread