1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-24 20:36:40 +07:00

fix flow hero titles

This commit is contained in:
Fedor Katurov 2023-11-06 16:53:08 +06:00
parent 79fc183c9c
commit bb488b73d9
2 changed files with 5 additions and 21 deletions

View file

@ -63,27 +63,11 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
}, [controlledSwiper]); }, [controlledSwiper]);
const onIndexChange = useCallback((swiper: SwiperClass) => { const onIndexChange = useCallback((swiper: SwiperClass) => {
let activeIndex = swiper.activeIndex; if (!swiper.slides.length) {
let slidesLen = swiper.slides.length; return;
if (slidesLen === 0) {
return 0;
} }
if (swiper.params.loop) { setCurrentIndex(swiper.realIndex);
switch (swiper.activeIndex) {
case 0:
activeIndex = slidesLen - 3;
break;
case slidesLen - 1:
activeIndex = 0;
break;
default:
--activeIndex;
}
}
setCurrentIndex(activeIndex);
}, []); }, []);
const onClick = useCallback( const onClick = useCallback(
@ -148,7 +132,7 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
<Image <Image
width={800} width={800}
height={300} height={300}
src={getURLFromString(node.thumbnail, imagePresets.small_hero)} src={getURLFromString(node.thumbnail, preset)}
alt="" alt=""
className={classNames(styles.preview, 'swiper-lazy')} className={classNames(styles.preview, 'swiper-lazy')}
loading="lazy" loading="lazy"

View file

@ -67,7 +67,7 @@ $_brown: #23201f;
$_brown, $_brown,
0.3 0.3
)}; )};
--content_bg_hero: url('/images/noise.png') #{transparentize($_brown, 0.5)}; --content_bg_hero: url('/images/noise.png') #{transparentize($_brown, 0.6)};
// white shades (move to --vars) // white shades (move to --vars)
--white: white; --white: white;