diff options
Diffstat (limited to 'html')
-rw-r--r-- | html/index.html | 156 |
1 files changed, 156 insertions, 0 deletions
diff --git a/html/index.html b/html/index.html new file mode 100644 index 0000000..2bc69e9 --- /dev/null +++ b/html/index.html @@ -0,0 +1,156 @@ +<html> +<head > + <title> + worst website ever (real) + </title> + <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> + <script src="/src/jsencrypt.min.js"></script> + <script src="/src/crypto.js"></script> + + <style> + abbr { + font-style: italic; + position: relative +} + +abbr:hover::after { + background: #add8e6; + border-radius: 4px; + bottom: 100%; + content: attr(title); + display: block; + left: 100%; + padding: 1em; + position: absolute; + width: 280px; + z-index: 1; +} + </style> +</head> +<body onload="load()" style="height: 100%; overflow: hidden;"> +<div id="kanna" onclick="lightsout()"autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"></div> + <script> + const sid=makeid(20) + window.sid=sid + function makeid(length) { + var result = ''; + var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + var charactersLength = characters.length; + for ( var i = 0; i < length; i++ ) { + result += characters.charAt(Math.floor(Math.random() * + charactersLength)); + } + return result; +} + + + function lightsout(){ + document.body.innerHTML="" + document.body.style.backgroundColor="black" + document.title = "DONT TOUCH KANNA" + setTimeout(()=>{ + document.body.innerHTML='<img style="display:block;"src="src/lights-out.gif" id="gif" width=100% height=100%/>' + setTimeout(()=>{ + document.body.innerHTML='' + + },500) + + },700) + } + function readTextFile(file) +{ + var promise = new Promise((resolve, reject) => { + var rawFile = new XMLHttpRequest(); + rawFile.open("GET", file, false); + rawFile.onreadystatechange = function () + { + if(rawFile.readyState === 4) + { + if(rawFile.status === 200 || rawFile.status == 0) + { + var allText = rawFile.responseText; + resolve(allText) + + } + } + } + rawFile.send(null); +}); +return(promise) +} +let pub = '' +function submit(){ + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function() { + if (xhr.readyState == XMLHttpRequest.DONE) { + alert(xhr.responseText); + } +} + xhr.open("POST", window.location.href + 'login/submit', true); + xhr.setRequestHeader('Content-Type', 'application/json'); + + let user = document.getElementById("user").value + let pass = document.getElementById("pass").value + + var singed = (JSON.stringify({'date':Date().toString(),'user':user,'pass':pass,sid:sid})) + //console.log(singed,keys.publicKey) + + //console.log(JSON.stringify({'data':singed})) + console.log("preview of request: "+JSON.stringify({enc:true,json:true,data:singed,sid:sid})) + xhr.send(JSON.stringify({enc:true,json:true,data:singed,sid:sid})) + } + function sendRequest(location,encrypt,key,request){ + var xhr = new XMLHttpRequest(); + var promise = new Promise((resolve, reject) => { + xhr.onreadystatechange = function() { + if (xhr.readyState == XMLHttpRequest.DONE) { + + resolve(xhr.responseText); + } +} + }) + xhr.open("POST", window.location.href + location, true); + xhr.setRequestHeader('Content-Type', 'application/json'); + + if(encrypt){ + let sign = new JSEncrypt() + sign.setPublicKey(key) + var singed = sign.encrypt(JSON.stringify({'date':Date().toString()},request)) + console.log("preview of request: "+JSON.stringify({enc:true,json:true,data:singed})) + xhr.send(JSON.stringify({enc:true,json:true,data:singed})) + } else { + var notsinged= JSON.stringify({'date':Date().toString()},request) + console.log("preview of request: "+JSON.stringify({enc:false,json:true,data:notsinged})) + xhr.send(JSON.stringify({enc:false,json:true,data:notsinged,sid:sid})) + } + return(promise) + } + + async function load(){ + console.log(CryptoJS.SHA512("Message")); + pub=await sendRequest('pub.key',false,'',{sid:sid}) + //console.log(SubtleCrypto.encrypt('RSA-OAEP',SubtleCrypto.importKey('raw',pub,'RSA-OAEP',true))) + readTextFile("kanna.txt").then((kanna)=>{ + let left = -300; + let top = -40; + let t = setInterval(()=>{ + document.getElementById("kanna").innerHTML+="<div style='user-select: none;white-space: nowrap; position:absolute;left:"+left+"px;top:"+top+"%;transform:scale(.5)'><tt><b>"+(kanna.replaceAll("#","</br>").replaceAll(" ","<font style='color:rgba(1,1,1,0)'>_</font>"))+"</b></div></tt></a>" + left+=300 + if (left>=600){ + clearInterval(t) + setTimeout(()=>{ + document.body.innerHTML+="<tt><div style='position:absolute;bottom:20px;left:50px;font-weight:100;'>login w/ {user:<input placeholder='root' type='text' id='user' name='user'>,pass:<input type='text' id='pass' name='pass'>}</br><sub>will be <abbr title='so that the \"network administrators\"/\"IT people\" cant get in >:) '>encrypted</abbr> dont worry:)<input style='background-color:rgba(80,80,80,.3);border-color:rgba(80,80,80,.1);border:line;border-radius:5px;' type='button' value='submit' onclick='submit()'></sub></div></tt>" + document.body.innerHTML+="<div style='position:absolute;bottom:20px;right:50px;user-select: none;cursor:pointer;' onclick=\"location.href='mailto:[email protected]';\"><tt>need a account? contact [email protected]</tt></div>" + },50) + + + + } + },80) + + }) + } + </script> +</body> +</tt> +</html>
\ No newline at end of file |