Current: 0
Set index = 2
Attribute
Attribute
initial-index
auto-play
interval
transition
Description
initial image index
auto play
auto play interval
transition effect
Type
number
boolean
number
Transition
Accepted Values
-
-
-
-
Default
0
true
3000
{ name: "default"}
Event
Event
change
Description
triggers when the active slide switches
Parameters
index of the new active slide, index of the old active slide
Method
Method
prev
next
setActiveItem
Description
switch to the previous slide
switch to the next slide
manually switch slide
Parameters
-
-
index of the slide to be switched to, starting from 0;
Basic usage
Transition
Buildin transition More
{ "name": "default" } { "name": "windowslice" } { "name": "directionalwrap" }
gl-transition More
you can use gl-transition's effet directly'
Custom transition More
buildin uniform: progress(0-1), next(boolean, true: next, false: prev)
Example:
{
  "shader": `
    uniform float count; // = 10.0
    uniform float smoothness; // = 0.5
    vec4 transition (vec2 p) {
      float pr = smoothstep(-smoothness, 0.0, p.x - progress * (1.0 + smoothness));
      float s = step(pr, fract(count * p.x));
      return mix(getFromColor(p), getToColor(p), s);
    }
  `,
  "uniforms": {
    count: 10,
    smoothness: 0.5,
  },
}