<script async='async' src='https://rawcdn.githack.com/ptcreborn/ptcreborn/faaab29d3fb9f1776aff3ec76d596a68fee28140/register.js'></script> <style> #form input { all: unset; background: black; color: white; padding: 5px; padding-left: 10px; margin: 5px; font-size: 16px; border-radius: 5px; width: 70%; } #form input:focus, #form button:focus { border: 1px solid white; } #form button { all: unset; background: #003584; color: white; padding: 0px 5px 0px 5px; border-radius: 8px; font-stretch: 100%; } div.pInf, div.brdCmb, h1.pTtl { display: none; } </style> <form style='margin-left: 17%; margin-top: 20px;' id='form' action='javascript:processForm()'> <h2>Register</h2> <small for="email">Create your nickname</small><br> <input required minlength="3" type="text" pattern="[^' ']+" id="nickname" placeholder="nickname" /><br> <small for="email">Email address</small><br> <input required type="email" id="email" placeholder="Email Address" /><br> <small for="email">Verify email address</small><br> <input required type="email" id="vemail" placeholder="Verify email" /><br> <small for="email">Password</small><br> <input required minlength="3" type="password" id="password" placeholder="Create Password" /><br> <small for="email">Verify password</small><br> <input required minlength="3" type="password" id="vpassword" placeholder="Verify Password" /><br> <label>Add your Profile Picture</label><br /> <img id="profimg" loading="lazy" src="https://upload.wikimedia.org/wikipedia/commons/thumb/1/11/Blue_question_mark_icon.svg/2048px-Blue_question_mark_icon.svg.png" style="width: 200px; height: 200px; object-fit: cover;" /><br> <input id="file" type="file" accept="image/png, image/gif, image/jpeg, image/bmp" required /><br> <span style='color: yellow;' id='profImgStatus'></span> <br> <h4 id='logs'></h4><br> <button id='btn_submit' class="button ln" type="submit" value="Submit"> Create Account </button> <button style='margin-left: 5px;' class="button ln" type='reset' onclick='window.location.href = "https://storehaccounts.blogspot.com/p/login_20.html"'>Login</button> </form> <script> let file = document.querySelector('#file'); let profImg = document.querySelector('#profimg'); let successImgUp = false; // variables let nickname; let email; let vemail; let password; let vpassword; let profimg; window.addEventListener('load', function () { if (!PTC_Cookies.checkIfCookiesSupported() || !PTC_Cookies.checkIfStorageSupported()) window.alert('Please turn on the cookies in your browser!'); else { let user_data = PTC_Cookies.getLocalStorage('ptc_user'); if (user_data == null) { console.log('not logged in.'); } else { window.location.href = 'https://storehaccounts.blogspot.com/p/your-account-page.html?' + user_data.user; console.log('already logged in.'); } } }, false); function query(id) { return document.querySelector('#' + id); } function enableForm(status) { if(status) query('form').style.pointerEvents = 'auto'; else query('form').style.pointerEvents = 'none'; } function processForm() { // check if email is the same // check if password is the same // check if the profile image is valid nickname = query('nickname').value; email = query('email').value; vemail = query('vemail').value; password = query('password').value; vpassword = query('vpassword').value; profimg = query('profimg').src; if (email == vemail) { if (password == vpassword) { if (successImgUp) { let blobData = { "nickname": nickname, "joined": new Date().getTime(), "password": vpassword, "prof_image": profimg, "background_image": 'https://www.tynker.com/projects/screenshot/6174aa283a55c173090e03c2/battle-cats.png', "about_me": "Im a newbie member." }; console.log('email: ' + email); console.log('blobdata: ' + JSON.stringify(blobData)); query('logs').innerText = 'Creating account...'; enableForm(false); Register.createAccount(email, JSON.stringify(blobData), document.querySelector('#logs'), 'https://storehaccounts.blogspot.com/p/login_20.html'); enableForm(true); } else { window.alert('Your profile image is corrupted, please upload again!'); } } else { window.alert('Password mismatched! Please retype the password!'); } } else { window.alert('Email mismatched! Please retype the email address!'); } } file.addEventListener("change", ev => { document.querySelector('#btn_submit').style.pointerEvents = 'none'; profImg.src = 'https://i.giphy.com/uIJBFZoOaifHf52MER.webp'; query('profImgStatus').innerText = 'Uploading...'; const formdata = new FormData() formdata.append("image", ev.target.files[0]) fetch("https://api.imgbb.com/1/upload?key=07f1351d4e674784012d92ae6e03b49d", { method: "post", body: formdata }).then(data => data.json()).then(data => { let url = data.data.thumb.url; query('profImgStatus').innerText = 'Done! Uploaded!'; profImg.src = url; profUrl = url; successImgUp = true; document.querySelector('#btn_submit').style.pointerEvents = 'auto'; }).catch((data) => { window.alert("Error in uploading! Try again."); successImgUp = false; }); }); </script>