Skip to content

LordOS — a free, fast and secure GNU/Linux distribution based on Debian, with its own desktop environment: display server and Wayland compositor in C, a React UI engine on QuickJS, and private native apps.

Website: calmer hero slideshow: 6 s per slide, 800 ms ease-in-out crossfade, no timer bar

Federico Pereira64ec7e0a104c
diff --git a/web/build.mjs b/web/build.mjs
index 1aa788a..ec345f9 100644
--- a/web/build.mjs
+++ b/web/build.mjs
@@ -523,7 +523,7 @@ ${featureList[i] ? `<a class="more" href="${pageUrl(l, 'features/' + featureList
const capOf = (i) => (i === 0 ? H.alt : cap(SLIDES[i][0]));
const ico = (d0) => `<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="${d0}"/></svg>`;
const caps = esc(JSON.stringify(SLIDES.map((v, i) => capOf(i))));
- const ctl = n > 1 ? `<div class="hero-ctl" data-caps="${caps}"><button type="button" class="hc-btn hc-play" data-state="playing" data-pause="${esc(H.pause)}" data-play="${esc(H.play)}" aria-label="${esc(H.pause)}">${pause}${play}</button><button type="button" class="hc-btn hc-prev" aria-label="${esc(H.prev)}">${ico('M15 5l-7 7 7 7')}</button><button type="button" class="hc-btn hc-next" aria-label="${esc(H.next)}">${ico('M9 5l7 7-7 7')}</button><p class="hc-status" aria-live="off"><span class="hc-count"><span class="hc-n">1</span> / ${n}</span><span class="hc-cap">${esc(capOf(0))}</span></p><span class="hc-bar" aria-hidden="true"><i></i></span></div>` : '';
+ const ctl = n > 1 ? `<div class="hero-ctl" data-caps="${caps}"><button type="button" class="hc-btn hc-play" data-state="playing" data-pause="${esc(H.pause)}" data-play="${esc(H.play)}" aria-label="${esc(H.pause)}">${pause}${play}</button><button type="button" class="hc-btn hc-prev" aria-label="${esc(H.prev)}">${ico('M15 5l-7 7 7 7')}</button><button type="button" class="hc-btn hc-next" aria-label="${esc(H.next)}">${ico('M9 5l7 7-7 7')}</button><p class="hc-status" aria-live="off"><span class="hc-count"><span class="hc-n">1</span> / ${n}</span><span class="hc-cap">${esc(capOf(0))}</span></p></div>` : '';
const pills = H.pills.map((p) => `<li>${esc(p)}</li>`).join('');
return `<div class="laptop" id="hero-show" role="region" aria-roledescription="carousel" aria-label="${esc(H.carousel)}"><div class="lp-screen"><span class="lp-cam" aria-hidden="true"></span><div class="lp-display">${slides}</div></div><div class="lp-base" aria-hidden="true"><span class="lp-notch"></span></div>${ctl}</div><ul class="stats">${pills}</ul>`;
})(),
diff --git a/web/src/site.css b/web/src/site.css
index dba0a98..accbfb9 100644
--- a/web/src/site.css
+++ b/web/src/site.css
@@ -148,9 +148,9 @@ h1,h2,h3{text-wrap:balance}
.lp-cam{position:absolute;top:1.1%;left:50%;width:7px;height:7px;margin-left:-3.5px;border-radius:50%;background:#2A2940;box-shadow:inset 0 0 0 2px #1A1A28}
.lp-display{position:relative;overflow:hidden;border-radius:6px;background:var(--shot-bg);aspect-ratio:16/10}
.lp-display img{display:block;width:100%;height:100%;object-fit:cover}
-.slide{position:absolute;inset:0;margin:0;opacity:0;visibility:hidden;transition:opacity .6s ease,visibility 0s linear .6s}
-.slide.on{opacity:1;visibility:visible;transition:opacity .6s ease}
-.hero-ctl{display:none;position:relative;align-items:center;gap:6px;max-width:720px;margin:14px auto 0;padding:6px 14px 8px 6px;border-radius:999px;background:var(--surface);border:1px solid var(--line-2);box-shadow:0 8px 24px var(--shadow-2)}
+.slide{position:absolute;inset:0;margin:0;opacity:0;visibility:hidden;transition:opacity .8s ease-in-out,visibility 0s linear .8s}
+.slide.on{opacity:1;visibility:visible;transition:opacity .8s ease-in-out}
+.hero-ctl{display:none;position:relative;align-items:center;gap:6px;max-width:720px;margin:14px auto 0;padding:6px 14px 6px 6px;border-radius:999px;background:var(--surface);border:1px solid var(--line-2);box-shadow:0 8px 24px var(--shadow-2)}
.jt .hero-ctl{display:flex}
.hc-btn{flex:0 0 auto;width:34px;height:34px;border-radius:50%;border:0;background:var(--chip);color:var(--ink-2);display:inline-flex;align-items:center;justify-content:center;cursor:pointer}
.hc-btn:hover{color:var(--brand)}
@@ -159,10 +159,6 @@ h1,h2,h3{text-wrap:balance}
.hc-status{margin:0 0 0 6px;min-width:0;flex:1;display:flex;align-items:baseline;gap:10px;font-size:14px;color:var(--ink-2)}
.hc-count{flex:0 0 auto;font:600 13px/1 var(--mono);color:var(--subtle)}
.hc-cap{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:600}
-.hc-bar{position:absolute;left:18px;right:18px;bottom:3px;height:2px;border-radius:2px;background:var(--line);overflow:hidden}
-.hc-bar i{display:block;height:100%;width:0;background:var(--accent)}
-.hc-bar.run i{animation:hcbar 3s linear forwards}
-@keyframes hcbar{from{width:0}to{width:100%}}
@media (prefers-reduced-motion:reduce){.jt .hero-ctl{display:none}.slide{transition:none}}
.lp-d{display:none!important}
@media (prefers-color-scheme:dark){:root:not([data-theme=light]) .lp-l{display:none!important}:root:not([data-theme=light]) .lp-d{display:block!important}}
diff --git a/web/src/site.js b/web/src/site.js
index 7e5497a..75385be 100644
--- a/web/src/site.js
+++ b/web/src/site.js
@@ -97,13 +97,13 @@
label();
}
- // Home hero slideshow: crossfade every 3 s; pauses on hover, focus, hidden tab or the Pause button;
+ // Home hero slideshow: crossfade every 6 s; pauses on hover, focus, hidden tab or the Pause button;
// off with prefers-reduced-motion (only the first screen shows). Loads each image just before it shows.
var show = $('#hero-show');
var reduce = window.matchMedia && matchMedia('(prefers-reduced-motion: reduce)').matches;
if (show && !reduce) {
var slides = $$('.slide', show), ctl = $('.hero-ctl', show), pb = $('.hc-play', show);
- var status = $('.hc-status', show), num = $('.hc-n', show), capEl = $('.hc-cap', show), bar = $('.hc-bar', show);
+ var status = $('.hc-status', show), num = $('.hc-n', show), capEl = $('.hc-cap', show);
var caps = ctl ? JSON.parse(ctl.getAttribute('data-caps')) : [];
var cur = 0, timer = null, user = false, hover = false, focus = false;
var load = function (i) {
@@ -113,10 +113,6 @@
});
};
var running = function () { return !user && !hover && !focus && !d.hidden; };
- var restartBar = function () {
- bar.classList.remove('run');
- if (running()) { void bar.offsetWidth; bar.classList.add('run'); }
- };
var go = function (i) {
var n = slides.length;
i = (i + n) % n;
@@ -127,9 +123,8 @@
};
var sync = function () {
clearInterval(timer); timer = null;
- if (running()) timer = setInterval(function () { go(cur + 1); restartBar(); }, 3000);
+ if (running()) timer = setInterval(function () { go(cur + 1); }, 6000);
status.setAttribute('aria-live', running() ? 'off' : 'polite');
- restartBar();
};
if (slides.length > 1 && ctl) {
load(1);