diff --git a/_posts/2024-03-15-konamirickroll-add-a-rickroll-to-site.md b/_posts/2024-03-15-konamirickroll-add-a-rickroll-to-site.md new file mode 100644 index 0000000..359e74a --- /dev/null +++ b/_posts/2024-03-15-konamirickroll-add-a-rickroll-to-site.md @@ -0,0 +1,18 @@ +--- +title: "KonamiRickroll: Add a rickroll to your site via Konami code" +--- +Ever wanted to have a little easter egg in your website? I sure did! With my new JavaScript script, you can now add an easteregg rickroll to your website +by typing this combo: **UP, UP, DOWN, DOWN, LEFT, RIGHT, LEFT, RIGHT, B, A**. This is the Konami combo, and it is well-known, so you can be sure that someone +will find it someday! Add it to your site by just copy and pasting this HTML code to your <head> section: +```html + +``` +This is very plug-and-play, and it should work with any website without any additional config. + +## How it works +KonamiRickroll works by listening for the above pattern, and then replaces the webpage <body> section with a rickroll. This is easily stopped by reloading the webpage. + +**Try it on this site!** + +Cheers, +Damien Boisvert (AlphaGameDeveloper) diff --git a/assets/js/secret-jam-session.js b/assets/js/secret-jam-session.js index 45f23ff..e7bbe95 100644 --- a/assets/js/secret-jam-session.js +++ b/assets/js/secret-jam-session.js @@ -1 +1 @@ -var p=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a"],c=0,k=function(e){if(0>p.indexOf(e.key)||e.key!==p[c]){c=0;return}if(c++,p.length===c){c=0;let v=document.createElement("video");v.setAttribute("autoplay",!0);let s=document.createElement("source");s.setAttribute("src","https://repo.library.stonybrook.edu/xmlui/bitstream/handle/11401/9656/rickroll.mp4?sequence=1&isAllowed=y"),s.setAttribute("type","video/mp4"),v.appendChild(s),document.body.appendChild(v),v.style.position="fixed",v.style.top="50%",v.style.left="50%",v.style.transform="translate(-50%, -50%)",v.style.width="100%"}};document.addEventListener("keydown",k,!1); +var p=["ArrowUp","ArrowUp","ArrowDown","ArrowDown","ArrowLeft","ArrowRight","ArrowLeft","ArrowRight","b","a"],c=0,k=function(e){if(0>p.indexOf(e.key)||e.key!==p[c]){c=0;return}if(c++,p.length===c){c=0;let v=document.createElement("video");v.setAttribute("autoplay",!0);let s=document.createElement("source");s.setAttribute("src","https://archive.org/download/Rick_Astley_Never_Gonna_Give_You_Up/Rick_Astley_Never_Gonna_Give_You_Up.mp4"),s.setAttribute("type","video/mp4"),v.appendChild(s),document.body.appendChild(v),v.style.position="fixed",v.style.top="50%",v.style.left="50%",v.style.transform="translate(-50%, -50%)",v.style.width="100%"}};document.addEventListener("keydown",k,!1);