Compare commits

..

No commits in common. "c0a8c8746247a7fbdb1ed8640192679a276dd261" and "951e777c13b6524a3dd91c43488bf6e4f53d430e" have entirely different histories.

View File

@ -117,19 +117,34 @@ function createLinkElement(link, isWatched) {
const wrapper = document.createElement('div'); const wrapper = document.createElement('div');
wrapper.className = 'mb-auto'; wrapper.className = 'mb-auto';
const blockquote = document.createElement('blockquote'); const reelId = extractReelId(link.url);
blockquote.className = 'instagram-media'; if (!reelId) {
blockquote.setAttribute('data-instgrm-permalink', link.url); wrapper.innerText = 'Invalid Instagram Reel URL';
blockquote.style.background = '#FFF'; return wrapper;
}
const p = document.createElement('p'); // Clean iframe embed
p.innerText = 'Loading Instagram...'; const iframeWrapper = document.createElement('div');
blockquote.appendChild(p); iframeWrapper.style.width = '100%';
wrapper.appendChild(blockquote); 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 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');