From 5eabfc13e8c8003787d139c2e5999048d3c81933 Mon Sep 17 00:00:00 2001 From: Samidy Date: Mon, 2 Mar 2026 07:13:41 +0300 Subject: [PATCH] donate button shit --- index.html | 41 +++++++++++++++++++++++++++++++---------- js/app.js | 27 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index a1f8508..afbf2d1 100644 --- a/index.html +++ b/index.html @@ -1644,6 +1644,33 @@ + +


@@ -5369,9 +5392,7 @@ If Monochrome has been useful to you and you're able to, consider making a donation.
It helps pay for the domain, and you get to support us :)

- - - + diff --git a/js/app.js b/js/app.js index ffe937e..5a206e9 100644 --- a/js/app.js +++ b/js/app.js @@ -2381,6 +2381,33 @@ document.addEventListener('DOMContentLoaded', async () => { }); } + // Donate Modal Logic + const donateModal = document.getElementById('donate-modal'); + const closeDonateModalBtn = document.getElementById('close-donate-modal-btn'); + const sidebarDonateLink = document.getElementById('sidebar-donate-link'); + const donateBtnAbout = document.getElementById('donate-btn'); + const donateBtnPage = document.getElementById('donate-btn-page'); + + const openDonateModal = (e) => { + if (e) e.preventDefault(); + trackOpenModal('Donate'); + donateModal.classList.add('active'); + }; + + const closeDonateModal = () => { + donateModal.classList.remove('active'); + trackCloseModal('Donate'); + }; + + if (donateModal) { + if (closeDonateModalBtn) closeDonateModalBtn.addEventListener('click', closeDonateModal); + donateModal.querySelector('.modal-overlay')?.addEventListener('click', closeDonateModal); + + if (sidebarDonateLink) sidebarDonateLink.addEventListener('click', openDonateModal); + if (donateBtnAbout) donateBtnAbout.addEventListener('click', openDonateModal); + if (donateBtnPage) donateBtnPage.addEventListener('click', openDonateModal); + } + // Listener for Pocketbase Sync updates window.addEventListener('library-changed', () => { const path = window.location.pathname;