fix_dom
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
oleg.vodyanov91@gmail.com 2025-04-23 15:53:32 +04:00
parent ecc5066a22
commit 1ee3b23209

View File

@ -117,34 +117,19 @@ function createLinkElement(link, isWatched) {
const wrapper = document.createElement('div'); const wrapper = document.createElement('div');
wrapper.className = 'mb-auto'; wrapper.className = 'mb-auto';
const reelId = extractReelId(link.url); const blockquote = document.createElement('blockquote');
if (!reelId) { blockquote.className = 'instagram-media';
wrapper.innerText = 'Invalid Instagram Reel URL'; blockquote.setAttribute('data-instgrm-permalink', link.url);
return wrapper; blockquote.style.background = '#FFF';
}
// Clean iframe embed const p = document.createElement('p');
const iframeWrapper = document.createElement('div'); p.innerText = 'Loading Instagram...';
iframeWrapper.style.width = '100%'; blockquote.appendChild(p);
iframeWrapper.style.height = '600px'; wrapper.appendChild(blockquote);
iframeWrapper.style.overflow = 'hidden';
iframeWrapper.style.borderRadius = '10px';
const iframe = document.createElement('iframe');
iframe.src = link.url;
iframe.width = '100%';
iframe.height = '700'; // taller to allow for cropping
iframe.style.border = 'none';
iframe.allow="fullscreen";
iframe.loading = 'lazy';
iframeWrapper.appendChild(iframe);
wrapper.appendChild(iframeWrapper);
const btnGroup = document.createElement('div'); const btnGroup = document.createElement('div');
btnGroup.className = 'mt-2 d-flex gap-2'; btnGroup.className = 'mt-2 d-flex gap-2';
// Button to mark watched if it's not watched // Button to mark watched if it's not watched
if (!isWatched) { if (!isWatched) {
const watchButton = document.createElement('button'); const watchButton = document.createElement('button');