Skip to content

Commit dc9bc70

Browse files
committed
Deploy Logseq SPA @ cf5dabc2ab6d8a112f1f8c1535cb71dc5155c903 jjohare/logseq@cf5dabc
1 parent 10f0b08 commit dc9bc70

3 files changed

Lines changed: 31 additions & 1 deletion

File tree

notes/index.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

notes/static/css/custom.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,17 @@ html.ls-pres-mode .ls-pres-active img {
194194
box-shadow: 0 4px 20px rgba(0,0,0,0.4);
195195
}
196196

197+
/* Hero slides (JS-detected): image/video fills available space */
198+
html.ls-pres-mode .ls-pres-active.ls-pres-hero img {
199+
max-height: 80vh !important;
200+
max-width: 98% !important;
201+
}
202+
203+
html.ls-pres-mode .ls-pres-active.ls-pres-hero video {
204+
max-height: 80vh !important;
205+
max-width: 98% !important;
206+
}
207+
197208
/* ---- Videos ----------------------------------------------- */
198209
html.ls-pres-mode .ls-pres-active video {
199210
max-height: 55vh !important;

notes/static/js/custom.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,23 @@
162162
if (el) el.textContent = (state.idx + 1) + ' / ' + state.slides.length;
163163
}
164164

165+
/* ── detect hero slides (image/video-dominant) ────────── */
166+
function detectHero(slideEl) {
167+
var media = slideEl.querySelectorAll('.block-content img, .block-content video');
168+
if (!media.length) { slideEl.classList.remove('ls-pres-hero'); return; }
169+
/* count text-heavy blocks (>60 chars, no heading/media) */
170+
var heavy = 0;
171+
slideEl.querySelectorAll('.block-content').forEach(function (bc) {
172+
if (bc.querySelector('h1, h2, h3, img, video, table, iframe')) return;
173+
if (bc.textContent.trim().length > 60) heavy++;
174+
});
175+
if (heavy <= 1) {
176+
slideEl.classList.add('ls-pres-hero');
177+
} else {
178+
slideEl.classList.remove('ls-pres-hero');
179+
}
180+
}
181+
165182
/* ── navigation ────────────────────────────────────────── */
166183
function showSlide(n) {
167184
n = Math.max(0, Math.min(n, state.slides.length - 1));
@@ -171,6 +188,7 @@
171188
updateCounter();
172189
state.slides[n].scrollTop = 0;
173190
hideCollapsedBlocks(state.slides[n]);
191+
detectHero(state.slides[n]);
174192
}
175193

176194
function next() { showSlide(state.idx + 1); }
@@ -196,6 +214,7 @@
196214
document.documentElement.classList.remove('ls-pres-blackout');
197215
state.slides.forEach(function (s) {
198216
s.classList.remove('ls-pres-active');
217+
s.classList.remove('ls-pres-hero');
199218
/* clean up hidden markers */
200219
s.querySelectorAll('.ls-pres-hidden').forEach(function (h) {
201220
h.classList.remove('ls-pres-hidden');

0 commit comments

Comments
 (0)