Skip to content

Commit 48256e7

Browse files
committed
Style Ko-fi widgets to match light/dark theme
Floating button now initializes with theme-aware colors and updates on toggle. Status page iframe uses a tuned CSS filter in dark mode to blend with the warm palette.
1 parent dfa5a2e commit 48256e7

5 files changed

Lines changed: 24 additions & 8 deletions

File tree

public/css/all.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/css/style.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,6 +3275,9 @@ code {
32753275
height: 650px;
32763276
display: block;
32773277
}
3278+
.dark-mode .paper-kofi-wrap iframe {
3279+
filter: invert(0.88) hue-rotate(180deg) sepia(0.15) saturate(1.2) brightness(1.1) contrast(0.85);
3280+
}
32783281
@media (max-width: 700px) {
32793282
.paper-kofi-wrap iframe { height: 720px; }
32803283
}

public/index.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,12 +81,19 @@
8181
</script>
8282
<script src="https://storage.ko-fi.com/cdn/scripts/overlay-widget.js"></script>
8383
<script>
84-
kofiWidgetOverlay.draw("tdurieux", {
85-
type: "floating-chat",
86-
"floating-chat.donateButton.text": "Support me",
87-
"floating-chat.donateButton.background-color": "#323842",
88-
"floating-chat.donateButton.text-color": "#fff",
89-
});
84+
(function () {
85+
var isDark = localStorage.getItem("darkMode") === "true";
86+
kofiWidgetOverlay.draw("tdurieux", {
87+
type: "floating-chat",
88+
"floating-chat.donateButton.text": "Support me",
89+
"floating-chat.donateButton.background-color": isDark
90+
? "#FAF9F6"
91+
: "#1A1815",
92+
"floating-chat.donateButton.text-color": isDark
93+
? "#1A1815"
94+
: "#FAF9F6",
95+
});
96+
})();
9097
</script>
9198
</body>
9299
</html>

public/script/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,12 @@ angular
816816
document.head.append(link);
817817
$(`link[href='${darkPrismLink}']`).remove();
818818
}
819+
// Update Ko-fi floating button to match theme
820+
var kofiBtn = document.querySelector(".floatingchat-container-wrap-mo498 .floating-chat-kofi-text-container-wrap");
821+
if (kofiBtn) {
822+
kofiBtn.style.backgroundColor = on ? "#FAF9F6" : "#1A1815";
823+
kofiBtn.style.color = on ? "#1A1815" : "#FAF9F6";
824+
}
819825
$scope.$broadcast("dark-mode", on);
820826
};
821827

public/script/bundle.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)