Custom Scale

Scale the element in horizontal and vertical direction based on user interaction

Overview

Scale effect will resize the element using CSS scaleX and scaleY property.

Syntax

Use data-tor-fx="<trigger>:@transform.<scaleX|scaleY|scaleZ>(<start>;<end>) to scale the element over x or y axis. The <start> value represents the beginning scale value, while the <end> is the finish value.

Examples

The <mouse> examples uses __origin(start) for more natural behavior. Try to move the cursor from the screen top-left corner into the bottom-right, the left edge to the right one, and from the top edge into the bottom.

scroll

To scale the element when scrolling the page, use data-tor-fx="scroll:@transform.<scaleX|scaleY|scaleZ>(<amount>)".

scaleX
scaleY
<div data-tor-fx="mouse:@transform.scaleX(0;1)">scaleX</div>
<div data-tor-fx="mouse:@transform.scaleY(0;1)">scaleY</div>

mouse

To scale the element when moving the cursor over both x and y axis, use data-tor-fx="mouse:@transform.scaleX(<amount>)" for horizontal scale and data-tor-fx="mouse:@transform.scaleY(<amount>)" for vertical scale.

scaleX
scaleY
<div data-tor-fx="mouse:@transform.scaleX(0;1)__origin(start)">scaleX</div>
<div data-tor-fx="mouse:@transform.scaleY(0;1)__origin(start)">scaleY</div>

mouseX

To scale the element when moving the cursor over x axis, use data-tor-fx="mouseX:@transform.<scaleX|scaleY|scaleZ>(<amount>)"

scaleX
scaleY
<div data-tor-fx="mouseX:@transform.scaleX(0;1)__origin(start)">scaleX</div>
<div data-tor-fx="mouseX:@transform.scaleY(0;1)__origin(start)">scaleY</div>

mouseY

To scale the element when moving the cursor over y axis, use data-tor-fx="mouseY:@transform.<scaleX|scaleY|scaleZ>(<amount>)"

scaleX
scaleY
<div data-tor-fx="mouseY:@transform.scaleX(0;1)__origin(start)">scaleX</div>
<div data-tor-fx="mouseY:@transform.scaleY(0;1)__origin(start)">scaleY</div>