auto open about tab at start

This commit is contained in:
Joe Lothan 2026-05-27 11:22:26 -04:00
parent 758ab3080b
commit 2fb0e6706f
2 changed files with 22 additions and 3 deletions

View file

@ -265,6 +265,14 @@
border-bottom: 2px solid var(--tab-border); border-bottom: 2px solid var(--tab-border);
} }
.iframe-viewer.iframe-viewer-small {
height: 50vh;
}
.iframe-viewer-small iframe {
height: calc(50vh - 78px) !important;
}
/* Toolbar area (address bar) */ /* Toolbar area (address bar) */
.iframe-toolbar { .iframe-toolbar {
display: flex; display: flex;

View file

@ -211,8 +211,9 @@ async function loadMore() {
} }
if (entries.length > 0) { if (entries.length > 0) {
// Inject the "About EveryTab" tab at a random position in the first load // Inject the "About EveryTab" tab in the first row on first load
if (container.children.length === 0) { const isFirstLoad = container.children.length === 0;
if (isFirstLoad) {
const aboutEntry = { const aboutEntry = {
url: "https://everytab.site/about.html", url: "https://everytab.site/about.html",
title: "About EveryTab", title: "About EveryTab",
@ -220,11 +221,21 @@ async function loadMore() {
iframe_ok: true, iframe_ok: true,
_isAbout: true, _isAbout: true,
}; };
const pos = Math.floor(rng() * Math.min(entries.length, tabsPerRow() * 3)); const pos = Math.floor(rng() * Math.min(entries.length, tabsPerRow()));
entries.splice(pos, 0, aboutEntry); entries.splice(pos, 0, aboutEntry);
} }
renderEntries(entries); renderEntries(entries);
loadingEl.style.display = "none"; loadingEl.style.display = "none";
// Auto-open the about tab on first load
if (isFirstLoad) {
const aboutTab = container.querySelector(".tab-about");
if (aboutTab) {
aboutTab.click();
// Use smaller viewer for initial about page
if (activeViewer) activeViewer.classList.add("iframe-viewer-small");
}
}
} }
} }