Skip to content

Commit

Permalink
Add auto detect preferred color scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
rowenslee committed Oct 14, 2024
1 parent 635ef80 commit a31a3bd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resources/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,11 @@ <h5 class="modal-title">Terms of Service</h5>
if (processor === 'zebedee') {
document.getElementById('powered-by-zebedee').classList.remove('d-none')
}

// Check for system preference on load
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark-theme');
}
}
</script>
</body>
Expand Down
5 changes: 5 additions & 0 deletions resources/invoices.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ <h2 class="text-danger">Invoice expired!</h2>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js" integrity="sha512-CNgIRecGo7nphbeZ04Sc13ka07paqdeTu0WR1IM4kNcpmBAUSHSQX0FslNhTDadL4O5SAGapGt4FodqL8My0mA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script>
// Check for system preference on load
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark-theme');
}

var reference = "{{reference}}"
var relayUrl = "{{relay_url}}"
var relayPubkey = "{{relay_pubkey}}"
Expand Down
6 changes: 6 additions & 0 deletions resources/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,11 @@ <h3>Terms of Service Agreement</h3>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.min.js" integrity="sha384-cuYeSxntonz0PPNlHhBs68uyIAVpIIOZZ5JqeqvYYIcEL727kskC66kF92t6Xl2V" crossorigin="anonymous"></script>
<script>
// Check for system preference on load
if (window.matchMedia('(prefers-color-scheme: dark)').matches) {
document.body.classList.add('dark-theme');
}
</script>
</body>
</html>

0 comments on commit a31a3bd

Please sign in to comment.