<style> .hot-items-buttons { display: none; } #thisForm input { all: unset; display: block; color: white; padding: 5px; margin: 5px; font-size: 14px; border-radius: 5px; width: 70%; border-bottom: 2px solid white; } #thisForm input:focus, #form button:focus { border-bottom: 2px solid yellow; } div.pInf, div.brdCmb, h1.pTtl { display: none; } .form-control { font-size: 14px !important; } </style> <link crossorigin="anonymous" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" rel="stylesheet" /> <style> #postBody button { font-size: 12px !important; } .list-group-item, .card { background: #222 !important; color: white !important; } </style> <script crossorigin="anonymous" defer="defer" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" ></script> <!--Button trigger modal--> <form id="thisForm" style="margin-left: 19%; width: 70%; margin-top: 20px;" action="javascript:processForm()" > <h2>Register</h2> <span>Please fill up all the fields with your identification.</span> <br /> <br /> <span class="badge text-bg-warning" ><small>Country: </small><small id="country-selected"></small ></span> <br /><br /> <small class="badge text-bg-secondary" for="email">Create your nickname</small ><br /> <input required minlength="3" type="text" pattern="[^' ']+" id="nickname" placeholder="nickname" autocomplete="off" /><br /> <small class="badge text-bg-secondary" for="email">Email address</small><br /> <input required type="email" id="email" placeholder="Email Address" autocomplete="off" /><br /> <small class="badge text-bg-secondary" for="email">Verify email address</small ><br /> <input required type="email" id="vemail" placeholder="Verify email" autocomplete="off" /><br /> <small class="badge text-bg-secondary" for="email">Password</small><br /> <input required minlength="3" type="password" id="password" placeholder="Create Password" autocomplete="off" /><br /> <small class="badge text-bg-secondary" for="email">Verify password</small ><br /> <input required minlength="3" type="password" id="vpassword" placeholder="Verify Password" autocomplete="off" /><br /> <label class="badge text-bg-secondary">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;" /> <div id="profile_div"> </div> <br /> <div class="input-group mb-3"> <input id="file" type="file" class="form-control" accept="image/png, image/gif, image/jpeg, image/bmp" required /> </div> <br /> <ul class="list-group"> <li class="list-group-item" style='width: 70%;'> <span class="badge text-bg-warning">Notice!</span> Once you create your account, make sure to <span class="badge text-bg-warning">remember your email and password</span>. There's no way you can get your account back by just remembering your email address and password. Otherwise you will lose your progress in this account. Thank you!</li> </ul> <br> <span style="color: yellow;" id="profImgStatus"></span> <h4 id="logs"></h4> <button id="btn_submit" class="btn btn-outline-light" type="submit" value="Submit" > Create Account </button> <button style="margin-left: 5px;" class="btn btn-outline-light" 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; let recordCreated = false; let blob_id; let firebase_users = 'aHR0cHM6Ly9zdG9yZWhhY2NvdW50cy13ZWJzaXRlLWRlZmF1bHQtcnRkYi5maXJlYmFzZWlvLmNvbS9wdGNfdXNlcnMuanNvbg=='; window.addEventListener('load', async function () { await initFunctions(['FLAG_API', 'FirebaseModule', 'JBLOBFunctions', 'ImgurXHR', 'PTC_Cookies']); query('country-selected').innerHTML = await FLAG_API.getCodefromIP(); await ImgurXHR.uploadImgUr('file', document.getElementById('profile_div'), uploading, doneUploading); 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.alert('You are already logged in.'); 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.getElementById(id); } function enableForm(status) { if (status) { query('thisForm').style.pointerEvents = 'auto'; query('thisForm').style.opacity = '1'; } else { query('thisForm').style.pointerEvents = 'none'; query('thisForm').style.opacity = '0.7'; } } query('vpassword').onkeyup = (e) => { e.preventDefault(); if(query('password').value == query('vpassword').value) { query('password').style.borderBottom = '3px solid #90EE90'; query('vpassword').style.borderBottom = '3px solid #90EE90'; } else { query('password').style.borderBottom = '2px solid red'; query('vpassword').style.borderBottom = '2px solid red'; } } function processForm() { // check if email is the same // check if password is the same // check if the profile image is valid query('btn_submit').style.pointerEvents = 'none'; query('btn_submit').style.opacity = '0.7'; enableForm(false); nickname = query('nickname').value; email = query('email').value; vemail = query('vemail').value; password = query('password').value; vpassword = query('vpassword').value; profimg = query('profile_div').querySelector('img').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.", "country": query('country-selected').innerHTML }; if (!recordCreated) JBLOBFunctions.createRecordBlob(JSON.stringify(blobData), async function (data) { blob_id = data.split('jsonBlob/')[1]; recordCreated = true; checkEmailandCreate(); }); } else { window.alert('Your profile image is corrupted, please upload again!'); enableForm(true); } } else { window.alert('Password mismatched! Please retype the password!'); enableForm(true); } } else { window.alert('Email mismatched! Please retype the email address!'); enableForm(true); } } async function checkEmailandCreate() { // check if the email address is already exists. // Get the lists of emails from firebase let record_of_emails = await FirebaseModule.get(atob(firebase_users)); record_of_emails = JSON.parse(record_of_emails); record_of_emails = Object.entries(record_of_emails); let isUserExisting = false; for (let i = 0; i < record_of_emails.length; i++) { let id = record_of_emails[i][0]; let content = record_of_emails[i][1]; if(content.e == email) { isUserExisting = true; break; } } if (isUserExisting) { // means email already existing... query('email').value = ''; query('vemail').value = ''; query('logs').innerText = 'Sorry but your email address already exists! Try new email address'; query('thisForm').style.pointerEvents = 'auto'; query('thisForm').style.opacity = '1'; } else { // means email is fresh and new! let data = { [new Date().getTime()]: { "e": email, "i": blob_id } } data = JSON.stringify(data); await FirebaseModule.patch(atob(firebase_users), data); query('logs').innerText = 'Account created, proceeding to login in few seconds...'; window.location.href = 'https://storehaccounts.blogspot.com/p/login_20.html'; } } function uploading() { if(profImg) profImg.style.display = 'block'; query('profile_div').innerHTML = ''; document.querySelector('#btn_submit').style.pointerEvents = 'none'; profImg.src = 'https://i.giphy.com/uIJBFZoOaifHf52MER.webp'; query('profImgStatus').innerText = 'Uploading...'; } function doneUploading() { profImg.remove(); document.querySelector('#btn_submit').style.pointerEvents = 'auto'; query('profImgStatus').innerText = 'Done! Uploaded!'; successImgUp = true; } </script>