<script async='async' src='https://rawcdn.githack.com/ptcreborn/ptcreborn/ff4cf4680d84969ad7bdbeb4119eccd6cb5a4f56/editprofile.js'></script> <style> .hot-items-buttons { display: none; } #form input, #form textarea { 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: 3px solid white; } #form button { all: unset; background: rgb(254, 194, 2); color: white; font-weight: 900; text-shadow: -1px 1px 0 #000, 1px 1px 0 #000, 1px -1px 0 #000, -1px -1px 0 #000; border: 1px solid black; border-radius: 15px; padding: .3rem 1.3rem; font-size: 14px; } div.pInf, div.brdCmb, h1.pTtl { display: none; } </style> <form style='margin-left: 17%; margin-top: 20px; pointer-events: none; opacity: 0.7' id='form' action='javascript:processForm()'> <h2>Edit Profile</h2><br> <small for="email"><b>Edit your Nickname</b></small><br> <input required minlength="3" type="text" pattern="[^' ']+" id="nickname" placeholder="nickname" /><br> <small for="email"><b>Change Password</b></small><br> <input required minlength="3" type="text" id="password" placeholder="Change Password" /><br> <small for="email"><b>About Me</b></small><br> <textarea required id="about_me" minlength="10" maxlength="350" rows="7" cols="50" placeholder="About Me" ></textarea><br> <h2>Edit Images</h2> <br> <label><b>Change Background Image </b></label><br /> <small>You will see this image as a background in the website. Change it according to your likeness.</small> <br><br> <img id="backImg" src="https://i.gifer.com/ZKZg.gif" style="width: 80%; max-height: 300px; object-fit: cover;" /><br> <span style='color: yellow;' id='backImgStatus'></span> <input id="file1" type="file" accept="image/png, image/gif, image/jpeg, image/bmp" /> <br><br> <label><b>Change Profile Picture</b></label><br> <small>this is the very image the audience will remember you. Please upload a decent one.</small> <br><br> <img id="profImg" src="https://i.gifer.com/ZKZg.gif" style="width: 200px; height: 200px; object-fit: fit;" /><br> <span style='color: yellow;' id='profImgStatus'></span> <input id="file" type="file" accept="image/png, image/gif, image/jpeg, image/bmp" /> <br> <h4 id='logs'></h4><br> <button id='btn_submit' class="button ln" type="submit" value="Submit"> Save Settings </button> <button type='reset' onclick='javascript:cancelSettings();'> Cancel </button> </form> <script> var temp_data; var temp_id; let isBIMG = false; let isPROF = false; window.addEventListener('load', function () { disableElem(query_id('#form'), false); if (!PTC_Cookies.checkIfCookiesSupported()) window.alert('Please turn on the cookies in your browser!'); else { let user_data = PTC_Cookies.getLocalStorage('ptc_user'); if (user_data == null) { // means not logged in } else { retrievedData(user_data.user); } } }, false); function query_id(str) { return document.querySelector(str); } function disableElem(elem, isOn) { if (isOn) { elem.style.pointerEvents = 'none'; elem.style.opacity = '0.7'; } else { elem.style.pointerEvents = 'auto'; elem.style.opacity = '1'; } } function retrievedData(id) { temp_id = id; EditProfile.getBlobRecord('https://jsonblob.com/api/jsonBlob/' + id, displayData); } function displayData(data) { data = JSON.parse(data); query_id('#nickname').value = data.nickname; query_id('#password').value = data.password; query_id('#about_me').value = data.about_me; query_id('#profImg').src = data.prof_image + "?" + new Date().getTime(); query_id('#backImg').src = data.background_image + "?" + new Date().getTime(); temp_data = data; } function getData() { temp_data.nickname = query_id('#nickname').value; temp_data.password = query_id('#password').value; temp_data.about_me = query_id('#about_me').value; temp_data.prof_image = query_id('#profImg').src; temp_data.background_image = query_id('#backImg').src; EditProfile.getAllFields(temp_data); } function cancelSettings() { let user_data = JSON.parse(localStorage.getItem('ptc_user')); window.location.href = 'https://storehaccounts.blogspot.com/p/your-account-page.html?' + user_data.user; } function processForm() { getData(); EditProfile.edit(temp_data, temp_id, savedFunction); } function savedFunction(data) { let temp_back_img = { "img": query_id('#backImg').src }; let user_data = JSON.parse(localStorage.getItem('ptc_user')); PTC_Cookies.storeLocalStorage('ptc_background_image', JSON.stringify(temp_back_img)); PTC_Cookies.deleteCookies('ptc_user_data'); window.location.href = 'https://storehaccounts.blogspot.com/p/your-account-page.html?' + user_data.user; } file.addEventListener("change", ev => { document.querySelector('#btn_submit').style.pointerEvents = 'none'; //query_id('#profImg').src = 'https://i.giphy.com/uIJBFZoOaifHf52MER.webp'; disableElem(query_id('#btn_submit'), true); query_id('#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 => { query_id('#profImgStatus').innerText = 'Done! Uploaded!'; let url = data.data.thumb.url; query_id('#profImg').src = url; disableElem(query_id('#btn_submit'), false); document.querySelector('#btn_submit').style.pointerEvents = 'auto'; }).catch((data) => { window.alert("Error in uploading! Try again."); }); }); file1.addEventListener("change", ev => { document.querySelector('#btn_submit').style.pointerEvents = 'none'; disableElem(query_id('#btn_submit'), true); query_id('#backImgStatus').innerText = 'Uploading...'; //query_id('#backImg').src = 'https://i.giphy.com/uIJBFZoOaifHf52MER.webp'; 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 => { query_id('#backImgStatus').innerText = 'Done! Uploaded!'; disableElem(query_id('#btn_submit'), false); let url = data.data.medium.url; query_id('#backImg').src = url; document.querySelector('#btn_submit').style.pointerEvents = 'auto'; }).catch((data) => { window.alert("Error in uploading! Try again."); }); }); </script>