Built in Clipping

Create a clip effect animation on any element, image or text

Overview

This effect hides an element by clipping it using CSS clip-path and reveals it when trigger is performed. The element itself stays in the original place, only the clip is animated. When the element is cliped, the clipping box has a 0% height or width and the element is entirely hidden without any possible user interaction such as hover or focus.

Example

Example of gradual cliping effect on heading title. Made with clip(right) and delay(<value>).

Hover me

Clipping effect made super easy with Torus Kit

CSS clip effect example
<div data-tor-parent="hover">
  <h2>
    <span class="d-block"><span data-tor="hover(p):clip(right) exponential">Clipping effect</span></span>
    <span class="d-block"><span data-tor="hover(p):clip(right) exponential delay(100ms)">made super easy</span></span>
    <span class="d-block"><span data-tor="hover(p):clip(right) exponential delay(200ms)">with Torus Kit</span></span>
  </h2>
</div>

Triggers

To animate the clip when <trigger> is performed on a single element, use data-tor-fx="<trigger>:clip.(<direction>) where <trigger> is:

  • inview: - when element appears in the viewport and gets .inview class
  • active: - when element gets .active class
  • show: - when element gets .show class false

And the <direction> one of the:

  • up clip reveals upwards from bottom to top
  • down clip reveals downwards from top to bottom
  • left clip reveals from the right to the left
  • right clip reveals from the left to the right

Because the clip-path hides entire element, it doesn't respond to user hover interaction. This is why hover: (hover) trigger is not available.

clip(up)
clip(right)
clip(down)
clip(left)
<div data-tor="active:clip(up)">clip(up)</div>
<div data-tor="active:clip(right)">clip(right)</div>
<div data-tor="active:clip(down)">clip(down)</div>
<div data-tor="active:clip(left)">clip(left)</div>
clip(up)
clip(right)
clip(down)
clip(left)
<div data-tor="inview:clip(up)">clip(up)</div>
<div data-tor="inview:clip(right)">clip(right)</div>
<div data-tor="inview:clip(down)">clip(down)</div>
<div data-tor="inview:clip(left)">clip(left)</div>

Parent trigger

To animate the clip of a single or multiple child elements when <trigger> is performed on a parent element, add data-tor-fx-trigger="<inview|active|show|hover> to indicate that this is a parent element with the desired trigger - if this parent trigger is performed, child elements will be affected (will change)

Than add data-tor-fx="<trigger>:clip.(<direction>) attribute to child elements where <trigger> is:

  • inview(p): - when .inview class is applied on Parent trigger element, because it's visible in the viewport
  • active(p): - when .active class is applied on Parent trigger element
  • show(p): - when .show class is applied on Parent trigger element
  • hover(p): - when hover state is applied on Parent trigger element

And the <direction> one of the:

  • up clip reveals upwards from bottom to top
  • down clip reveals downwards from top to bottom
  • left clip reveals from the right to the left
  • right clip reveals from the left to the right
clip(up)
clip(right)
clip(down)
clip(left)
<div data-tor="hover(p):clip(up)">clip(up)</div>
<div data-tor="hover(p):clip(right)">clip(right)</div>
<div data-tor="hover(p):clip(down)">clip(down)</div>
<div data-tor="hover(p):clip(left)">clip(left)</div>
clip(up)
clip(right)
clip(down)
clip(left)
<div data-tor="active(p):clip(up)">clip(up)</div>
<div data-tor="active(p):clip(right)">clip(right)</div>
<div data-tor="active(p):clip(down)">clip(down)</div>
<div data-tor="active(p):clip(left)">clip(left)</div>
clip(up)
clip(right)
clip(down)
clip(left)
<div data-tor="inview(p):clip(up)">clip(up)</div>
<div data-tor="inview(p):clip(right)">clip(right)</div>
<div data-tor="inview(p):clip(down)">clip(down)</div>
<div data-tor="inview(p):clip(left)">clip(left)</div>

Modifications

Skew

Add {skew: <value>} option to clip(<direction>) effect to create a skewed reveal.

Skew SM
Skew MD
Skew LG
<div data-tor-parent="hover">
  <div data-tor="hover(p):clip(right, {skew: 10px}) slowest">Skew SM</div>
  <div data-tor="hover(p):clip(right, {skew: 3rem}) slowest">Skew MD</div>
  <div data-tor="hover(p):clip(right, {skew: 5rem}) slowest">Skew LG</div>
</div>