Make embeds larger
This commit is contained in:
parent
6b4c1c8505
commit
38e2b176bc
|
@ -22,6 +22,10 @@
|
||||||
iframe {
|
iframe {
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
max-height: 100%;
|
||||||
|
width: max(var(--width), 480px);
|
||||||
|
height: auto;
|
||||||
|
aspect-ratio: var(--aspect-ratio);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@ import './embed-modal.css';
|
||||||
|
|
||||||
import Icon from './icon';
|
import Icon from './icon';
|
||||||
|
|
||||||
function EmbedModal({ html, url, onClose = () => {} }) {
|
function EmbedModal({ html, url, width, height, onClose = () => {} }) {
|
||||||
return (
|
return (
|
||||||
<div class="embed-modal-container">
|
<div class="embed-modal-container">
|
||||||
<div class="top-controls">
|
<div class="top-controls">
|
||||||
|
@ -20,7 +20,15 @@ function EmbedModal({ html, url, onClose = () => {} }) {
|
||||||
</a>
|
</a>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div class="embed-content" dangerouslySetInnerHTML={{ __html: html }} />
|
<div
|
||||||
|
class="embed-content"
|
||||||
|
dangerouslySetInnerHTML={{ __html: html }}
|
||||||
|
style={{
|
||||||
|
'--width': width + 'px',
|
||||||
|
'--height': height + 'px',
|
||||||
|
'--aspect-ratio': `${width}/${height}`,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,6 +210,8 @@ export default function Modals() {
|
||||||
<EmbedModal
|
<EmbedModal
|
||||||
html={snapStates.showEmbedModal.html}
|
html={snapStates.showEmbedModal.html}
|
||||||
url={snapStates.showEmbedModal.url}
|
url={snapStates.showEmbedModal.url}
|
||||||
|
width={snapStates.showEmbedModal.width}
|
||||||
|
height={snapStates.showEmbedModal.height}
|
||||||
onClose={() => {
|
onClose={() => {
|
||||||
states.showEmbedModal = false;
|
states.showEmbedModal = false;
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -2103,6 +2103,8 @@ function Card({ card, selfReferential, instance }) {
|
||||||
states.showEmbedModal = {
|
states.showEmbedModal = {
|
||||||
html,
|
html,
|
||||||
url: url || embedUrl,
|
url: url || embedUrl,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue