diff --git a/public/instant-opinion.min.js b/public/instant-opinion.min.js index 4ef2c9b..c1932b9 100644 --- a/public/instant-opinion.min.js +++ b/public/instant-opinion.min.js @@ -1 +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 +!async function(){const n="https://instant-opinion.dbuidl.com/votes/"+window.location.hostname,i=(t=".instant-opinion",document.querySelectorAll(t));var t;const 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',e='\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 s(n,i="GET"){try{const t=await fetch(n,{method:i});return await t.json()}catch(n){return!1}}async function c(i,t,o){const e=await s(`${n}/${i}`,"POST");e&&"percent"in e&&(t.querySelector(".instant-opinion-percent").innerText=e.percent+"%",o.style.width=e.percent+"%")}async function a(){const i=await s(`${n}`);return!(!i||!("percent"in i))&&i.percent}for(let n=0;n"+(!1!==h?"

"+h+"%

":"

50%

")+"";const m=s.querySelector(".instant-opinion-progress-progress");m.style.width=(!1===h?"50":h)+"%";const w=document.createElement("div");w.classList.add("instant-opinion-thumbs"),s.appendChild(w),w.appendChild(l),w.appendChild(d),setTimeout((()=>{t.classList.add("hide_kinda")}),2500);let g=!1,x=!1;function p(){g?r.classList.add("show_happy"):r.classList.remove("show_happy")}l.addEventListener("click",(async n=>(n.preventDefault(),n.stopPropagation(),g?(g=!1,l.innerHTML=o,p(),await c("0",t,m)):(g=!0,x=!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=e,p(),await c("1",t,m))))),d.addEventListener("click",(async n=>(n.preventDefault(),n.stopPropagation(),x?(x=!1,d.innerHTML=e,p(),await c("0",t,m)):(x=!0,g=!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=o,p(),await c("-1",t,m)))))}}(); \ No newline at end of file