2023-06-30 19:39:19 +00:00
|
|
|
const standalone = navigator.standalone || window.matchMedia("(display-mode: standalone)").matches;
|
|
|
|
if (standalone) {
|
|
|
|
const img = document.getElementById("pulltorefresh-img");
|
|
|
|
const defaultImg = "/e/marseythinkorino.webp";
|
|
|
|
const thresholdImg = "/e/marseythumbsup.webp";
|
|
|
|
const threshold = -100;
|
2023-07-03 00:26:20 +00:00
|
|
|
|
2023-06-30 19:39:19 +00:00
|
|
|
window.addEventListener("touchend", () => {
|
|
|
|
if (window.scrollY < threshold) {
|
2023-07-14 17:04:12 +00:00
|
|
|
location.reload();
|
2023-06-30 19:39:19 +00:00
|
|
|
}
|
|
|
|
});
|
2023-07-03 00:26:20 +00:00
|
|
|
|
2023-06-30 19:39:19 +00:00
|
|
|
window.addEventListener("scroll", () => {
|
|
|
|
img.setAttribute("src", window.scrollY < threshold ? thresholdImg : defaultImg);
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
document.getElementById("pulltorefresh").remove();
|
|
|
|
}
|