diff --git a/dist/index.d40c8796.js b/dist/index.cc3d830e.js similarity index 91% rename from dist/index.d40c8796.js rename to dist/index.cc3d830e.js index 6808491..1d1cce0 100644 --- a/dist/index.d40c8796.js +++ b/dist/index.cc3d830e.js @@ -144,6 +144,6 @@ Are you sure?`;function R(e){return 1==e.length&&(e="0"+e),e}const W={show:(e=nu ${e} `),l++}})(o.filter(t=>{if(t.toLowerCase()!=e.toLowerCase())return t.toLowerCase().includes(e.toLowerCase())})),document.querySelectorAll(".autofillItem").forEach(e=>{e.addEventListener("click",n),e.addEventListener("keydown",ec)}),document.querySelectorAll(".autofillItemRem").forEach(e=>{e.addEventListener("click",eP)})},ej=e=>{let t=JSON.parse(localStorage.getItem("autocompleteDatabase")),o=new Set(t);o.add(e);let n=Array.from(o);localStorage.setItem("autocompleteDatabase",JSON.stringify(n))},eP=e=>{let t=e.target.parentNode.children[0].innerText,o=JSON.parse(localStorage.getItem("autocompleteDatabase")),n=new Set(o);console.log(n.delete(t));let l=Array.from(n);localStorage.setItem("autocompleteDatabase",JSON.stringify(l))};let eH=null;function eV(){eH&&eH.classList.toggle("loader"),eH=null}function eU(){let e=localStorage.getItem("userName");if(e){v.show("Update your name","Maximum length allowed is 17 characters.",["Change name to"],"Update","Cancel",null,[E,null],()=>{v.getInputFields()[0].setAttribute("maxlength",17),v.getInputFields()[0].value=e}).then(t=>{e=t.inputValues[0],localStorage.setItem("userName",e),P(),et()}).catch(e=>{console.error(e)});return}if(!e){let t=v.show("Welcome to Casa Mia",`Hi! We are so excited to see you here. - Please fill out the following details before moving forward. `,["Your name"],"Proceed",null,null,[E,null],()=>{v.getInputFields()[0].setAttribute("maxlength",17)});return t.then(t=>{e=t.inputValues[0],localStorage.setItem("userName",e),localStorage.setItem("onBoarding","1")}).catch(e=>{console.error(e)}),t}}function eq(){let e=document.getElementsByTagName("select"),t={};for(let o of e)t[o.id]=o.value;localStorage.setItem("advDropdownValues",JSON.stringify(t)),j()}function eJ(e){document.documentElement.style.setProperty("--blur-one-em",`blur(${e}em)`),document.documentElement.style.setProperty("--blur-one-px",`blur(${e}px)`)}let eR=!1;function eW(){let e=new Date;11==e.getMonth()&&e.getDate()>17&&32>e.getDate()&&function(){let e=document.getElementById("canvasFar"),t=e.getContext("2d"),o=window.innerWidth,n=window.innerHeight;e.width=o,e.height=n;let l=[];for(let e=0;e<50;e++)l.push({x:Math.random()*o,y:Math.random()*n,r:4*Math.random()+1,d:50*Math.random()});t.fillStyle="rgba(255, 255, 255, 0.5)",e.style.display="block",eR=!1,window.requestAnimationFrame(function e(){t.clearRect(0,0,o,n),t.beginPath();for(let e=0;e<50;e++){let o=l[e];t.moveTo(o.x,o.y),t.arc(o.x,o.y,o.r,0,2*Math.PI,!0)}t.fill(),function(){for(let e=0;e<50;e++){let t=l[e];t.y+=Math.cos(t.d)+1+t.r/10,(t.x>o+5||t.x<-5||t.y>n)&&e%3>0&&(l[e]={x:Math.random()*o,y:-10,r:t.r,d:t.d})}}(),eR||window.requestAnimationFrame(e)})}()}const eY=document.getElementById("wallpapers"),ez=document.getElementById("wrap"),eG=document.getElementById("toggle-labs-btn"),eQ=document.getElementById("advanced-settings-modal"),eK=document.getElementById("advanced-settings-modal-background-overlay");let eX=!1,eZ=!1;const e0=e=>{switch(eV(),e){case"close":document.title=document.title.replace("Backgrounds","Search"),history.pushState({loc:"home"},"","?home"),eY.classList.remove("animation_slide_up"),setTimeout(()=>eG.classList.remove("advanced-settings-button-right"),350),eY.classList.add("animation_slide_down"),ez.classList.remove("animation2_slide_up"),ez.classList.add("animation2_slide_down"),clearTimeout(g),C("hide"),ed("hide"),z(null,0),setTimeout(()=>eJ(1),400),eZ=!1;break;case"open":eY.style.display="flex",eJ(0),eY.classList.remove("animation_slide_down"),eY.classList.add("animation_slide_up"),ez.classList.remove("animation2_slide_down","startup_slide_down"),ez.classList.add("animation2_slide_up"),setTimeout(()=>{eG.classList.add("advanced-settings-button-right"),function(){let e=document.getElementsByClassName("highlighted")[0];setTimeout(()=>{e&&e.scrollIntoView({inline:"center"})},10)}()},350),z(null,1),g=setTimeout(()=>C("show"),450),ed("show"),document.title=document.title.replace("Search","Backgrounds"),history.pushState({loc:"backgrounds"},"","?backgrounds"),eZ=!0}};function e1(){e0("close"),history.pushState({loc:"settings"},"","?settings"),setTimeout(()=>eJ(0),420),document.title=document.title.replace("Search","Settings"),document.body.classList.add("justifySpaceBetween"),ez.style.display="none",eQ.style.display="block",eK.style.display="block",eX=!0}function e5(){document.title=document.title.replace("Settings","Search"),history.pushState({loc:"home"},"","?home"),document.body.classList.remove("justifySpaceBetween"),ez.style.display="block",eQ.style.display="none",eK.style.display="none",setTimeout(()=>eJ(1),100),eX=!1}window.createNewBookmark=()=>{let e=` - You may only use upto four letters as the bookmark name.`;v.show("Add new bookmark",e,["Bookmark name","Link to website"],"Save",void 0,null,[()=>E(null,!0),null],()=>{v.getInputFields()[0].setAttribute("placeholder","e.g. YT");let e=v.getInputFields()[1];e.setAttribute("placeholder","e.g. youtube.com"),e.value="https://",navigator.clipboard.readText().then(t=>{I(t)&&(e.value=t.replaceAll(" ",""))}).catch(e=>{console.log(e)})}).then(e=>{let t=Date.now(),o=e.inputValues[0],n=e.inputValues[1].replaceAll(" ","");n.startsWith("http")||(n=`https://${n}`),L(n,o,t),x(n,o,t)}).catch(e=>console.log(e))},window.changeWallpaper=e=>{var t;e.stopPropagation();let o=e.target.title;o||(o=e.target.childNodes[1].title);let n=(t=o,[G.filter(e=>e.title==t)[0].file,G.filter(e=>e.title==t)[0].color[1]]);Q(n[0],n[1]),X()},es("export-bookmarks-btn","click",function(e){e.stopPropagation();let t=localStorage.saved_bookmarks,o=new Date;D(`casamia-bookmarks-only-${o.getFullYear()}-${o.getMonth()+1}-${o.getDate()}.json`,t)}),es("import-bookmarks-btn","change",eo),es("export-backup-btn","click",function(e){e.stopPropagation();let t=JSON.stringify({...localStorage}),o=new Date;D(`casamia-full-backup-${o.getFullYear()}-${o.getMonth()+1}-${o.getDate()}.json`,t)}),es("import-backup-btn","change",function(e,t=""){let o;e?(e.stopPropagation(),o=e.target.files[0].text()):o=t,o.then(function(t){let o=JSON.parse(t);if(o.onBoarding){let e=Object.keys(o);e.forEach((t,n)=>{localStorage.setItem(t,o[e[n]])}),window.location.reload()}else console.log(o),Y("Failed","The backup does not seem to be valid."),e.target.value=null})}),es("download-wallpaper-btn","click",function(){let e=document.createElement("a"),t=function(e,t){let o=e.split(".");return o[o.length-1]="png",o.join(".")}(r,0);e.setAttribute("href","./assets/wallpapers-hi-res/"+t),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}),es("toggle-favicons-btn","click",function(e){let t=document.getElementsByClassName("custom_bookmark"),o=document.getElementsByClassName("custom_link_name");for(let e=0;e{!function(e){document.getElementById(e).classList.toggle("nested-close")}("deep-search-nested");let t=document.getElementById("deep-search-btn-arrow");t.classList.toggle("fa-angle-down"),t.classList.toggle("fa-angle-up")}),es("update-customdomain-btn","click",_),es("fetch-bookmarks-btn","click",er),es("reset-bookmarks-btn","click",en),es("reset-all-btn","click",el),es("modal-close-btn","click",e5),es("toggle-labs-btn","click",e1),es("search-btn","click",function(){let e=ea().value;if(""!=e){if(ej(e),I(e)&&!e.includes(" ")){window.open(e,"_self");return}if(eS(e))!function(e){let t=e.toLowerCase();t=(t=t.split("--").join("")).split(" ");let o=e.split("--").join("").split(" ");switch(t[0]){case"help":window.open("/pages/help/index.html","_self");break;case"reset":"bookmarks"==t[1]?en():"history"==t[1]?(localStorage.setItem("autocompleteDatabase",b),window.location.reload()):"all"==t[1]?el():Y("Error",U);break;case"fetch":"default"==t[1]?er():Y("Error",U);break;case"dl":t[1]?eB(null,o[1]):Y("Failed","Enter a valid YT address");break;case"clock":window.open("./pages/clock","_self");break;case"count":window.open("./pages/countdown","_self");break;case"g":eL(h,e);break;case"b":eL(f,e);break;case"d":eL(y,e);break;default:Y("Error",U)}}(e);else{let t;e=encodeURIComponent(e);let o=(null==(t=localStorage.getItem("default-search-url"))&&(localStorage.setItem("default-search-url",h),t=localStorage.getItem("default-search-url")),t+e);window.open(o,"_self")}}else eg.show(ex)}),es("movies-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/Movies/time/desc/1/";window.open(t)}else eg.show(ex)}),es("tv-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/TV/size/desc/1/";window.open(t)}else eg.show(ex)}),es("games-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/Games/time/desc/1/";window.open(t)}else eg.show(ex)}),es("ebooks-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/Other/seeders/desc/1/";window.open(t)}else eg.show(ex)}),es("downloader-button","click",eB),es("searchTerm","input",function(e){let t=sessionStorage.getItem("input"),o=e.target.value;if(sessionStorage.setItem("input",o),eA(o),!o){eF(),setTimeout(()=>{eM()},1);return}e_(o),o!=t&&eN(o)}),es("searchTerm","click",()=>{let e=new InputEvent("input");ea().dispatchEvent(e)}),es("searchBarFocusMode","click",eM),es("searchTerm","keypress",function(e){"Enter"==e.key&&document.querySelector("#search-btn").click()}),es("fetch-bookmarks-btn","click",er),es("left-arrow","click",e=>{e.stopPropagation(),eu("widget-slide",-1)}),es("right-arrow","click",e=>{e.stopPropagation(),eu("widget-slide",1)}),window.addEventListener("resize",()=>{j(),eW()}),window.addEventListener("blur",()=>{eV()}),window.addEventListener("appinstalled",e=>{console.log("installed")}),onload=e=>{document.getElementById("main-heading-slider").classList.remove("nowrap")},es("settings_button","click",e=>{eZ?e0("close",e):eZ||e0("open",e)});const e2=()=>{let e;let t=document.body,o=()=>{clearInterval(e),e=null},n=t=>{["gradient_overlay","wrap","bookmarks","autofillContainer","flex-main-container-vertical","subtitle","footer"].includes(t.target.id)&&(e=setInterval(()=>{eZ?e0("close"):eZ||e0("open"),o()},eZ?1:250))};return t.addEventListener("mousedown",n),t.addEventListener("mouseup",o),t.addEventListener("mouseout",o),t.addEventListener("touchstart",n),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),()=>{t.removeEventListener("mousedown",n),t.removeEventListener("mouseup",o),t.removeEventListener("mouseout",o),t.removeEventListener("touchstart",n),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),console.log("un-focus",e)}},e3=()=>{window.addEventListener("popstate",e=>{eZ?e0("close"):eX?e5():eZ||eX||(history.go(-1),console.log("cant go back anymore",-history.length-1))});let e=window.location.href;(e=e.split("/?")[1])?"settings"==e?e1():"backgrounds"==e&&e0("open"):history.pushState({loc:"home"},"","?home")},e4=()=>{let e;let t=document.getElementById("btn-install");j(),function(){if(null==S){S=[];return}for(let e of S)L(e.link,e.name,e.id)}(),function(){for(let e of Object.entries(JSON.parse(localStorage.getItem("advDropdownValues")))){let t=document.getElementById(e[0]);t&&(t.value=e[1])}}(),ez.style.opacity=1,fetch(w+"wallpapers_list.json").then(e=>{e.text().then(e=>{G=JSON.parse(e),r=localStorage.getItem("wallpaper"),d=G.filter(e=>e.file==r)[0].color[1],Q(r,d),function(){let e=document.getElementById("wallpapers");for(let t of G){let o=t.file;o=o.split(".").join("-thumb.");let n=document.createElement("div");n.className="thumb-group",n.setAttribute("onclick","changeWallpaper(event)"),n.setAttribute("onkeypress","click_to_enter(event)"),n.setAttribute("tabindex","3");let l=document.createElement("div");l.innerHTML=t.title,l.className="thumb-title",n.appendChild(l);let a=document.createElement("img");a.src=w+o,a.className="thumbnail",a.title=t.title,a.setAttribute("draggable","false"),n.appendChild(a),e.appendChild(n)}}(),X()})}).catch(e=>{console.log(e),window.open("./pages/error","_self")}),X(),e2(),ei("clickable","keypress",ec),ei("bookmark-container","click",e=>{let t=e.target.closest(".bookmark-container").querySelector("a");t.href&&(eH=t,t.classList.toggle("loader"),window.open(t.href,"_self"))}),function(e,t,o){let n=document.getElementsByTagName(e);for(let e=0;e{e.prompt(),e.userChoice.then(t=>{"accepted"===t.outcome&&console.log("user accepted prompt"),e=null})}),window.addEventListener("beforeinstallprompt",o=>{o.preventDefault(),e=o,t.style.display="block"}),"1"==document.getElementById("searchbar").style.order&&window.scrollTo(0,document.body.scrollHeight),"on"==sessionStorage.getItem("focus")&&(document.getElementById("searchTerm").focus(),document.getElementById("searchTerm").click()),function(e){fetch("https://api.github.com/repos/lscambo13/casamia/commits/HEAD").then(t=>{t.json().then(t=>{let o=new Date(t.commit.committer.date).toISOString();o=(o=o.slice(0,o.length-5)).replaceAll("T","-").replaceAll(":","").replaceAll("-","."),document.getElementById(e).innerHTML=`Version ${o}`}).catch(e=>{console.error("getLastUpdated",e)})}).catch(e=>{console.error("getLastUpdated",e)})}("version-preview"),eW(),document.getElementById(localStorage.getItem("selected-widget-style")).scrollIntoView(),setTimeout(()=>{!function(e,t){let o=document.getElementsByClassName(t),n={root:document.getElementById(e),rootMargin:"0px",threshold:.5},l=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&localStorage.setItem("selected-widget-style",e.target.id)})},n);for(let e of o)l.observe(e)}("main-heading-slider","widget-slide")},500),e3()};document.addEventListener("DOMContentLoaded",()=>{"1"==localStorage.getItem("onBoarding")?(e4(),console.log("Already onboard.")):(console.log("Onboarding..."),(function(){let e=eU();return localStorage.setItem("onBoarding","0"),localStorage.setItem("advDropdownValues",JSON.stringify(k)),localStorage.setItem("wallpaper","085.webp"),localStorage.setItem("autocompleteDatabase",b),localStorage.setItem("selected-widget-style","widget-1"),e})().then(()=>{window.matchMedia("(hover: none)").matches&&setTimeout(()=>{Y("Information","Press and hold on empty area to open settings.")},5e3),e4(),console.log("Onboarding complete.")}))},{once:!0}); -//# sourceMappingURL=index.d40c8796.js.map + Please fill out the following details before moving forward. `,["Your name"],"Proceed",null,null,[E,null],()=>{v.getInputFields()[0].setAttribute("maxlength",17)});return t.then(t=>{e=t.inputValues[0],localStorage.setItem("userName",e),localStorage.setItem("onBoarding","1")}).catch(e=>{console.error(e)}),t}}function eq(){let e=document.getElementsByTagName("select"),t={};for(let o of e)t[o.id]=o.value;localStorage.setItem("advDropdownValues",JSON.stringify(t)),j()}function eJ(e){document.documentElement.style.setProperty("--blur-one-em",`blur(${e}em)`),document.documentElement.style.setProperty("--blur-one-px",`blur(${e}px)`)}let eR=!1;function eW(){let e=new Date;11==e.getMonth()&&e.getDate()>17&&32>e.getDate()&&function(){let e=document.getElementById("canvasFar"),t=e.getContext("2d"),o=window.innerWidth,n=window.innerHeight;e.width=o,e.height=n;let l=[];for(let e=0;e<50;e++)l.push({x:Math.random()*o,y:Math.random()*n,r:4*Math.random()+1,d:50*Math.random()});t.fillStyle="rgba(255, 255, 255, 0.5)",e.style.display="block",eR=!1,window.requestAnimationFrame(function e(){t.clearRect(0,0,o,n),t.beginPath();for(let e=0;e<50;e++){let o=l[e];t.moveTo(o.x,o.y),t.arc(o.x,o.y,o.r,0,2*Math.PI,!0)}t.fill(),function(){for(let e=0;e<50;e++){let t=l[e];t.y+=Math.cos(t.d)+1+t.r/10,(t.x>o+5||t.x<-5||t.y>n)&&e%3>0&&(l[e]={x:Math.random()*o,y:-10,r:t.r,d:t.d})}}(),eR||window.requestAnimationFrame(e)})}()}const eY=()=>{let e=new Date().getFullYear(),t=document.getElementById("copyright-text");t.title=`\u00A9 ${e} lscambo13`,t.innerText=`\u00A9 ${e} lscambo13`},ez=document.getElementById("wallpapers"),eG=document.getElementById("wrap"),eQ=document.getElementById("toggle-labs-btn"),eK=document.getElementById("advanced-settings-modal"),eX=document.getElementById("advanced-settings-modal-background-overlay");let eZ=!1,e0=!1;const e1=e=>{switch(eV(),e){case"close":document.title=document.title.replace("Backgrounds","Search"),history.pushState({loc:"home"},"","?home"),ez.classList.remove("animation_slide_up"),setTimeout(()=>eQ.classList.remove("advanced-settings-button-right"),350),ez.classList.add("animation_slide_down"),eG.classList.remove("animation2_slide_up"),eG.classList.add("animation2_slide_down"),clearTimeout(g),C("hide"),ed("hide"),z(null,0),setTimeout(()=>eJ(1),400),e0=!1;break;case"open":ez.style.display="flex",eJ(0),ez.classList.remove("animation_slide_down"),ez.classList.add("animation_slide_up"),eG.classList.remove("animation2_slide_down","startup_slide_down"),eG.classList.add("animation2_slide_up"),setTimeout(()=>{eQ.classList.add("advanced-settings-button-right"),function(){let e=document.getElementsByClassName("highlighted")[0];setTimeout(()=>{e&&e.scrollIntoView({inline:"center"})},10)}()},350),z(null,1),g=setTimeout(()=>C("show"),450),ed("show"),document.title=document.title.replace("Search","Backgrounds"),history.pushState({loc:"backgrounds"},"","?backgrounds"),e0=!0}};function e5(){e1("close"),history.pushState({loc:"settings"},"","?settings"),setTimeout(()=>eJ(0),420),document.title=document.title.replace("Search","Settings"),document.body.classList.add("justifySpaceBetween"),eG.style.display="none",eK.style.display="block",eX.style.display="block",eZ=!0}function e2(){document.title=document.title.replace("Settings","Search"),history.pushState({loc:"home"},"","?home"),document.body.classList.remove("justifySpaceBetween"),eG.style.display="block",eK.style.display="none",eX.style.display="none",setTimeout(()=>eJ(1),100),eZ=!1}window.createNewBookmark=()=>{let e=` + You may only use upto four letters as the bookmark name.`;v.show("Add new bookmark",e,["Bookmark name","Link to website"],"Save",void 0,null,[()=>E(null,!0),null],()=>{v.getInputFields()[0].setAttribute("placeholder","e.g. YT");let e=v.getInputFields()[1];e.setAttribute("placeholder","e.g. youtube.com"),e.value="https://",navigator.clipboard.readText().then(t=>{I(t)&&(e.value=t.replaceAll(" ",""))}).catch(e=>{console.log(e)})}).then(e=>{let t=Date.now(),o=e.inputValues[0],n=e.inputValues[1].replaceAll(" ","");n.startsWith("http")||(n=`https://${n}`),L(n,o,t),x(n,o,t)}).catch(e=>console.log(e))},window.changeWallpaper=e=>{var t;e.stopPropagation();let o=e.target.title;o||(o=e.target.childNodes[1].title);let n=(t=o,[G.filter(e=>e.title==t)[0].file,G.filter(e=>e.title==t)[0].color[1]]);Q(n[0],n[1]),X()},es("export-bookmarks-btn","click",function(e){e.stopPropagation();let t=localStorage.saved_bookmarks,o=new Date;D(`casamia-bookmarks-only-${o.getFullYear()}-${o.getMonth()+1}-${o.getDate()}.json`,t)}),es("import-bookmarks-btn","change",eo),es("export-backup-btn","click",function(e){e.stopPropagation();let t=JSON.stringify({...localStorage}),o=new Date;D(`casamia-full-backup-${o.getFullYear()}-${o.getMonth()+1}-${o.getDate()}.json`,t)}),es("import-backup-btn","change",function(e,t=""){let o;e?(e.stopPropagation(),o=e.target.files[0].text()):o=t,o.then(function(t){let o=JSON.parse(t);if(o.onBoarding){let e=Object.keys(o);e.forEach((t,n)=>{localStorage.setItem(t,o[e[n]])}),window.location.reload()}else console.log(o),Y("Failed","The backup does not seem to be valid."),e.target.value=null})}),es("download-wallpaper-btn","click",function(){let e=document.createElement("a"),t=function(e,t){let o=e.split(".");return o[o.length-1]="png",o.join(".")}(r,0);e.setAttribute("href","./assets/wallpapers-hi-res/"+t),e.setAttribute("download",t),e.style.display="none",document.body.appendChild(e),e.click(),document.body.removeChild(e)}),es("toggle-favicons-btn","click",function(e){let t=document.getElementsByClassName("custom_bookmark"),o=document.getElementsByClassName("custom_link_name");for(let e=0;e{!function(e){document.getElementById(e).classList.toggle("nested-close")}("deep-search-nested");let t=document.getElementById("deep-search-btn-arrow");t.classList.toggle("fa-angle-down"),t.classList.toggle("fa-angle-up")}),es("update-customdomain-btn","click",_),es("fetch-bookmarks-btn","click",er),es("reset-bookmarks-btn","click",en),es("reset-all-btn","click",el),es("modal-close-btn","click",e2),es("toggle-labs-btn","click",e5),es("search-btn","click",function(){let e=ea().value;if(""!=e){if(ej(e),I(e)&&!e.includes(" ")){window.open(e,"_self");return}if(eS(e))!function(e){let t=e.toLowerCase();t=(t=t.split("--").join("")).split(" ");let o=e.split("--").join("").split(" ");switch(t[0]){case"help":window.open("/pages/help/index.html","_self");break;case"reset":"bookmarks"==t[1]?en():"history"==t[1]?(localStorage.setItem("autocompleteDatabase",b),window.location.reload()):"all"==t[1]?el():Y("Error",U);break;case"fetch":"default"==t[1]?er():Y("Error",U);break;case"dl":t[1]?eB(null,o[1]):Y("Failed","Enter a valid YT address");break;case"clock":window.open("./pages/clock","_self");break;case"count":window.open("./pages/countdown","_self");break;case"g":eL(h,e);break;case"b":eL(f,e);break;case"d":eL(y,e);break;default:Y("Error",U)}}(e);else{let t;e=encodeURIComponent(e);let o=(null==(t=localStorage.getItem("default-search-url"))&&(localStorage.setItem("default-search-url",h),t=localStorage.getItem("default-search-url")),t+e);window.open(o,"_self")}}else eg.show(ex)}),es("movies-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/Movies/time/desc/1/";window.open(t)}else eg.show(ex)}),es("tv-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/TV/size/desc/1/";window.open(t)}else eg.show(ex)}),es("games-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/Games/time/desc/1/";window.open(t)}else eg.show(ex)}),es("ebooks-search","click",function(){let e=ea().value;if(""!=e){let t=p+(e=encodeURIComponent(e))+"/Other/seeders/desc/1/";window.open(t)}else eg.show(ex)}),es("downloader-button","click",eB),es("searchTerm","input",function(e){let t=sessionStorage.getItem("input"),o=e.target.value;if(sessionStorage.setItem("input",o),eA(o),!o){eF(),setTimeout(()=>{eM()},1);return}e_(o),o!=t&&eN(o)}),es("searchTerm","click",()=>{let e=new InputEvent("input");ea().dispatchEvent(e)}),es("searchBarFocusMode","click",eM),es("searchTerm","keypress",function(e){"Enter"==e.key&&document.querySelector("#search-btn").click()}),es("fetch-bookmarks-btn","click",er),es("left-arrow","click",e=>{e.stopPropagation(),eu("widget-slide",-1)}),es("right-arrow","click",e=>{e.stopPropagation(),eu("widget-slide",1)}),window.addEventListener("resize",()=>{j(),eW()}),window.addEventListener("blur",()=>{eV()}),window.addEventListener("appinstalled",e=>{console.log("installed")}),onload=e=>{document.getElementById("main-heading-slider").classList.remove("nowrap")},es("settings_button","click",e=>{e0?e1("close",e):e0||e1("open",e)});const e3=()=>{let e;let t=document.body,o=()=>{clearInterval(e),e=null},n=t=>{["gradient_overlay","wrap","bookmarks","autofillContainer","flex-main-container-vertical","subtitle","footer"].includes(t.target.id)&&(e=setInterval(()=>{e0?e1("close"):e0||e1("open"),o()},e0?1:250))};return t.addEventListener("mousedown",n),t.addEventListener("mouseup",o),t.addEventListener("mouseout",o),t.addEventListener("touchstart",n),t.addEventListener("touchend",o),t.addEventListener("touchcancel",o),()=>{t.removeEventListener("mousedown",n),t.removeEventListener("mouseup",o),t.removeEventListener("mouseout",o),t.removeEventListener("touchstart",n),t.removeEventListener("touchend",o),t.removeEventListener("touchcancel",o),console.log("un-focus",e)}},e4=()=>{window.addEventListener("popstate",e=>{e0?e1("close"):eZ?e2():e0||eZ||(history.go(-1),console.log("cant go back anymore",-history.length-1))});let e=window.location.href;(e=e.split("/?")[1])?"settings"==e?e5():"backgrounds"==e&&e1("open"):history.pushState({loc:"home"},"","?home")},e7=()=>{let e;let t=document.getElementById("btn-install");j(),function(){if(null==S){S=[];return}for(let e of S)L(e.link,e.name,e.id)}(),function(){for(let e of Object.entries(JSON.parse(localStorage.getItem("advDropdownValues")))){let t=document.getElementById(e[0]);t&&(t.value=e[1])}}(),eG.style.opacity=1,fetch(w+"wallpapers_list.json").then(e=>{e.text().then(e=>{G=JSON.parse(e),r=localStorage.getItem("wallpaper"),d=G.filter(e=>e.file==r)[0].color[1],Q(r,d),function(){let e=document.getElementById("wallpapers");for(let t of G){let o=t.file;o=o.split(".").join("-thumb.");let n=document.createElement("div");n.className="thumb-group",n.setAttribute("onclick","changeWallpaper(event)"),n.setAttribute("onkeypress","click_to_enter(event)"),n.setAttribute("tabindex","3");let l=document.createElement("div");l.innerHTML=t.title,l.className="thumb-title",n.appendChild(l);let a=document.createElement("img");a.src=w+o,a.className="thumbnail",a.title=t.title,a.setAttribute("draggable","false"),n.appendChild(a),e.appendChild(n)}}(),X()})}).catch(e=>{console.log(e),window.open("./pages/error","_self")}),X(),e3(),ei("clickable","keypress",ec),ei("bookmark-container","click",e=>{let t=e.target.closest(".bookmark-container").querySelector("a");t.href&&(eH=t,t.classList.toggle("loader"),window.open(t.href,"_self"))}),function(e,t,o){let n=document.getElementsByTagName(e);for(let e=0;e{e.prompt(),e.userChoice.then(t=>{"accepted"===t.outcome&&console.log("user accepted prompt"),e=null})}),window.addEventListener("beforeinstallprompt",o=>{o.preventDefault(),e=o,t.style.display="block"}),"1"==document.getElementById("searchbar").style.order&&window.scrollTo(0,document.body.scrollHeight),"on"==sessionStorage.getItem("focus")&&(document.getElementById("searchTerm").focus(),document.getElementById("searchTerm").click()),function(e){fetch("https://api.github.com/repos/lscambo13/casamia/commits/HEAD").then(t=>{t.json().then(t=>{let o=new Date(t.commit.committer.date).toISOString();o=(o=o.slice(0,o.length-5)).replaceAll("T","-").replaceAll(":","").replaceAll("-","."),document.getElementById(e).innerHTML=`Version ${o}`}).catch(e=>{console.error("getLastUpdated",e)})}).catch(e=>{console.error("getLastUpdated",e)})}("version-preview"),eW(),document.getElementById(localStorage.getItem("selected-widget-style")).scrollIntoView(),setTimeout(()=>{!function(e,t){let o=document.getElementsByClassName(t),n={root:document.getElementById(e),rootMargin:"0px",threshold:.5},l=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting&&localStorage.setItem("selected-widget-style",e.target.id)})},n);for(let e of o)l.observe(e)}("main-heading-slider","widget-slide")},500),e4()};document.addEventListener("DOMContentLoaded",()=>{eY(),"1"==localStorage.getItem("onBoarding")?(e7(),console.log("Already onboard.")):(console.log("Onboarding..."),(function(){let e=eU();return localStorage.setItem("onBoarding","0"),localStorage.setItem("advDropdownValues",JSON.stringify(k)),localStorage.setItem("wallpaper","085.webp"),localStorage.setItem("autocompleteDatabase",b),localStorage.setItem("selected-widget-style","widget-1"),e})().then(()=>{window.matchMedia("(hover: none)").matches&&setTimeout(()=>{Y("Information","Press and hold on empty area to open settings.")},5e3),e7(),console.log("Onboarding complete.")}))},{once:!0}); +//# sourceMappingURL=index.cc3d830e.js.map diff --git a/dist/index.html b/dist/index.html index 4d3b6b2..6ecb449 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -Search • Casa Mia

Welcome

Welcome

Welcome

Welcome

Welcome

Welcome

Welcome

Please wait

Download
Add Bookmark
Settings


\ No newline at end of file +Search • Casa Mia

Welcome

Welcome

Welcome

Welcome

Welcome

Welcome

Welcome

Please wait

Download
Add Bookmark
Settings


\ No newline at end of file