diff options
author | Dante Catalfamo | 2020-07-03 15:32:37 -0400 |
---|---|---|
committer | Dante Catalfamo | 2020-07-03 15:32:37 -0400 |
commit | 3feb091fc16b8f823b3c64964afe8c0c790b4ae1 (patch) | |
tree | 8c6bfdfc545383965865bd91bb1bbf245fddedf1 /lambda.js | |
parent | 71dad28c5f0072828358594272566f797380510e (diff) | |
download | homepage-3feb091fc16b8f823b3c64964afe8c0c790b4ae1.tar.gz homepage-3feb091fc16b8f823b3c64964afe8c0c790b4ae1.tar.bz2 homepage-3feb091fc16b8f823b3c64964afe8c0c790b4ae1.zip |
Add deploy script
Diffstat (limited to 'lambda.js')
-rw-r--r-- | lambda.js | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/lambda.js b/lambda.js deleted file mode 100644 index 85037c3..0000000 --- a/lambda.js +++ /dev/null @@ -1,70 +0,0 @@ -function coss(height, width, theta) { - let amplitude = height/2; - let period = width; - let dx = Math.PI/width; - let yVal = []; - let x = theta; - - for(let i=0;i<width;i++){ - yVal.push((Math.cos(x)*amplitude)+(height/2)); - x += dx; - } - return yVal; -} - -function lamby(height, width, thick) { - let out = ""; - let yvals = coss(height, width, Math.PI); - let halfWidth = width/2; - - for(let y=0;y<height;y++){ - for(let x=0;x<width;x++){ - let posy = yvals[x]; - let negy = height-posy; - if (Math.abs(posy-y) < thick) { - out += "<span style=\"color: hsl("+ (Math.abs(posy-y)/thick*260) +",100%, 50%)\">λ</span>"; - } else if ((x < halfWidth) && (Math.abs(negy-y) < thick)) { - out += "<span style=\"color: hsl("+ (Math.abs(negy-y)/thick*260) +",100%, 50%)\">λ</span>"; - } else { - out += " "; - } - } - out += "\n"; - } - return out; -} - -function putlam(el, height, width, min, max, period) { - let amp = max-min; - const f = function() { - let percent = (Math.sin(((new Date).getTime()/period)) + 1) / 2; - let thick = (amp * percent) + min; - el.innerHTML = lamby(height, width, thick); - }; - window.setInterval(f, 100); -} - -let lamEl = document.querySelector('.lambda'); -putlam(lamEl, 45, 45, 0.3, 4.5, 450); - - -` -00 - 0 - 0 - 0 0 - 0 0 -0 00 - -0 - 0 -0 0 - -_ - \ - \ - /\ - / \ - / \ -/ \_ -`; |