[www-doc] [Git][VideoLAN.org/websites][master] Respect reduced motion setting in carousels
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Sun Feb 8 09:38:56 UTC 2026
Jean-Baptiste Kempf pushed to branch master at VideoLAN organization / websites
Commits:
bc947dea by Marvin Scholz at 2026-02-08T10:38:35+01:00
Respect reduced motion setting in carousels
Query the reduced motion setting, and if reduced motion is requested,
use a fade animation for the carousels instead of a more intense slide
animation.
- - - - -
1 changed file:
- www.videolan.org/js/slick-init.js
Changes:
=====================================
www.videolan.org/js/slick-init.js
=====================================
@@ -1,4 +1,11 @@
-$(document).ready(function() {
+function useReducedMotion() {
+ if (typeof window.matchMedia === "undefined") {
+ return false;
+ }
+ return !window.matchMedia("(prefers-reduced-motion: no-preference)").matches;
+}
+
+$(document).ready(function () {
$('#header-carousel').slick({
lazyLoad: 'ondemand',
slidesToShow: 1,
@@ -6,6 +13,7 @@ $(document).ready(function() {
autoplay: true,
autoplaySpeed: 3000,
infinite: true,
+ fade: useReducedMotion(),
responsive: [{
breakpoint: 768,
settings: {
@@ -20,6 +28,7 @@ $(document).ready(function() {
slidesToShow: 8,
slidesToScroll: 2,
variableWidth: true,
+ fade: useReducedMotion(),
responsive: [{
breakpoint: 768,
settings: {
@@ -37,6 +46,7 @@ $(document).ready(function() {
autoplay: true,
autoplaySpeed: 3000,
infinite: true,
- arrows: false
+ arrows: false,
+ fade: useReducedMotion(),
});
});
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/commit/bc947deaa2ed33121b285a0e829216130ce00ba8
--
View it on GitLab: https://code.videolan.org/VideoLAN.org/websites/-/commit/bc947deaa2ed33121b285a0e829216130ce00ba8
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the www-doc
mailing list