123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312 |
- /**
- * Export default options.
- *
- * @author Naotoshi Fujita
- * @copyright Naotoshi Fujita. All rights reserved.
- */
- import { ELEMENT_CLASSES as classes } from "./classes";
- import { I18N as i18n } from './i18n';
- export const DEFAULTS = {
- /**
- * Determine a slider type.
- * - 'slide': Regular slider.
- * - 'loop' : Carousel slider.
- * - 'fade' : Change slides with fade transition. perPage, drag options are ignored.
- *
- * @type {string}
- */
- type: 'slide',
- /**
- * Whether to rewind a slider before the first slide or after the last one.
- * In "loop" mode, this option is ignored.
- *
- * @type {boolean}
- */
- rewind: false,
- /**
- * Transition speed in milliseconds.
- *
- * @type {number}
- */
- speed: 400,
- /**
- * Define slider max width.
- *
- * @type {number}
- */
- width: 0,
- /**
- * Fix width of slides. CSS format is allowed such as 10em, 80% or 80vw.
- * perPage number will be ignored when this option is falsy.
- *
- * @type {number|string}
- */
- fixedWidth: 0,
- /**
- * Fix height of slides. CSS format is allowed such as 10em, 80vh but % unit is not accepted.
- * heightRatio option will be ignored when this option is falsy.
- *
- * @type {number}
- */
- fixedHeight: 0,
- /**
- * Determine height of slides by ratio to a slider width.
- * This will be ignored when the fixedHeight is provided.
- *
- * @type {number}
- */
- heightRatio: 0,
- /**
- * Determine how many slides should be displayed per page.
- *
- * @type {number}
- */
- perPage: 1,
- /**
- * Determine how many slides should be moved when a slider goes to next or perv.
- *
- * @type {number}
- */
- perMove: 0,
- /**
- * Start index.
- *
- * @type {number}
- */
- start: 0,
- /**
- * Determine which slide should be focused if there are multiple slides in a page.
- * A string "center" is acceptable for centering slides.
- *
- * @type {number|string}
- */
- focus: 0,
- /**
- * Gap between slides. CSS format is allowed such as 1em.
- *
- * @type {number|string}
- */
- gap: 0,
- /**
- * Set padding-left/right in horizontal mode or padding-top/bottom in vertical one.
- * Give a single value to set a same size for both sides or
- * do an object for different sizes.
- * Also, CSS format is allowed such as 1em.
- *
- * @example
- * - 10: Number
- * - '1em': CSS format.
- * - { left: 0, right: 20 }: Object for different sizes in horizontal mode.
- * - { top: 0, bottom: 20 }: Object for different sizes in vertical mode.
- *
- * @type {number|string|Object}
- */
- padding: 0,
- /**
- * Whether to append arrows.
- *
- * @type {boolean}
- */
- arrows: true,
- /**
- * Change the arrow SVG path like 'm7.61 0.807-2.12...'.
- *
- * @type {string}
- */
- arrowPath: '',
- /**
- * Whether to append pagination(indicator dots) or not.
- *
- * @type {boolean}
- */
- pagination: true,
- /**
- * Activate autoplay.
- *
- * @type {boolean}
- */
- autoplay: false,
- /**
- * Autoplay interval in milliseconds.
- *
- * @type {number}
- */
- interval: 5000,
- /**
- * Whether to stop autoplay when a slider is hovered.
- *
- * @type {boolean}
- */
- pauseOnHover: true,
- /**
- * Whether to stop autoplay when a slider elements are focused.
- * True is recommended for accessibility.
- *
- * @type {boolean}
- */
- pauseOnFocus: true,
- /**
- * Loading images lazily.
- * Image src must be provided by a data-splide-src attribute.
- *
- * - false: Do nothing.
- * - 'nearby': Only images around an active slide will be loaded.
- * - 'sequential': All images will be sequentially loaded.
- *
- * @type {boolean|string}
- */
- lazyLoad: false,
- /**
- * This option works only when a lazyLoad option is "nearby".
- * Determine how many pages(not slides) around an active slide should be loaded beforehand.
- *
- * @type {number}
- */
- preloadPages: 1,
- /**
- * Easing for CSS transition. For example, linear, ease or cubic-bezier().
- *
- * @type {string}
- */
- easing: 'cubic-bezier(.42,.65,.27,.99)',
- /**
- * Whether to control a slide via keyboard.
- *
- * @type {boolean}
- */
- keyboard: true,
- /**
- * Whether to allow mouse drag and touch swipe.
- *
- * @type {boolean}
- */
- drag: true,
- /**
- * Threshold for determining if the action is "flick" or "swipe".
- * Around 0.5 is recommended.
- *
- * @type {number}
- */
- flickThreshold: .6,
- /**
- * Determine power of flick. The larger number this is, the farther a slider runs by flick.
- * Around 500 is recommended.
- *
- * @type {number}
- */
- flickPower: 600,
- /**
- * Limit a number of pages to move by flick.
- *
- * @type {number}
- */
- flickMaxPages: 1,
- /**
- * Slider direction.
- * - 'ltr': Left to right.
- * - 'rtl': Right to left.
- * - 'ttb': Top to bottom.
- *
- * @type {string}
- */
- direction: 'ltr',
- /**
- * Set img src to background-image of its parent element.
- * Images with various sizes can be displayed as same dimension without cropping step.
- * fixedHeight or heightRatio is required.
- *
- * @type {boolean}
- */
- cover: true,
- /**
- * Whether to enable accessibility(aria and screen reader texts) or not.
- *
- * @type {boolean}
- */
- accessibility: true,
- /**
- * Determine if a slider is navigation for another.
- * Use "sync" API to synchronize two sliders.
- *
- * @type {boolean}
- */
- isNavigation: false,
- /**
- * Whether to trim spaces before the fist slide or after the last one when "focus" is not 0.
- *
- * @type {boolean}
- */
- trimSpace: true,
- /**
- * Breakpoints definitions.
- *
- * @example
- * {
- * '1000': {
- * perPage: 3,
- * gap: 20
- * },
- * '600': {
- * perPage: 1,
- * gap: 5,
- * }
- * }
- *
- * @type {boolean|Object}
- */
- breakpoints: false,
- /**
- * Collection of class names.
- *
- * @see ./classes.js
- *
- * @type {Object}
- */
- classes,
- /**
- * Collection of i18n texts.
- *
- * @see ./i18n.js
- *
- * @type {Object}
- */
- i18n,
- };
|