💄 Optimize styles

This commit is contained in:
LittleSheep 2024-02-10 11:41:08 +08:00
parent 9024d5246e
commit db87a85585

View File

@ -113,20 +113,6 @@ const embedOptions = new URLSearchParams({
</div> </div>
</PageLayout> </PageLayout>
<script>
function resizeInteractiveWidget(element: HTMLIFrameElement) {
const width = element.contentWindow?.document.body.scrollWidth;
const height = element.contentWindow?.document.body.scrollHeight;
element.width = width ? `${width}px` : "100%";
element.height = height ? `${height}px` : "360px";
}
const widget = document.querySelector<HTMLIFrameElement>("#interactive-iframe");
widget?.addEventListener("onload", () => {
resizeInteractiveWidget(widget);
});
</script>
<style> <style>
.wrapper { .wrapper {
display: grid; display: grid;
@ -149,12 +135,16 @@ const embedOptions = new URLSearchParams({
.wrapper { .wrapper {
grid-template-columns: 2fr 1fr; grid-template-columns: 2fr 1fr;
} }
#interactive-iframe {
height: 100vh;
}
} }
#interactive-iframe { #interactive-iframe {
display: block; display: block;
border: 0; border: 0;
width: 100%; width: 100%;
min-height: 360px; min-height: 480px;
} }
</style> </style>