mirror of
https://github.com/olegvodyanov/instalinks.git
synced 2025-12-20 03:27:04 +03:00
This commit is contained in:
parent
ecc5066a22
commit
1ee3b23209
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user