Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

slowdown partner carsousels #43

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions site/assets/js/utils/slideshows.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,27 @@ export default function() {
},
});

// cotinuous ticker:
// continuous ticker:

let speed = 0.85;

carouselPartners.addEventListener('mouseenter', function() {
speed = 0.2;
});
carouselPartners.addEventListener('mouseleave', function() {
speed = 0.85;
});

const _updateTicker2 = function() {
flkty_partner.x = (flkty_partner.x - 0.85) % flkty_partner.slideableWidth;
flkty_partner.x = (flkty_partner.x - speed) % flkty_partner.slideableWidth;
flkty_partner.selectedIndex = flkty_partner.dragEndRestingSelect();
flkty_partner.updateSelectedSlide();
flkty_partner.settle(flkty_partner.x);
window.requestAnimationFrame(_updateTicker2);
};

_updateTicker2();

}

const carouselClients = document.querySelector('.clients-carousel');
Expand Down
2 changes: 1 addition & 1 deletion site/layouts/partials/box-training-small.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



<div class="inner border light p-4 ps-lg-10 py-lg-8 d-flex flex-column h-100 position-relative">
<div class="inner border light p-4 ps-lg-10 pt-lg-8 d-flex flex-column h-100 position-relative">
{{ if in .Params.categories "New" }}
<div class="position-absolute label-new bg-primary text-white px-2 py-md-1 small">{{ i18n "new" }}</div>
{{ end }}
Expand Down
Loading