fix: restore visible Ko-fi support across screen sizes

This commit is contained in:
Thomas Durieux committed 2026-10-07 15:02:53 +00:00
1 parent 282efdc16e
commit a7e3826da7
7 files changed
+86 -18

No files matched your search

+22
View File
@@ -74,5 +74,27 @@
};
</script>
<script src="/script/__VENDOR_JS__" defer></script>
<script>
window.addEventListener("load", function () {
// Phones use the always-visible header link instead of an overlay.
if (window.matchMedia("(max-width: 991px)").matches) return;
var s = document.createElement("script");
s.src = "https://storage.ko-fi.com/cdn/scripts/overlay-widget.js";
s.onload = function () {
var isDark = localStorage.getItem("darkMode") === "true";
kofiWidgetOverlay.draw("tdurieux", {
type: "floating-chat",
"floating-chat.donateButton.text": "Support me",
"floating-chat.donateButton.background-color": isDark
? "#FAF9F6"
: "#1A1815",
"floating-chat.donateButton.text-color": isDark
? "#1A1815"
: "#FAF9F6",
});
};
document.body.appendChild(s);
});
</script>
</body>
</html>