33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
if (window.innerWidth > 800) {
|
|
document.getElementById("styleshed").innerHTML = ".likeButton {top: " + (document.getElementsByClassName("imgItem")[0].clientHeight - 18) + "px !important}";
|
|
} else {
|
|
document.getElementById("styleshed").innerHTML = ".likeButton {top: " + (document.getElementsByClassName("imgItem")[0].clientHeight - 58) + "px !important}";
|
|
}
|
|
|
|
document.querySelectorAll('.likebutton').forEach(element => {
|
|
element.addEventListener("click", async function () {
|
|
var itemid = this.attributes[1].value
|
|
|
|
if (this.innerHTML == "<icon>favorite_border</icon>") {
|
|
addFav(itemid);
|
|
await sleep(200);
|
|
getFav();
|
|
this.innerHTML = "<icon>favorite</icon>";
|
|
} else if (this.innerHTML == "<icon>favorite</icon>") {
|
|
remFav(itemid);
|
|
await sleep(200);
|
|
getFav();
|
|
this.innerHTML = "<icon>favorite_border</icon>";
|
|
}
|
|
});
|
|
});
|
|
|
|
async function myFunction() {
|
|
if (window.pageYOffset >= sticky) {
|
|
navbar.classList.add("sticky");
|
|
navbar.classList.add("ontop");
|
|
} else {
|
|
navbar.classList.remove("sticky");
|
|
navbar.classList.remove("ontop");
|
|
}
|
|
} |