forked from glidejs/glide
-
Notifications
You must be signed in to change notification settings - Fork 0
/
defaults.js
228 lines (204 loc) · 4.8 KB
/
defaults.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
export default {
/**
* Type of the movement.
*
* Available types:
* `slider` - Rewinds slider to the start/end when it reaches the first or last slide.
* `carousel` - Changes slides without starting over when it reaches the first or last slide.
*
* @type {String}
*/
type: 'slider',
/**
* Start at specific slide number defined with zero-based index.
*
* @type {Number}
*/
startAt: 0,
/**
* A number of slides visible on the single viewport.
*
* @type {Number}
*/
perView: 1,
/**
* Focus currently active slide at a specified position in the track.
*
* Available inputs:
* `center` - Current slide will be always focused at the center of a track.
* `0,1,2,3...` - Current slide will be focused on the specified zero-based index.
*
* @type {String|Number}
*/
focusAt: 0,
/**
* A size of the gap added between slides.
*
* @type {Number}
*/
gap: 10,
/**
* Change slides after a specified interval. Use `false` for turning off autoplay.
*
* @type {Number|Boolean}
*/
autoplay: false,
/**
* Stop autoplay on mouseover event.
*
* @type {Boolean}
*/
hoverpause: true,
/**
* Allow for changing slides with left and right keyboard arrows.
*
* @type {Boolean}
*/
keyboard: true,
/**
* Stop running `perView` number of slides from the end. Use this
* option if you don't want to have an empty space after
* a slider. Works only with `slider` type and a
* non-centered `focusAt` setting.
*
* @type {Boolean}
*/
bound: false,
/**
* Minimal swipe distance needed to change the slide. Use `false` for turning off a swiping.
*
* @type {Number|Boolean}
*/
swipeThreshold: 80,
/**
* Minimal mouse drag distance needed to change the slide. Use `false` for turning off a dragging.
*
* @type {Number|Boolean}
*/
dragThreshold: 120,
/**
* A number of slides moved on single swipe.
*
* Available types:
* `` - Moves slider by one slide per swipe
* `|` - Moves slider between views per swipe (number of slides defined in `perView` options)
*
* @type {String}
*/
perSwipe: '|',
/**
* Moving distance ratio of the slides on a swiping and dragging.
*
* @type {Number}
*/
touchRatio: 0.5,
/**
* Angle required to activate slides moving on swiping or dragging.
*
* @type {Number}
*/
touchAngle: 45,
/**
* Duration of the animation in milliseconds.
*
* @type {Number}
*/
animationDuration: 400,
/**
* Allows looping the `slider` type. Slider will rewind to the first/last slide when it's at the start/end.
*
* @type {Boolean}
*/
rewind: true,
/**
* Duration of the rewinding animation of the `slider` type in milliseconds.
*
* @type {Number}
*/
rewindDuration: 800,
/**
* Easing function for the animation.
*
* @type {String}
*/
animationTimingFunc: 'cubic-bezier(.165, .840, .440, 1)',
/**
* Wait for the animation to finish until the next user input can be processed
*
* @type {boolean}
*/
waitForTransition: true,
/**
* Throttle costly events at most once per every wait milliseconds.
*
* @type {Number}
*/
throttle: 10,
/**
* Moving direction mode.
*
* Available inputs:
* - 'ltr' - left to right movement,
* - 'rtl' - right to left movement.
*
* @type {String}
*/
direction: 'ltr',
/**
* The distance value of the next and previous viewports which
* have to peek in the current view. Accepts number and
* pixels as a string. Left and right peeking can be
* set up separately with a directions object.
*
* For example:
* `100` - Peek 100px on the both sides.
* { before: 100, after: 50 }` - Peek 100px on the left side and 50px on the right side.
*
* @type {Number|String|Object}
*/
peek: 0,
/**
* Defines how many clones of current viewport will be generated.
*
* @type {Number}
*/
cloningRatio: 1,
/**
* Collection of options applied at specified media breakpoints.
* For example: display two slides per view under 800px.
* `{
* '800px': {
* perView: 2
* }
* }`
*/
breakpoints: {},
/**
* Collection of internally used HTML classes.
*
* @todo Refactor `slider` and `carousel` properties to single `type: { slider: '', carousel: '' }` object
* @type {Object}
*/
classes: {
swipeable: 'glide--swipeable',
dragging: 'glide--dragging',
direction: {
ltr: 'glide--ltr',
rtl: 'glide--rtl'
},
type: {
slider: 'glide--slider',
carousel: 'glide--carousel'
},
slide: {
clone: 'glide__slide--clone',
active: 'glide__slide--active'
},
arrow: {
disabled: 'glide__arrow--disabled'
},
nav: {
active: 'glide__bullet--active'
}
}
}