diff --git a/.gitignore b/.gitignore index 748b458..7423593 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ # Project exclude paths -/node_modules/ \ No newline at end of file +/node_modules/ + +db.json \ No newline at end of file diff --git a/db.json b/db.json deleted file mode 100644 index 8cc14f7..0000000 --- a/db.json +++ /dev/null @@ -1 +0,0 @@ -{"counts":{"nftm.art":[1,0],"localhost":[4,2]},"latest":{}} \ No newline at end of file diff --git a/index.js b/index.js index b0ef2a0..585e09a 100644 --- a/index.js +++ b/index.js @@ -156,6 +156,8 @@ app.get('/votes/:site', (req, res) => { return res.json({percent: getPercent(site), success: true}); }); +app.use(express.static('public')); + app.options('*', cors()); function saveAndCleanup() { @@ -166,8 +168,8 @@ function saveAndCleanup() { setInterval(saveAndCleanup, 86400000) try { - app.listen(3000, () => { - console.log('App listening on port 3000!'); + app.listen(6721, () => { + console.log('App listening on port 6721!'); }); } catch (e) { console.log("Saving DB"); diff --git a/public/instant-opinion.min.js b/public/instant-opinion.min.js new file mode 100644 index 0000000..4ef2c9b --- /dev/null +++ b/public/instant-opinion.min.js @@ -0,0 +1 @@ +!async function(){const n="https://instant-opinion.dbuidl.com/votes/"+window.location.hostname,t=(n=>document.querySelectorAll(n))(".instant-opinion"),i='\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e',o='\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e';async function e(n,t="GET"){try{const i=await fetch(n,{method:t});return await i.json()}catch(n){return!1}}async function s(t,i,o){const s=await e(`${n}/${t}`,"POST");s&&"percent"in s&&(i.querySelector(".instant-opinion-percent").innerText=s.percent+"%",o.style.width=s.percent+"%")}async function c(){const t=await e(`${n}`);return!!(t&&"percent"in t)&&t.percent}for(let n=0;n"+(!1!==h?"

"+h+"%

":"

50%

")+"";const m=p.querySelector(".instant-opinion-progress-progress");m.style.width=h+"%";const w=document.createElement("div");w.classList.add("instant-opinion-thumbs"),p.appendChild(w),w.appendChild(l),w.appendChild(d),setTimeout(()=>{e.classList.add("hide_kinda")},2500);const g=document.createElement("link");g.href="opinion.css",g.rel="stylesheet",g.type="text/css",p.appendChild(g);let x=!1,f=!1;function a(){x?r.classList.add("show_happy"):r.classList.remove("show_happy")}l.addEventListener("click",async n=>(n.preventDefault(),n.stopPropagation(),x?(x=!1,l.innerHTML=i,a(),await s("0",e,m)):(x=!0,f=!1,l.innerHTML='\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e',d.innerHTML=o,a(),await s("1",e,m)))),d.addEventListener("click",async n=>(n.preventDefault(),n.stopPropagation(),f?(f=!1,d.innerHTML=o,a(),await s("0",e,m)):(f=!0,x=!1,d.innerHTML='\x3c!--! Font Awesome Pro 6.1.1 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2022 Fonticons, Inc. --\x3e',l.innerHTML=i,a(),await s("-1",e,m))))}}(); \ No newline at end of file