mirror of
https://github.com/olegvodyanov/instalinks.git
synced 2025-12-20 09:07:04 +03:00
Compare commits
2 Commits
849d3edd84
...
e72b958f2a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e72b958f2a | ||
|
|
097c5c2710 |
@ -55,18 +55,18 @@ function renderPaginatedList(linkList, container, isWatched, page, totalPages) {
|
|||||||
linkList
|
linkList
|
||||||
.filter(link => link.watched === isWatched)
|
.filter(link => link.watched === isWatched)
|
||||||
.forEach(link => {
|
.forEach(link => {
|
||||||
const col = document.createElement('div');
|
const column = document.createElement('div');
|
||||||
col.className = 'col-12 col-sm-6 col-md-4 col-lg-3';
|
column.className = 'col-12 col-sm-6 col-md-4 col-lg-3';
|
||||||
col.appendChild(createLinkElement(link, isWatched));
|
column.appendChild(createLinkElement(link, isWatched));
|
||||||
row.appendChild(col);
|
row.appendChild(column);
|
||||||
});
|
});
|
||||||
|
|
||||||
container.appendChild(row);
|
container.appendChild(row);
|
||||||
|
|
||||||
// Pagination controls
|
// Pagination controls
|
||||||
if (totalPages > 1) {
|
if (totalPages > 1) {
|
||||||
const nav = document.createElement('div');
|
const navigation = document.createElement('div');
|
||||||
nav.className = 'd-flex justify-content-center mt-4 gap-2';
|
navigation.className = 'd-flex justify-content-center mt-4 gap-2';
|
||||||
|
|
||||||
const prevBtn = document.createElement('button');
|
const prevBtn = document.createElement('button');
|
||||||
prevBtn.innerText = '← Previous';
|
prevBtn.innerText = '← Previous';
|
||||||
@ -86,9 +86,9 @@ function renderPaginatedList(linkList, container, isWatched, page, totalPages) {
|
|||||||
loadLinks();
|
loadLinks();
|
||||||
};
|
};
|
||||||
|
|
||||||
nav.appendChild(prevBtn);
|
navigation.appendChild(prevBtn);
|
||||||
nav.appendChild(nextBtn);
|
navigation.appendChild(nextBtn);
|
||||||
container.appendChild(nav);
|
container.appendChild(navigation);
|
||||||
}
|
}
|
||||||
|
|
||||||
reinitializeInstagramEmbeds();
|
reinitializeInstagramEmbeds();
|
||||||
@ -108,18 +108,17 @@ function createLinkElement(link, isWatched) {
|
|||||||
// Clean iframe embed
|
// Clean iframe embed
|
||||||
const iframeWrapper = document.createElement('div');
|
const iframeWrapper = document.createElement('div');
|
||||||
iframeWrapper.style.width = '100%';
|
iframeWrapper.style.width = '100%';
|
||||||
iframeWrapper.style.height = '400px';
|
iframeWrapper.style.height = '600px';
|
||||||
iframeWrapper.style.overflow = 'hidden';
|
iframeWrapper.style.overflow = 'hidden';
|
||||||
iframeWrapper.style.borderRadius = '10px';
|
iframeWrapper.style.borderRadius = '10px';
|
||||||
|
|
||||||
const iframe = document.createElement('iframe');
|
const iframe = document.createElement('iframe');
|
||||||
iframe.src = `https://www.instagram.com/reel/${reelId}/embed`;
|
iframe.src = `https://www.instagram.com/reel/${reelId}/embed`;
|
||||||
iframe.width = '100%';
|
iframe.width = '100%';
|
||||||
iframe.height = '600'; // taller to allow for cropping
|
iframe.height = '700'; // taller to allow for cropping
|
||||||
iframe.style.border = 'none';
|
iframe.style.border = 'none';
|
||||||
iframe.allowFullscreen = true;
|
iframe.allow="fullscreen";
|
||||||
iframe.loading = 'lazy';
|
iframe.loading = 'lazy';
|
||||||
iframe.style.marginTop = '-100px'; // shift to crop comments/likes
|
|
||||||
|
|
||||||
iframeWrapper.appendChild(iframe);
|
iframeWrapper.appendChild(iframe);
|
||||||
wrapper.appendChild(iframeWrapper);
|
wrapper.appendChild(iframeWrapper);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user