From e1bb6b28ce1bfa496c91b42441fcfdfb07e08e64 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Sun, 19 Feb 2023 15:55:24 +1100 Subject: [PATCH] style: added text affects --- about.html | 1 + ascii.html | 1 + assets/js/hacker.js | 81 +++++++++++++++++++++++++++++++++++++++++++++ gitpgp.html | 1 + index.html | 13 ++++---- pgp.html | 1 + projects.html | 1 + 7 files changed, 93 insertions(+), 6 deletions(-) create mode 100644 assets/js/hacker.js diff --git a/about.html b/about.html index 7a61d15..326f9e3 100644 --- a/about.html +++ b/about.html @@ -47,6 +47,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= + \ No newline at end of file diff --git a/ascii.html b/ascii.html index 2baeb4a..0546dca 100644 --- a/ascii.html +++ b/ascii.html @@ -41,6 +41,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= + \ No newline at end of file diff --git a/assets/js/hacker.js b/assets/js/hacker.js new file mode 100644 index 0000000..a72c6c3 --- /dev/null +++ b/assets/js/hacker.js @@ -0,0 +1,81 @@ +const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ/.?!@#$%^&*()_+"; + +let interval = null; +let interval2 = null; +let interval3 = null; + +document.querySelector(".hacker").onmouseover = event => { + let iteration = 0; + let old = event.target.innerText; + console.log(old); + clearInterval(interval); + + interval = setInterval(() => { + event.target.innerText = event.target.innerText + .split("") + .map((letter, index) => { + if(index < iteration) { + return old[index]; + } + + return letters[Math.floor(Math.random() * 41)] + }) + .join(""); + + if(iteration >= old.length){ + clearInterval(interval); + } + + iteration += 1 / 3; + }, 10); +} +document.querySelector(".hacker2").onmouseover = event => { + let iteration2 = 0; + let old2 = event.target.innerText; + console.log(old2); + clearInterval(interval2); + + interval2 = setInterval(() => { + event.target.innerText = event.target.innerText + .split("") + .map((letter, index2) => { + if(index2 < iteration2) { + return old2[index2]; + } + + return letters[Math.floor(Math.random() * 41)] + }) + .join(""); + + if(iteration2 >= old2.length){ + clearInterval(interval2); + } + + iteration2 += 1/3; + }, 10); + } + document.querySelector(".hacker3").onmouseover = event => { + let iteration3 = 0; + let old3 = event.target.innerText; + console.log(old3); + clearInterval(interval3); + + interval3 = setInterval(() => { + event.target.innerText = event.target.innerText + .split("") + .map((letter, index3) => { + if(index3 < iteration3) { + return old3[index3]; + } + + return letters[Math.floor(Math.random() * 41)] + }) + .join(""); + + if(iteration3 >= old3.length){ + clearInterval(interval3); + } + + iteration3 += 1 / 3; + }, 10); + } \ No newline at end of file diff --git a/gitpgp.html b/gitpgp.html index aa34dde..c1c4149 100644 --- a/gitpgp.html +++ b/gitpgp.html @@ -38,6 +38,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=

This key's fingerprint is FBA777D17CAD88B5
All commits changing this page have been signed with my PGP key as shown on Keybase https://keybase.io/nathanwoodburn

+ \ No newline at end of file diff --git a/index.html b/index.html index 3c638f2..d539106 100644 --- a/index.html +++ b/index.html @@ -42,10 +42,9 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= - - +