Add demo HTML files for dark mode and standard mode
This commit is contained in:
parent
bed254509b
commit
c5741c2fc1
36
public/demo-dark.html
Normal file
36
public/demo-dark.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<script type="module">
|
||||
function saveTextAsFile(text, filename) {
|
||||
const elem = document.createElement('a');
|
||||
elem.href = 'data:text/json;charset=utf-8,' + encodeURIComponent(text);
|
||||
elem.download = filename;
|
||||
elem.click();
|
||||
}
|
||||
const data = await fetch('example.json').then((res) => res.json());
|
||||
data.settings.darkMode = true;
|
||||
window.addEventListener('message', (event) => {
|
||||
saveTextAsFile(JSON.stringify(event.data), 'response.json');
|
||||
});
|
||||
window.onload = () => {
|
||||
const iframe = document.getElementById('iframe');
|
||||
iframe.contentWindow.postMessage(data, window.origin);
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
body {
|
||||
font-family: Inter, 'Helvetica Neue', Helvetica, 'PingFang SC',
|
||||
'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<iframe
|
||||
src="index.html"
|
||||
style="width: 100%; height: 100%; border: none; position: absolute; top: 0; left: 0;"
|
||||
id="iframe"></iframe>
|
||||
</body>
|
||||
</html>
|
@ -29,7 +29,7 @@
|
||||
<body>
|
||||
<iframe
|
||||
src="index.html"
|
||||
style="width: 99vw; height: 95vh; border: none;"
|
||||
style="width: 100%; height: 100%; border: none; position: absolute; top: 0; left: 0;"
|
||||
id="iframe"></iframe>
|
||||
</body>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user