From 9bb690e4f67ebe2cfe543667606d1cf91f2fd880 Mon Sep 17 00:00:00 2001 From: Fovway Date: Sun, 9 Mar 2025 12:45:14 +0000 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D1=82=D1=8C=20vo?= =?UTF-8?q?te-color.js?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vote-color.js | 23 ----------------------- 1 file changed, 23 deletions(-) delete mode 100644 vote-color.js diff --git a/vote-color.js b/vote-color.js deleted file mode 100644 index c305926..0000000 --- a/vote-color.js +++ /dev/null @@ -1,23 +0,0 @@ -function updateVoteColors() { - document.querySelectorAll(".card__vote").forEach(voteElement => { - const vote = parseFloat(voteElement.textContent.trim()); - - if (vote >= 0 && vote <= 3) { - voteElement.style.color = "red"; - } else if (vote >= 3 && vote <= 5.9) { - voteElement.style.color = "orange"; - } else if (vote >= 6 && vote <= 7.9) { - voteElement.style.color = "cornflowerblue"; - } else if (vote >= 8 && vote <= 10) { - voteElement.style.color = "lawngreen"; - } - }); -} - -document.addEventListener("DOMContentLoaded", function () { - setTimeout(updateVoteColors, 500); -}); - -// Следим за изменениями в контейнере с карточками -const observer = new MutationObserver(updateVoteColors); -observer.observe(document.body, { childList: true, subtree: true });