mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-24 20:36:40 +07:00
fixed tiny slider on bigger resolutions
This commit is contained in:
parent
531bd3626a
commit
5da9a0547d
2 changed files with 25 additions and 8 deletions
|
@ -6,20 +6,20 @@ import { getURL } from '~/utils/dom';
|
|||
import { PRESETS } from '~/constants/urls';
|
||||
import TinySlider from 'tiny-slider-react';
|
||||
import styles from './styles.module.scss';
|
||||
import { TinySliderSettings } from 'tiny-slider';
|
||||
|
||||
const settings = {
|
||||
const settings: TinySliderSettings & { center: boolean } = {
|
||||
nav: false,
|
||||
buttons: false,
|
||||
mouseDrag: true,
|
||||
gutter: 10,
|
||||
center: true,
|
||||
lazyload: true,
|
||||
items: 1,
|
||||
edgePadding: 150,
|
||||
loop: true,
|
||||
loop: false,
|
||||
arrowKeys: false,
|
||||
prevButton: false,
|
||||
nextButton: false,
|
||||
// prevButton: false,
|
||||
// nextButton: false,
|
||||
swipeAngle: 45,
|
||||
};
|
||||
|
||||
|
@ -31,7 +31,9 @@ const NodeImageTinySlider: FC<INodeComponentProps> = ({ node }) => {
|
|||
<div className={styles.slider}>
|
||||
<TinySlider settings={settings}>
|
||||
{images.map(image => (
|
||||
<div className={styles.slide}>
|
||||
<img src={getURL(image, PRESETS['1600'])} key={image.url} />
|
||||
</div>
|
||||
))}
|
||||
</TinySlider>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,20 @@
|
|||
.slider {
|
||||
padding-bottom: 15px;
|
||||
|
||||
:global(.tns-controls) {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.slide {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
|
||||
img {
|
||||
max-height: calc(100vh - 140px);
|
||||
max-height: calc(100vh - 150px);
|
||||
max-width: 100%;
|
||||
border-radius: $radius;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue