diff options
author | Dante Catalfamo | 2020-07-03 14:31:34 -0400 |
---|---|---|
committer | Dante Catalfamo | 2020-07-03 14:31:34 -0400 |
commit | b7373ab119bf73ead274d34b2696ddedb1deb416 (patch) | |
tree | 262021e7cb620e8524801239c0b12bcd795c3983 | |
download | homepage-b7373ab119bf73ead274d34b2696ddedb1deb416.tar.gz homepage-b7373ab119bf73ead274d34b2696ddedb1deb416.tar.bz2 homepage-b7373ab119bf73ead274d34b2696ddedb1deb416.zip |
Add current homepage
-rw-r--r-- | index.html | 53 | ||||
-rw-r--r-- | script.js | 70 |
2 files changed, 123 insertions, 0 deletions
diff --git a/index.html b/index.html new file mode 100644 index 0000000..5dce83d --- /dev/null +++ b/index.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<html lang="en"> + <head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <title>lambda.cx home</title> + <style> + body { + background: black; + font-family: monospace; + } + .bigguy { + display: flex; + } + .lambda { + font-family: Andale Mono, monospace; + font-size: 12px; + display: inline-block; + } + .linkbox { + display: flex; + align-items: center; + justify-content: center; + flex: 1; + } + .links { + font-size: 16px; + display: inline-block; + } + .links > span { + color: white; + } + @media only screen and (max-width: 440px) { + .bigguy { + display: block; + } + } + </style> + </head> + <body> + <div class="bigguy"> + <pre class="lambda"></pre> + <div class="linkbox"> + <div class="links"> + <span>==> </span><a href="https://blog.lambda.cx">blog</a><br/> + <span>==> </span><a href="https://github.com/dantecatalfamo">github</a> + </div> + </div> + </div> + <script src="script.js"></script> + </body> +</html> diff --git a/script.js b/script.js new file mode 100644 index 0000000..85037c3 --- /dev/null +++ b/script.js @@ -0,0 +1,70 @@ +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 + +_ + \ + \ + /\ + / \ + / \ +/ \_ +`; |