diff --git a/static/links/main.js b/static/links/main.js index 04c3e80..7f7a234 100644 --- a/static/links/main.js +++ b/static/links/main.js @@ -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');