Merge pull request #32 from olegvodyanov/fix
All checks were successful
continuous-integration/drone/push Build is passing

fix_dom
This commit is contained in:
Олег Водянов 2025-04-23 15:54:04 +04:00 committed by GitHub
commit c0a8c87462
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -117,34 +117,19 @@ function createLinkElement(link, isWatched) {
const wrapper = document.createElement('div');
wrapper.className = 'mb-auto';
const reelId = extractReelId(link.url);
if (!reelId) {
wrapper.innerText = 'Invalid Instagram Reel URL';
return wrapper;
}
const blockquote = document.createElement('blockquote');
blockquote.className = 'instagram-media';
blockquote.setAttribute('data-instgrm-permalink', link.url);
blockquote.style.background = '#FFF';
// Clean iframe embed
const iframeWrapper = document.createElement('div');
iframeWrapper.style.width = '100%';
iframeWrapper.style.height = '600px';
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 p = document.createElement('p');
p.innerText = 'Loading Instagram...';
blockquote.appendChild(p);
wrapper.appendChild(blockquote);
const btnGroup = document.createElement('div');
btnGroup.className = 'mt-2 d-flex gap-2';
// Button to mark watched if it's not watched
if (!isWatched) {
const watchButton = document.createElement('button');