Skip to content

Commit

Permalink
add gtag
Browse files Browse the repository at this point in the history
  • Loading branch information
StrikerUnit committed Dec 10, 2024
1 parent 3d3ede8 commit 5e9f039
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resume/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctypehtml><html lang=en><meta charset=UTF-8><meta content="width=device-width,initial-scale=1"name=viewport><title>Loading Page</title><style>.loading-container{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:300px;text-align:center}.progress-bar{width:100%;height:20px;background-color:#f0f0f0;border-radius:10px;overflow:hidden}.progress{width:0%;height:100%;background-color:#6d9eeb;transition:none}.progress-text{margin-top:10px;font-family:Arial,sans-serif;font-size:16px}.progress-container{display:none}.password-container{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center}.password-input{padding:10px;margin-bottom:10px;border-radius:5px;border:1px solid #ccc;text-align:center;font-size:16px}.password-input::placeholder{text-align:center;font-size:16px}.submit-button{padding:10px 20px;background-color:#98cc81;color:#000;border:none;border-radius:5px;cursor:pointer}.progress.error{background-color:red}</style><div class=password-container id=password-container><input class=password-input id=password-input maxlength=8 oninput=checkPasswordLength(this.value) placeholder=PASSWORD type=password></div><div class="loading-container progress-container"id=loading-container><div class=progress-bar><div class=progress id=progress></div></div><div class=progress-text id=progress-text>0%</div></div><script>let encryptedText=null;async function fetchEncryptedText(){try{const e=await fetch("./encrypted"),t=await e.text();encryptedText=t.trim()}catch(e){console.error("Failed to load encrypted text:",e)}}function setPasswordFromURL(){const e=new URLSearchParams(window.location.search).get("k");if(e){document.getElementById("password-input").value=e,checkPasswordLength(e,!0)}}async function checkPasswordLength(e,t=!1){if(!encryptedText)return;const n=document.getElementById("password-container"),o=document.getElementById("loading-container");if(8===e.length||t){n.style.display="none",o.style.display="block";try{const t=await decryptAES(encryptedText,e);t?(startProgress(!0),setTimeout((()=>{document.title="RESUME",document.body.innerHTML=t}),1e3)):startProgress(!1)}catch(e){startProgress(!1)}}}async function decryptAES(e,t){try{const n=(new TextEncoder).encode(t),o=await window.crypto.subtle.digest("SHA-256",n),r=new Uint8Array(o).slice(0,16),s=await window.crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits","deriveKey"]),c=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["decrypt"]),a=atob(e),d=new Uint8Array(a.split("").map((e=>e.charCodeAt(0)))),i=d.slice(0,12),l=d.slice(12),y=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:i},c,l);return(new TextDecoder).decode(y)}catch(e){return null}}function startProgress(e){const t=document.getElementById("progress"),n=document.getElementById("progress-text");let o=0;const r=setInterval((()=>{o+=1,n.textContent=o+"%",t.style.width=o+"%",o>=100&&(clearInterval(r),e||showError())}),10)}function showError(){const e=document.getElementById("progress"),t=document.getElementById("progress-text");e.classList.add("error"),e.style.width="100%",t.textContent="ERROR (401)",setTimeout((()=>{const n=document.getElementById("password-container"),o=document.getElementById("loading-container"),r=document.getElementById("password-input");e.classList.remove("error"),e.style.width="0%",t.textContent="0%",o.style.display="none",n.style.display="block",r.value=""}),6e4)}window.onload=async function(){await fetchEncryptedText(),setPasswordFromURL()}</script>
<!doctypehtml><html lang=en><meta charset=UTF-8><meta content="width=device-width,initial-scale=1"name=viewport><title>Loading Page</title><style>.loading-container{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);width:300px;text-align:center}.progress-bar{width:100%;height:20px;background-color:#f0f0f0;border-radius:10px;overflow:hidden}.progress{width:0%;height:100%;background-color:#6d9eeb;transition:none}.progress-text{margin-top:10px;font-family:Arial,sans-serif;font-size:16px}.progress-container{display:none}.password-container{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center}.password-input{padding:10px;margin-bottom:10px;border-radius:5px;border:1px solid #ccc;text-align:center;font-size:16px}.password-input::placeholder{text-align:center;font-size:16px}.submit-button{padding:10px 20px;background-color:#98cc81;color:#000;border:none;border-radius:5px;cursor:pointer}.progress.error{background-color:red}</style><div class=password-container id=password-container><input class=password-input id=password-input maxlength=8 oninput=checkPasswordLength(this.value) placeholder=PASSWORD type=password></div><div class="loading-container progress-container"id=loading-container><div class=progress-bar><div class=progress id=progress></div></div><div class=progress-text id=progress-text>0%</div></div><script>let encryptedText=null;async function fetchEncryptedText(){try{const e=await fetch("./encrypted"),t=await e.text();encryptedText=t.trim()}catch(e){console.error("Failed to load encrypted text:",e)}}function setPasswordFromURL(){const e=new URLSearchParams(window.location.search).get("k");if(e){document.getElementById("password-input").value=e,checkPasswordLength(e,!0)}}async function checkPasswordLength(e,t=!1){if(!encryptedText)return;const n=document.getElementById("password-container"),o=document.getElementById("loading-container");if(8===e.length||t){n.style.display="none",o.style.display="block";try{const t=await decryptAES(encryptedText,e);t?(startProgress(!0),setTimeout((()=>{document.title="RESUME",document.body.innerHTML=t}),1e3)):startProgress(!1)}catch(e){startProgress(!1)}}}async function decryptAES(e,t){try{const n=(new TextEncoder).encode(t),o=await window.crypto.subtle.digest("SHA-256",n),r=new Uint8Array(o).slice(0,16),s=await window.crypto.subtle.importKey("raw",n,"PBKDF2",!1,["deriveBits","deriveKey"]),c=await window.crypto.subtle.deriveKey({name:"PBKDF2",salt:r,iterations:1e5,hash:"SHA-256"},s,{name:"AES-GCM",length:256},!1,["decrypt"]),a=atob(e),d=new Uint8Array(a.split("").map((e=>e.charCodeAt(0)))),i=d.slice(0,12),l=d.slice(12),y=await window.crypto.subtle.decrypt({name:"AES-GCM",iv:i},c,l);return(new TextDecoder).decode(y)}catch(e){return null}}function startProgress(e){const t=document.getElementById("progress"),n=document.getElementById("progress-text");let o=0;const r=setInterval((()=>{o+=1,n.textContent=o+"%",t.style.width=o+"%",o>=100&&(clearInterval(r),e||showError())}),10)}function showError(){const e=document.getElementById("progress"),t=document.getElementById("progress-text");e.classList.add("error"),e.style.width="100%",t.textContent="ERROR (401)",setTimeout((()=>{const n=document.getElementById("password-container"),o=document.getElementById("loading-container"),r=document.getElementById("password-input");e.classList.remove("error"),e.style.width="0%",t.textContent="0%",o.style.display="none",n.style.display="block",r.value=""}),6e4)}window.onload=async function(){await fetchEncryptedText(),setPasswordFromURL()}</script><script async src="https://www.googletagmanager.com/gtag/js?id=G-LPT98ZWS45"></script><script>function gtag(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],gtag("js",new Date),gtag("config","G-LPT98ZWS45")</script>

0 comments on commit 5e9f039

Please sign in to comment.