Built in Block reveal

Create a block revealing 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 with color block animation. The element itself is hidden and stays in the original place, only the block is animated. When the effect is not triggered, 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 block revealing effect on heading title. Made with block.right, __bg(<color>) block color modifier and delay(<value>). This example also uses hover-fix helper that prevents browser from applying a :hover immediately after page load. This causes weird behavior on some browsers that applies a :hover state on parent element, but not on it’s pseudo-element.

Hover me

Block reveal effect made super easy with Torus Kit

CSS block effect example
<div data-tor-parent="hover hover-fix">
  <h2 data-tor-group="span => hover(p):block(right, {bg: white}) exponential delay(/+100ms/);">
    <span class="d-block">Clipping effect</span>
    <span class="d-block">made super easy</span>
    <span class="d-block">with Torus Kit</span>
  </h2>
</div>

Triggers

To create a block reveal effect when <trigger> is performed on a single element, use data-tor-fx="<trigger>:block.<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 block reveals upwards from bottom to top
  • down block reveals downwards from top to bottom
  • left block reveals from the right to the left
  • right block 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.

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

Parent trigger

To create a block reveal effect 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>:block.<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 block reveals upwards from bottom to top
  • down block reveals downwards from top to bottom
  • left block reveals from the right to the left
  • right block reveals from the left to the right
block(up)
block(right)
block(down)
block(left)
<div data-tor="hover(p):block(up)">block(up)</div>
<div data-tor="hover(p):block(right)">block(right)</div>
<div data-tor="hover(p):block(down)">block(down)</div>
<div data-tor="hover(p):block(left)">block(left)</div>
block(up)
block(right)
block(down)
block(left)
<div data-tor="active(p):block(up)">block(up)</div>
<div data-tor="active(p):block(right)">block(right)</div>
<div data-tor="active(p):block(down)">block(down)</div>
<div data-tor="active(p):block(left)">block(left)</div>
block(up)
block(right)
block(down)
block(left)
<div data-tor="inview(p):block(up)">block(up)</div>
<div data-tor="inview(p):block(right)">block(right)</div>
<div data-tor="inview(p):block(down)">block(down)</div>
<div data-tor="inview(p):block(left)">block(left)</div>

Modifications

Block color

Add {bg: <color>} modification to change the block’s background color. The default color is black, but you can add the one from theme colors or a custom one.

Default block color
White block color
Primary block color
Custom block color
<div data-tor-parent="hover">
  <div data-tor="hover(p):block(right)">Default block color</div>
  <div data-tor="hover(p):block(right, {bg: white})">White block color</div>
  <div data-tor="hover(p):block(right, {bg: primary})">Primary block color</div>
  <div data-tor="hover(p):block(right, {bg: #32a680})">Custom block color</div>
</div>

Combining effects

Combine the several effects and modifiers to create new ones.

Clipping effect made super easy with Torus Kit

CSS clip effect example