5. Creating Scenes / Slides
You have to define an element of class .sven-slide and a unique id (scene-1, scene-2, scene-3, etc.,) into the teaser element as in the following example.
You can add multiple scenes in the same way.
6. Configuring Scenes / Slides
You can change the properties of a scene / slide with the help of a list of data-* attributes. all attributes are optional.
Here is the complete list of scene options(data-* attributes)
| Options | Values | Defaults | Description |
|---|---|---|---|
| data-scene-image | 'image_url' | Not set | Sets the background image for the scene / slide. |
| data-mobile-image | 'image_url' | Not set | Sets the background image for the scene / slide specially for mobiles. |
| data-pursue-image | 'yes' 'no' |
'no' | If set to "yes", the image is inherited by the successor scenes no matter what. It works only when preloadScenes set to true. |
| data-alignment | 'right-top' 'right-bottom' 'right-center' 'left-top' 'left-bottom' 'left-center' 'center-top' 'center-bottom' 'center-center' |
'center-center' | Sets the position of the animation plane on all screens. The styling of these position presets are defined in sven-teaser.css. |
| data-mobile-alignment | 'right-top' 'right-bottom' 'right-center' 'left-top' 'left-bottom' 'left-center' 'center-top' 'center-bottom' 'center-center' |
NOT SET | Sets the position of the animation plane on mobile screens. If this is not defined, it will be same as data-alignment attribute. |
| data-freeze-time | 'default' (number) |
'default' | The freeze(pause) duration (in seconds) between the 'in' animation and 'out' animation of each scene. If set 'default', the content stays for the duration as defined in our code which is quite optimal. |
| data-scene-dur | 'default' (number) |
'default' | The duration of the whole scene can be set through this attribute. data-scene-dur is nothing but the addition of 'data-in-dur', 'data-out-dur', 'data-freeze-time'. If this property is set, the values of 'data-in-dur', 'data-out-dur' and 'data-freeze-time' will be ignored. |
| data-trans | transitions list | 'none' | The transition to be showed before the scene. There are only a few options here. More to be updated soon. |
| data-mobile-trans | transitions list | 'none' | The transition to be showed before the scene only on mobiles & tablets. There are only a few options here. More to be updated soon. |
| data-trans-dur | 'default' (number) |
'default' | The duration of the transition can be set through this attribute. This property doesn't apply to data-trans "none". |
Scene Video Options
| Options | Values | Defaults | Description |
|---|---|---|---|
| data-scene-video | 'video_url' | Not set | Sets the background video for the teaser. It can be either local video_url(html5) or youtube video id as follows eg: "video/static-video.mp4" (or) "1VwZ1tnDZbs" |
| data-pursue-video | 'yes' 'no' |
'yes' | If set to "yes", the video is inherited by the successor scenes no matter what. |
| data-video-type | 'html5' 'youtube' |
'html5' | The type of background video to be used in the teaser needs to be set through this attribute. |
| data-video-mute | true false |
true | Mute the audio on the background video. |
| data-video-quality | 'default' 'small' 'medium' 'large' 'hd720' 'hd1080' 'highres' |
'highres' | The background video's quality can be set through this attribute. This applies only to youtube video. |
| data-video-start | (number) | 0 | Set the seconds the background video should start at. |
| data-video-stop | (number) | 0 | Set the seconds the background video should stop at. If "0", it's ignored. |
| data-video-loop | true false |
true | loops the background video indefinitely if set true. If set false, the video stops after it finishes playing its duration. |
| data-auto-stop-video | true false |
false | stops the background video when the teaser ends. |
Content Timings & Patterns (Advanced)
| Options | Values | Defaults | Description |
|---|---|---|---|
| data-cin-order | 'sync' 'delayed' 'onebyone' |
'onebyone' | The timing at which each line of text starts "in" animation if multiple lines of text found inside ".content-container". sync - all lines of text start animating at the same time. delayed - A small delay be introduced (thru data-cin-delay)at start of each line animation.(except for the first line) onebyone - The animation works one after the other |
| data-cin-delay | (number) | 0.25 | The delay(in seconds) with which each line starts "in" animation if data-cin-order is set to "delayed". |
| data-cout-order | 'sync' 'delayed' 'onebyone' |
'onebyone' | The timing at which each line of text starts "out" animation if multiple lines of text found inside ".content-container". sync - all lines of text start animating at the same time. delayed - A small delay be introduced (thru data-cout-delay)at start of each line animation.(except for the first line) onebyone - The animation works one after the other |
| data-cout-delay | (number) | 0.25 | The delay(in seconds) with which each line starts "out" animation if data-cout-order is set to "delayed". |
| data-cin-pattern | 'sequential' 'reverse' 'random' 'median' 'reverse-median' |
'sequential' | The pattern at which each line starts "in" animation if multiple lines of text found inside ".content-container". |
| data-cout-pattern | 'sequential' 'reverse' 'random' 'median' 'reverse-median' |
'reverse' | The pattern at which each line starts "out" animation if multiple lines of text found inside ".content-container". |
7. Adding scene contents
You can add text content to a scene as seen in the example below. Check contents(h1 tags) wrapped inside content-container. It may contain single line of text (or) multiple lines of text as in the example below.
You can also add your own styling class in main.css for each text placeholder instead of lt-main and lt-sub.
8. Configuring scene contents
You can add a few data-* attributes directly to the scene text placheolders(h1 tags) as in the following example.
Here is the complete list of content options(data-* attributes).
| Options | Values | Defaults | Description |
|---|---|---|---|
| data-align | 'left' 'right' 'center' |
Not set | Positions the text to left, right or center within the content-container |
| data-box-type | 'contain' 'full' |
'contain' | This property doesn't apply to the main text. It affects only the subtitle text placeholder(.lt-sub in our example). It decides whether the box in the background stretches to full width of the content-container or contains to the text width. |
| data-sin | animations | {"animation": "fade-in"} | The "in" animation to be applied to the content. |
| data-sout | animations | {"animation": "fade-out"} | The "out" animation to be applied to the content. |
9. Animations
Here is the list of basic animations available.
Here is the list of rotator animations available. (only one of the following is used in FIDES template)
if you know the basics of GSAP library and JS, you could get how the animations work and could create new animations.
10. List of Transitions
Here is the list of transitions available.