/*Copyright 2015, Pall Thayer (http://pallthayer.dyndns.org)*/ /*These program are free software: you can redistribute them and/or modify them under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will rock your world, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see .*/ /*Portrait of the Artist - 2018-03-30 08:51:26*/ var portrait = function(who) { this.who = who; var count = 0; var skinSurface; var skin = document.createElement("canvas"); var makeSkin = function() { skin.id = "skin"; skin.width = window.innerWidth; skin.height = window.innerHeight; skin.style.position = "absolute"; skin.style.top = "0px"; skin.style.left = "0px"; document.body.appendChild(skin); skinSurface = skin.getContext("2d"); }; var startPortrait = function() { makeSkin(); var bodyParts = setInterval(makeParts, 5); }; var makeParts = function() { count++; if(count < 2000) { var line = "rgba(0,0,0,0.4)"; }else{ line = "rgba(0,255,5,0.4)"; } count = count == 4000?0:count; var size = parseInt((Math.random()*10)+10); skinSurface.strokeStyle = line; skinSurface.font = size+"px sans-serif"; //skinSurface.strokeText(who, Math.random()*(window.innerWidth+1000)-500, Math.random()*(innerHeight+500)-250); skinSurface.strokeText(who, Math.random()*(window.innerWidth+1000)-500, 0.5*Math.sin(count*.01)*(innerHeight)+innerHeight/2); }; startPortrait(); };