mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fix flow hero titles
This commit is contained in:
parent
79fc183c9c
commit
bb488b73d9
2 changed files with 5 additions and 21 deletions
|
@ -63,27 +63,11 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
|
|||
}, [controlledSwiper]);
|
||||
|
||||
const onIndexChange = useCallback((swiper: SwiperClass) => {
|
||||
let activeIndex = swiper.activeIndex;
|
||||
let slidesLen = swiper.slides.length;
|
||||
|
||||
if (slidesLen === 0) {
|
||||
return 0;
|
||||
if (!swiper.slides.length) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (swiper.params.loop) {
|
||||
switch (swiper.activeIndex) {
|
||||
case 0:
|
||||
activeIndex = slidesLen - 3;
|
||||
break;
|
||||
case slidesLen - 1:
|
||||
activeIndex = 0;
|
||||
break;
|
||||
default:
|
||||
--activeIndex;
|
||||
}
|
||||
}
|
||||
|
||||
setCurrentIndex(activeIndex);
|
||||
setCurrentIndex(swiper.realIndex);
|
||||
}, []);
|
||||
|
||||
const onClick = useCallback(
|
||||
|
@ -148,7 +132,7 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
|
|||
<Image
|
||||
width={800}
|
||||
height={300}
|
||||
src={getURLFromString(node.thumbnail, imagePresets.small_hero)}
|
||||
src={getURLFromString(node.thumbnail, preset)}
|
||||
alt=""
|
||||
className={classNames(styles.preview, 'swiper-lazy')}
|
||||
loading="lazy"
|
||||
|
|
|
@ -67,7 +67,7 @@ $_brown: #23201f;
|
|||
$_brown,
|
||||
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: white;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue