Skip to content

Commit

Permalink
Merge pull request #42 from osakunta/carousel-fix
Browse files Browse the repository at this point in the history
cap carousel framerate, remove transition time from cards
  • Loading branch information
vuolen authored Sep 25, 2024
2 parents 2e45aaa + 48c5f2a commit bcd998e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions components/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ const wrappedDistance = (a: number, b: number) => {
return Math.min(bigger - smaller, 1 + smaller - bigger);
};

let lastSetOpacity = 0;

const setOpacity = (emblaApi: EmblaCarouselType) => {
const now = Date.now();
if (now - lastSetOpacity < 16) return;
lastSetOpacity = now;
const slideNodes = emblaApi.slideNodes();

const currentPosition = emblaApi.scrollProgress();
Expand Down
6 changes: 3 additions & 3 deletions hooks/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@
"sv": "Sport"
},
"homepage:contactBoardDescription": {
"fi": "Voit ottaa yhteyttä osakunnan hallitukseen sähköpostitse osoitteella hallitus@satakuntatalo.fi tai alla olevalla lomakkeella. Halutessasi tavoittaa tietyn virkailijan, virkailijoiden yhteystiedot löytyvät \"Ota yhteyttä\" sivulta.\t ",
"en": "You can contact the board by sending an email to hallitus@satakuntatalo.fi or by filling out the form. If you need to get in touch with a specific official you can find their contact info on the \"Contact us\" page.\t \t \t \t",
"sv": "Du kan kontakta styrelsen via e-post på addressen hallitus@satakuntatalo.fi eller via formuläret. Du kan även kontakta specifika funktionärer, vars kontaktuppgifter hittas på \"Ta kontakt\" sidan.\t \t \t \t"
"fi": "Voit ottaa yhteyttä osakunnan hallitukseen sähköpostitse osoitteella hallitus(a)satakuntatalo.fi tai alla olevalla lomakkeella. Halutessasi tavoittaa tietyn virkailijan, virkailijoiden yhteystiedot löytyvät \"Ota yhteyttä\" sivulta.\t ",
"en": "You can contact the board by sending an email to hallitus(a)satakuntatalo.fi or by filling out the form. If you need to get in touch with a specific official you can find their contact info on the \"Contact us\" page.\t \t \t \t",
"sv": "Du kan kontakta styrelsen via e-post på addressen hallitus(a)satakuntatalo.fi eller via formuläret. Du kan även kontakta specifika funktionärer, vars kontaktuppgifter hittas på \"Ta kontakt\" sidan.\t \t \t \t"
},
"homepage:contactBoardHeader": {
"fi": "Postia hallitukselle",
Expand Down
5 changes: 5 additions & 0 deletions styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,11 @@ h1 {
--slide-spacing: 1rem;
--slide-size: 30%;
}

.embla * {
transition: 0s !important;
}

.embla__viewport {
overflow: hidden;
}
Expand Down

0 comments on commit bcd998e

Please sign in to comment.