Disable dark splash in embed

This commit is contained in:
Thomas Weber committed 2021-02-20 10:21:41 -06:00
1 parent cdc1fa7837
commit aa3da817dd
2 files changed
+3

No files matched your search

+2
View File
@@ -42,8 +42,10 @@
document.querySelector('#splash-troubleshooting').textContent = messages[2];
}
document.querySelector('#splash-content').style.display = 'block';
<% if (!htmlWebpackPlugin.options.noTheme) { %>
try {var localTheme = localStorage.getItem('tw:theme');} catch (e) {}
if (localTheme ? localTheme === 'dark' : window.matchMedia('(prefers-color-scheme: dark)').matches) document.querySelector('#splash').setAttribute('splash-theme', 'dark');
<% } %>
})();
</script>
<div id="app"></div>
+1
View File
@@ -176,6 +176,7 @@ module.exports = [
template: 'src/playground/index.ejs',
filename: 'embed.html',
title: 'Embedded Project - TurboWarp',
noTheme: true,
...htmlWebpackPluginCommon
}),
new HtmlWebpackPlugin({