Custom Parallax

Create a parallax effect on any element with various triggers

Overview

Parallax effects are still very popular. The most of them make use of page scrolling, but with Torus Kit you can also attach the parallax effect to mouse cursor movement or even to device sensor orientation.

Syntax

To create a parallax effect add data-tor-fx="<trigger>:@parallax(<amount>) to your desired element. Where <amount> is the integer and represents the strength of parallax effect. The bigger the <amount> the bigger the element’s parallax movement.

Examples

scroll

Attach parallax effect to page scroll by adding data-tor-fx="scroll:@parallax(<amount>)" to desired element.

Scale
Rotate
Translate
<div data-tor-fx="scroll:@parallax(5)">Scale</div>
<div data-tor-fx="scroll:@parallax(20)">Rotate</div>
<div data-tor-fx="scroll:@parallax(50)">Translate</div>

mouse

Create parallax effect when moving the cursor over both x and y axis by using data-tor-fx="mouse:@parallax(<amount>)".

Scale
Rotate
Translate
<div data-tor-fx="mouse:@parallax(5)">Scale</div>
<div data-tor-fx="mouse:@parallax(20)">Rotate</div>
<div data-tor-fx="mouse:@parallax(50)">Translate</div>

mouseX

Create parallax effect when moving the cursor over x axis by using data-tor-fx="mouseX:@parallax(<amount>)".

Scale
Rotate
Translate
<div data-tor-fx="mouseX:@parallax(5)">Scale</div>
<div data-tor-fx="mouseX:@parallax(20)">Rotate</div>
<div data-tor-fx="mouseX:@parallax(50)">Translate</div>

mouseY

Create parallax effect when moving the cursor over y axis by using data-tor-fx="mouseY:@parallax(<amount>)".

Scale
Rotate
Translate
<div data-tor-fx="mouseY:@parallax(5)">Scale</div>
<div data-tor-fx="mouseY:@parallax(20)">Rotate</div>
<div data-tor-fx="mouseY:@parallax(50)">Translate</div>