fix infinite loop :( shouldn't have existed, silly programmer
Some checks failed
Deploy with Docker Compose / deploy (push) Failing after 50s

This commit is contained in:
2026-02-20 16:26:22 +00:00
parent 0c91f512b4
commit e016e3af46

View File

@@ -5,7 +5,7 @@ import Header from "@/components/text/Header.vue";
const images = [ const images = [
{ url: "/img/memes/pidgeon.gif", comment: "鸟" }, { url: "/img/memes/pidgeon.gif", comment: "鸟" },
//{ url: "/img/memes/no_slip.png" }, { url: "/img/memes/no_slip.png" },
//{ url: "/img/memes/epic.jpeg" }, //{ url: "/img/memes/epic.jpeg" },
// { url: "/img/bedroom/img2.png", comment: "办公桌" }, // { url: "/img/bedroom/img2.png", comment: "办公桌" },
// { url: "/img/bedroom/img1.png", comment: "床" }, // { url: "/img/bedroom/img1.png", comment: "床" },
@@ -17,7 +17,13 @@ const currentUrl = computed(() => images[currentIndex.value].url);
let nextId; let nextId;
function nextImage() { function nextRandomImage() {
clearTimeout(nextId);
currentIndex.value = (currentIndex.value + 1) % images.length;
nextId = setTimeout(nextImage, 10000);
}
function nextRandomImage() {
clearTimeout(nextId); clearTimeout(nextId);
let newIndex; let newIndex;
do { do {