From b224f6af3e6ece7eefe7ad0ee70ec3a0cf70886c Mon Sep 17 00:00:00 2001 From: oybek Date: Sun, 24 Sep 2023 20:53:18 +0600 Subject: [PATCH] adapt color scheme to client theme --- spendbook/js/dropDowns.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/spendbook/js/dropDowns.js b/spendbook/js/dropDowns.js index 7af0023..2ef9d0b 100644 --- a/spendbook/js/dropDowns.js +++ b/spendbook/js/dropDowns.js @@ -43,6 +43,21 @@ $(document).ready(function () { $.each(months, function (key, obj) { $("#month").append(``); }); + if (window.Telegram.WebApp.colorScheme === "dark") { + $(":root") + .css('--border-color-2', '#666') + .css('--border-color', '#222') + .css('--bg-color', '#444') + .css('--bg-color-2', '#666') + .css('--fg-color', '#eee'); + } else { + $(":root") + .css('--border-color-2', '#aaa') + .css('--border-color', '#ccc') + .css('--bg-color', '#eee') + .css('--bg-color-2', '#fff') + .css('--fg-color', '#222'); + } }); $(".button-group").on("click", ".button", function () {