add dark/light mode overrides

This commit is contained in:
zeph
2022-08-13 06:41:37 -04:00
parent 414415e81d
commit 5433244f45
+21 -2
View File
@@ -15,8 +15,8 @@
<img width="150" id="cover-img"> <img width="150" id="cover-img">
</div> </div>
<div style="text-align:center;" class="content"> <div style="text-align:center;" id="content">
<p style="color:white;" id="cover-text"></p> <p id="cover-text"></p>
</div> </div>
</div> </div>
@@ -25,6 +25,25 @@
</body> </body>
</html> </html>
<script>
const string = window.location.search;
const params = new URLSearchParams(string);
if (params.has('dark') && params.get('dark') == "true") {
console.log('[ws-iframe] received dark mode override');
document.body.style.backgroundColor = "black";
document.getElementById("content").style.color = "white";
} else if (params.has('light') && params.get("light") == "true") {
console.log('[ws-iframe] received light mode override');
document.body.style.backgroundColor = "white";
document.getElementById("content").style.color = "black";
} else {
console.log('[ws-iframe] no override, defaulting to dark');
document.body.style.backgroundColor = "black";
document.getElementById("content").style.color = 'white';
}
</script>
<style> <style>
body { body {
font-family: 'Quicksand', sans-serif; font-family: 'Quicksand', sans-serif;