From 57205d71d366ed9e1ab404667f7b64bbd096def7 Mon Sep 17 00:00:00 2001 From: Swapnamayee Sahoo Date: Thu, 23 Nov 2023 17:55:51 +0530 Subject: [PATCH] 159: vimeo player padding issue fixed --- blocks/vimeo/vimeo.css | 4 ++++ blocks/vimeo/vimeo.js | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 blocks/vimeo/vimeo.css diff --git a/blocks/vimeo/vimeo.css b/blocks/vimeo/vimeo.css new file mode 100644 index 00000000..5d8f6e16 --- /dev/null +++ b/blocks/vimeo/vimeo.css @@ -0,0 +1,4 @@ +.vimeo { + padding-top: 50px; + padding-bottom: 50px; +} \ No newline at end of file diff --git a/blocks/vimeo/vimeo.js b/blocks/vimeo/vimeo.js index 30946caa..361c17b8 100644 --- a/blocks/vimeo/vimeo.js +++ b/blocks/vimeo/vimeo.js @@ -1,12 +1,13 @@ export default function decorate(block) { const anchorLink = block.querySelector('a'); + const ifrmContainer = document.createElement('div'); + ifrmContainer.classList.add('responsive-embed'); const ifrm = document.createElement('iframe'); ifrm.setAttribute('src', anchorLink); - ifrm.style.width = '980px'; - ifrm.style.height = '552px'; ifrm.style.frameBorder = '0'; ifrm.style.allow = 'autoplay; fullscreen; picture-in-picture'; ifrm.setAttribute('allowFullScreen', ''); + ifrmContainer.appendChild(ifrm); block.innerHTML = ''; - block.append(ifrm); + block.append(ifrmContainer); }