openvibers/openvibe.live Commits
Load more: one entrance animation per card, not two
Changes
@@@ -5095,7 +5095,7 @@ curl -s https://openvibe.media/live/@Goosely/chat-insight.json | jq ".chat_insig<script src="/js/ov-skeleton.js?v=1" defer></script><script src="/js/ov-odometer.js?v=3" defer></script><script src="/js/ov-density.js?v=3" defer></script>--<script src="/js/app.js?v=172" defer></script>++<script src="/js/app.js?v=173" defer></script><script src="/js/stream-player.js?v=22" defer></script><script src="/js/stream-pip.js?v=1" defer></script><script src="/js/chat-shared.js?v=3" defer></script>@@@ -965,10 +965,20 @@ function ovPutCards(container, html, append) {if (!append) { container.innerHTML = html; return; }const first = container.children.length;container.insertAdjacentHTML('beforeend', html);++ const added = Array.prototype.slice.call(container.children, first);++++ // home-fx runs its own scroll-reveal over every .stream-card on the home page and parks each++ // one at opacity 0 until it is scrolled to. That is right for cards the reader is scrolling++ // toward and wrong for cards they just asked for by name. Worse, the two animations fight:++ // when .ov-enter is cleaned up below, a card that had not been revealed yet would drop back++ // to opacity 0 and disappear. Marking these as already revealed makes attachReveal() skip++ // them — it early-returns on .hfx-reveal — and leaves them opaque underneath, so .ov-enter is++ // the only thing animating.++ added.forEach(el => el.classList.add('hfx-reveal', 'is-in'));++let reduce = false;try { reduce = matchMedia('(prefers-reduced-motion: reduce)').matches; } catch { /* */ }if (reduce) return;-- const added = Array.prototype.slice.call(container.children, first);added.forEach((el, i) => {el.classList.add('ov-enter');el.style.setProperty('--ov-enter-i', String(Math.min(i, 11)));
@@ -5095,7 +5095,7 @@ curl -s https://openvibe.media/live/@Goosely/chat-insight.json | jq ".chat_insig
@@ -5095,7 +5095,7 @@ curl -s https://openvibe.media/live/@Goosely/chat-insight.json | jq ".chat_insig
<script src="/js/ov-skeleton.js?v=1" defer></script>
<script src="/js/ov-skeleton.js?v=1" defer></script>
<script src="/js/ov-odometer.js?v=3" defer></script>
<script src="/js/ov-odometer.js?v=3" defer></script>
<script src="/js/ov-density.js?v=3" defer></script>
<script src="/js/ov-density.js?v=3" defer></script>
-<script src="/js/app.js?v=172" defer></script>
+<script src="/js/app.js?v=173" defer></script>
<script src="/js/stream-player.js?v=22" defer></script>
<script src="/js/stream-player.js?v=22" defer></script>
<script src="/js/stream-pip.js?v=1" defer></script>
<script src="/js/stream-pip.js?v=1" defer></script>
<script src="/js/chat-shared.js?v=3" defer></script>
<script src="/js/chat-shared.js?v=3" defer></script>
@@ -965,10 +965,20 @@ function ovPutCards(container, html, append) {
@@ -965,10 +965,20 @@ function ovPutCards(container, html, append) {
if (!append) { container.innerHTML = html; return; }
if (!append) { container.innerHTML = html; return; }
const first = container.children.length;
const first = container.children.length;
container.insertAdjacentHTML('beforeend', html);
container.insertAdjacentHTML('beforeend', html);
+ const added = Array.prototype.slice.call(container.children, first);
+
+ // home-fx runs its own scroll-reveal over every .stream-card on the home page and parks each
+ // one at opacity 0 until it is scrolled to. That is right for cards the reader is scrolling
+ // toward and wrong for cards they just asked for by name. Worse, the two animations fight:
+ // when .ov-enter is cleaned up below, a card that had not been revealed yet would drop back
+ // to opacity 0 and disappear. Marking these as already revealed makes attachReveal() skip
+ // them — it early-returns on .hfx-reveal — and leaves them opaque underneath, so .ov-enter is
+ // the only thing animating.
+ added.forEach(el => el.classList.add('hfx-reveal', 'is-in'));
+
let reduce = false;
let reduce = false;
try { reduce = matchMedia('(prefers-reduced-motion: reduce)').matches; } catch { /* */ }
try { reduce = matchMedia('(prefers-reduced-motion: reduce)').matches; } catch { /* */ }
if (reduce) return;
if (reduce) return;
- const added = Array.prototype.slice.call(container.children, first);
added.forEach((el, i) => {
added.forEach((el, i) => {
el.classList.add('ov-enter');
el.classList.add('ov-enter');
el.style.setProperty('--ov-enter-i', String(Math.min(i, 11)));
el.style.setProperty('--ov-enter-i', String(Math.min(i, 11)));