<style> .loader { width: 150px; } .loader-wheel { animation: spin 1s infinite linear; border: 2px solid rgba(30, 30, 30, 0.5); border-left: 4px solid #fff; border-radius: 50%; height: 150px; margin-bottom: 10px; width: 150px; } .loader-text { color: #fff; font-family: arial, sans-serif; } .loader-text:after { content: 'Loading Community'; animation: load 2s linear infinite; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } @keyframes load { 0% { content: 'Loading Community'; } 33% { content: 'Loading Community.'; } 67% { content: 'Loading Community..'; } 100% { content: 'Loading Community...'; } } div.pInf, div.brdCmb, h1.pTtl { display: none; } div#headerItems a:focus { border: 3px solid red; } div#headerItems a:focus { border: 3px solid white; } </style> <script async='async' src='https://rawcdn.githack.com/ptcreborn/ptcreborn/7d409da34313b073de929af86e134e6ed81302ed/stackfunctions.js'></script> <script async='async' src='https://rawcdn.githack.com/ptcreborn/ptcreborn/1c6109f12904c7304fce18c1b0b34ac134225ddb/jsonblobfunctions.js'></script> <script async='async' src='https://rawcdn.githack.com/ptcreborn/ptcreborn/c394983382b8783c0bec85c47c6943e194cbcedf/pantryfunctions.js'></script> <script async='async' src='https://rawgit.com/moment/moment/2.2.1/min/moment.min.js'></script> <div id='loading' style='align-items: center; display: flex; height: 100%; justify-content: center; margin: 0;'> <div class="loader"> <div class="loader-wheel"></div> <div class="loader-text"></div> </div> </div> <div style='display:none;' id='headerItems'> <a href='https://storehaccounts.blogspot.com/p/ptc-official-post-creator.html' style='border: solid 3px red; margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Create Post</a> <a href='https://storehaccounts.blogspot.com/p/battle-cats-gamer-community.html' style='margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Community</a> <a href='https://storehaccounts.blogspot.com/p/ptc-members.html' onclick='sortDate(false)' style='margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Members</a> <br> <a href='javascript:;' onclick='sortPopular(true)' style='margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Most Popular</a> <a href='javascript:;' onclick='sortPopular(false)' style='margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Noobest</a> <a href='javascript:;' onclick='sortDate(true)' style='margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Recent Posts</a> <a href='javascript:;' onclick='sortDate(false)' style='margin-bottom: 5px; background: #332E28; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>Oldest Posts</a> <br> <span id='queryLogs'></span> </div> <div style='display: none;' id='parent'> </div> <script> window.addEventListener('load', function () { StackFunctions.execute(); browser_url = window.location.href.replaceAll('?m=1', '').replaceAll('&m=1', ''); if (browser_url.includes('?')) { filter = browser_url.split('?')[1].replaceAll('%20', ' '); StackFunctions.pushTask(getThread(categorialPosts)); } else { StackFunctions.pushTask(getThread(recentPosts)); } }, false); let pantry_url = 'https://getpantry.cloud/apiv1/pantry/8c1037f6-bf4b-443d-9941-a9f9c6a99671/basket/posts'; var filter = ''; let browser_url = ''; function getThread(callback) { Pantry.getPantryData(pantry_url, function (data) { let newData = JSON.parse(data); document.querySelector('#parent').innerHTML = ''; for (i = newData.d.length - 1; i > -1; i--) { let blobid = newData.d[i].p; JBLOBFunctions.getBlobRecord('https://jsonblob.com/api/jsonBlob/' + newData.d[i].p, function (dataC) { callback(dataC, blobid); }); } document.querySelector('#loading').remove(); document.querySelector('#headerItems').style.display = 'block'; }); } function categorialPosts(dataC, id) { dataC = JSON.parse(dataC); if (dataC != '404' && (dataC.category == filter || dataC.mod == filter)) { document.querySelector('#parent').style.display = 'block'; disableElem(true, document.querySelector('#queryLogs'), 'Showing posts with filter: ' + filter); let userId = dataC.user; let username = ''; let userimg = ''; let mod = dataC.mod; let postdate = moment(parseInt(dataC.date)).fromNow(); let category = dataC.category; let title = dataC.title; let reactions = dataC.reactions; let description = dataC.description; let imgs = document.createElement('div'); JBLOBFunctions.getBlobRecord('https://jsonblob.com/api/jsonBlob/' + userId, function (dataB) { dataB = JSON.parse(dataB); username = dataB.nickname; userimg = dataB.prof_image; for (j = 0; j < dataC.images.length; j++) { imgs.innerHTML += "<img src='" + dataC.images[j] + "' style='margin: 5px 5px 5px 0; display: inline-block; vertical-align: middle; width: 150px;'/>"; } if (dataC.images.length > 0) imgs.innerHTML += '<br>'; document.querySelector('#parent').innerHTML += "<div id='" + id + "' style='margin-bottom: 5px; background-image: linear-gradient(to bottom, #3D3832 , #29241E); padding: 10px; overflow: hidden; font-size: 14px;'><img src='" + userimg + "' style='display: inline-block; vertical-align: middle; object-fit: cover; height: 48px !important; width: 48px !important;'/> <a style='margin-left: 5px; background: red; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>" + username + "</a><a href='https://storehaccounts.blogspot.com/p/battle-cats-gamer-community.html?" + category + "' style='margin-left: 5px; background: blue; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>" + category + "</a><a href='https://storehaccounts.blogspot.com/p/battle-cats-gamer-community.html?" + mod + "' style='margin-left: 5px; background: green; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>" + mod + "</a><span style='color: gray;'> shared 📆 </span><span style='color: gray;'>" + postdate + "</span> <span class='voteCount' style='color: rgba(255,255,255,0.6);'>" + reactions + " voted</span> <span style='color: rgba(255,255,255,0.6);'>" + reactions + " commented</span> <span class='datePost' style='display: none; color: rgba(255,255,255,0.6);'>" + dataC.date + "</span><br><h4 style='margin: 0 auto;'>" + title + "</h4><p style='margin: 0 auto; font-size: 14px; line-height: 1.2rem'>" + description + "</p>" + imgs.innerHTML + "<a style='margin: 10px 10px 0px 0px; background: red; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;' onclick='upvote(this, \"" + id + "\")'>Upvote</a><a style='margin: 10px 10px 0px 0px; background: red; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;' href='https://storehaccounts.blogspot.com/p/ptc-post-official.html?" + id + "'>Read Post</a></div>"; }); } } function recentPosts(dataC, id) { if (dataC != '404') { dataC = JSON.parse(dataC); document.querySelector('#parent').style.display = 'block'; let userId = dataC.user; let username = ''; let userimg = ''; let mod = dataC.mod; let postdate = moment(parseInt(dataC.date)).fromNow(); let category = dataC.category; let title = dataC.title; let reactions = dataC.reactions; let description = dataC.description; let imgs = document.createElement('div'); JBLOBFunctions.getBlobRecord('https://jsonblob.com/api/jsonBlob/' + userId, function (dataB) { dataB = JSON.parse(dataB); username = dataB.nickname; userimg = dataB.prof_image; for (j = 0; j < dataC.images.length; j++) { imgs.innerHTML += "<img src='" + dataC.images[j] + "' style='margin: 5px 5px 5px 0; display: inline-block; vertical-align: middle; width: 150px;'/>"; } if (dataC.images.length > 0) imgs.innerHTML += '<br>'; document.querySelector('#parent').innerHTML += "<div id='" + id + "' style='margin-bottom: 5px; background-image: linear-gradient(to bottom, #3D3832 , #29241E); padding: 10px; overflow: hidden; font-size: 14px;'><img src='" + userimg + "' style='display: inline-block; vertical-align: middle; object-fit: cover; height: 48px !important; width: 48px !important;'/> <a style='margin-left: 5px; background: red; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>" + username + "</a><a href='https://storehaccounts.blogspot.com/p/battle-cats-gamer-community.html?" + category + "' style='margin-left: 5px; background: blue; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>" + category + "</a><a href='https://storehaccounts.blogspot.com/p/battle-cats-gamer-community.html?" + mod + "' style='margin-left: 5px; background: green; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;'>" + mod + "</a><span style='color: gray;'> shared 📆 </span><span style='color: gray;'>" + postdate + "</span> <span class='voteCount' style='color: rgba(255,255,255,0.6);'>" + reactions + " voted</span> <span style='color: rgba(255,255,255,0.6);'>" + reactions + " commented</span> <span class='datePost' style='display: none; color: rgba(255,255,255,0.6);'>" + dataC.date + "</span><br><h4 style='margin: 0 auto;'>" + title + "</h4><p style='margin: 0 auto; font-size: 14px; line-height: 1.2rem'>" + description + "</p>" + imgs.innerHTML + "<a style='margin: 10px 10px 0px 0px; background: red; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;' onclick='upvote(this, \"" + id + "\")'>Upvote</a><a style='margin: 10px 10px 0px 0px; background: red; color: white; padding: 0px 7px; text-decoration: none; font-weight: bold;display: inline-block;' href='https://storehaccounts.blogspot.com/p/ptc-post-official.html?" + id + "'>Read Post</a></div>"; }); } } function sortDate(isRecent) { let posts = document.querySelectorAll('#parent div'); let temp_data = []; for (i = 0; i < posts.length; i++) temp_data.push({ "id": parseInt(posts[i].querySelector('span.datePost').innerText), "item": posts[i].outerHTML }); if(isRecent) temp_data.sort(function(a, b){ return b.id - a.id; }); else if(!isRecent) temp_data.sort(function(a, b){ return a.id - b.id; }); document.querySelector('#parent').innerHTML = ''; for(i=0; i<temp_data.length; i++) document.querySelector('#parent').innerHTML += temp_data[i].item; } function sortPopular(isPopular) { let posts = document.querySelectorAll('#parent div'); let temp_data = []; for (i = 0; i < posts.length; i++) temp_data.push({ "id": parseInt(posts[i].querySelector('span.voteCount').innerText.replace(' voted', '')), "item": posts[i].outerHTML }); if(isPopular) temp_data.sort(function(a, b){ return b.id - a.id; }); else if(!isPopular) temp_data.sort(function(a, b){ return a.id - b.id; }); document.querySelector('#parent').innerHTML = ''; for(i=0; i<temp_data.length; i++) document.querySelector('#parent').innerHTML += temp_data[i].item; } function disableElem(isTrue, elem, str) { if (isTrue) { elem.style.pointerEvents = 'none'; elem.style.opacity = '0.7'; elem.innerText = str; } else { elem.style.pointerEvents = 'auto'; elem.style.opacity = '1'; elem.innerText = str; } } function upvote(elem, id) { let num_votes = 0; disableElem(true, elem, "Upvoting..."); JBLOBFunctions.PUTRecordBlob('https://jsonblob.com/api/jsonBlob/' + id, function (data) { data.reactions = data.reactions + 1; num_votes = data.reactions; return data; }, function (data) { document.getElementById(id).querySelector('span.voteCount').innerText = num_votes + ' voted'; disableElem(true, elem, num_votes + " voted!"); }); } </script>