Skip to content

Fix: Make the copy card respect dark mode#36

Open
HarryVasanth wants to merge 1 commit into
mrshu:masterfrom
HarryVasanth:fix/issue-35-copy-card-dark-mode
Open

Fix: Make the copy card respect dark mode#36
HarryVasanth wants to merge 1 commit into
mrshu:masterfrom
HarryVasanth:fix/issue-35-copy-card-dark-mode

Conversation

@HarryVasanth

Copy link
Copy Markdown

This fixes issue #35, where the copied share card was always generated in light mode.

Before:
image

After:
image

The canvas rendering logic in app.js will now check the user preference (prefers-color-scheme: dark). When dark mode is active, the script maps the correct dark colours to the generated PNG, including the background gradients, text, borders, and uptime bars.

I have also included an event listener that clears the cached image if the system theme changes while the page is open, so it always generates the correct version when you click the button.

Resolves #35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

'Copy card' does not respect dark mode

1 participant