add dark/light mode overrides
This commit is contained in:
+21
-2
@@ -15,8 +15,8 @@
|
||||
<img width="150" id="cover-img">
|
||||
</div>
|
||||
|
||||
<div style="text-align:center;" class="content">
|
||||
<p style="color:white;" id="cover-text"></p>
|
||||
<div style="text-align:center;" id="content">
|
||||
<p id="cover-text"></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -25,6 +25,25 @@
|
||||
</body>
|
||||
</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>
|
||||
body {
|
||||
font-family: 'Quicksand', sans-serif;
|
||||
|
||||
Reference in New Issue
Block a user