diff --git a/js/replay-embed.template.js b/js/replay-embed.template.js index 74ea79744..97b88b574 100644 --- a/js/replay-embed.template.js +++ b/js/replay-embed.template.js @@ -79,6 +79,7 @@ var Replays = { log: log.split('\n'), isReplay: true, paused: true, + autoresize: true, }); this.$('.replay-controls-2').html('
Speed:
Color scheme:
'); @@ -207,3 +208,12 @@ var Replays = { window.onload = function () { Replays.init(); }; + +if (window.matchMedia) { + if (window.matchMedia('(prefers-color-scheme: dark)').matches) { + document.body.className = 'dark'; + } + window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function (event) { + document.body.className = event.matches ? "dark" : ""; + }); +}