Hi, I'm Spicr!

Modern content showcase plugin

Spicr is a freemium content showcase component featuring multi-layer slider and carousel, and is powered by KUTE.js for hardware accelerated and super smooth animations.

Solid build and easy to use

The HTML markup required is familiar and straight forward, it alows you to set all your slider animation settings via DATA API. No coding knowledge required, no need for CSS3 transitions.

ES6/ES7 and SCSS Sources

The component was developed on ES6/ES7 JavaScript standard for the modern web and comes packed with solid build tools. The SCSS sources provide the basic layout design for flexible design.

Likes most browsers

Thanks to KUTE.js, Spicr has some built in functions to provide smooth translate, rotate, scale and opacity transitions on modern browsers. Thanks to polyfills and custom builds, Spicr supports most legacy browsers.

High performance

Also thanks to KUTE.js, Spicr delivers at least 60 frames per second animations on modern browsers. All that powered by modern, clean, modular and high performance JavaScript code, developed for scalable and snappy applications.

What's crazy about it?
IT IS FREE!

That's right! Spicr is licensed under MIT License and this means you can use it for both personal and commercial purpose as long as you show proper credits to the original author. Yey!

Spicr Features

Built on ES6/ES7 JavaScript standard

Spicr was developed with native JavaScript and does not depend on JavaScript libraries like jQuery, Zepto or anyother, except KUTE.js.

Smooth transitions

Thanks to our very own KUTE.js, a flexible and powerful animation engine, Spicr can deliver smooth transitions with high frame rate.

Great browser support

Thanks to the flexibility of Spicr, KUTE.js and polyfills available, you can do a lot more to showcase content even with IE9.

Multiple use focus

When using proper classes and the right markup, you can do full width sliders, carousels, newslines, tabs, all with minimal scripting.

Works with popular CSS frameworks

Spicr is a fork of our own Carousel for Bootstrap, inheriting it's basic prototype and required markup, but providing and a wide range of animation options.

Comes with SCSS sources

Spicr comes with SCSS source so you can quick&easy adapt the styling to your project. Also there are a set of variables you can play with, just to get things right.

Powerful DATA API

All animation, easing, control is handled by powerful API system.

Developer friendly license

Spicr is released under MIT License.



Spicr Slider

The slider functionality is designed to showcase more media content rather than text content, and its functionality is geared towards wide screens, with animation control for any and all content items. You can use what ever markup structure you want, make use of any content classes you see fit, the component's layout design has no limitation, except it must always have the same height for its items.

As previously stated, the animation settings are set to the .spicr-layer Elements individually, and they apply to the animation when coming into view, however, on coming out of view, they use the settings of the next .item-bg Element to create a seamless transition. If the next background is not found, or it doesn't have the .spicr-layer class, the layers animating out of view will use their own animation settings.

Slider Basic Markup

The very first example on this page is a .spicr-slider instance, showcasing some of the component capability. The basic slider markup is designed to be simple, effective and allow for maximum content flexibility:

<!-- spicr-slider basic markup -->
<div data-function="spicr" class="spicr spicr-slider" data-interval="false" data-touch="false">
  <div class="spicr-inner">
    <div class="item active">
      <!-- item content -->
    </div>
    <div class="item">
      <!-- item content -->
    </div>
  </div>
  <!-- pages navigation -->
  <ol class="spicr-pages">
    <li data-slide-to="0" class="active"></li>
    <li data-slide-to="1"></li>
  </ol>
  <a class="left spicr-control" data-slide="prev"></a>
  <a class="right spicr-control" data-slide="next"></a>  
</div>	

Markup breakdown and attribute specifications:

  • The data-function="spicr" attribute enables the Spicr automatic initialization for your Element.
  • The .spicr-slider class dictates how the layer animation works. This means that the animation DATA API is expected from all .spicr-layer Elements. If no .spicr-layer element is found, the component will still go to the next item.
  • The first <div class="item"> must always be active, which means having the active class or else Spicr will animate its layers and make it active on initialization.
  • The slider instance expects to use a fixed height for its items and a flexbox container for their contents, but you can override anything with classes from other HTML frameworks like Bootstrap or Foundation, as the Spicr component itself doesn't include this kind of styling in its default CSS files.
  • Generally the .spicr-slider instance knows it must animate first a background .item-bg.spicr-layer Element if found, then other content items with .spicr-layer class.
  • The first element of the <div class="spicr-pages"> must be active, means having the active class.
  • The data-interval is either false or an integer number, the default value is 5000ms.
  • The data-touch is either true or false, the default value is true.
  • The .spicr-pages Element or .spicr-control Elements provide navigation to your initialization, first allows users to jump to a certain item and the second allows the user to slide items back and forth. At least one of the two is recommended to be used so that users can have a way to interact and read the desired content. This is where you can get very creative.

Slider Item Markup

The following markup is a sample slider .item:

<div class="item active">
  <!-- this is the background layer -->
  <div class="item-bg spicr-layer" style="background-image: url(..);"
       data-scale="1.5" 
       data-duration="700" data-easing="easingCubicOut"></div>
  <!-- you can use any container -->
  <div class="container">
    <!-- you can also use a flexbox container -->
    <div class="d-flex align-items-center h-100 perspective">
      <!-- this is the the content spicr-layer, with some sample settings -->
      <div class="spicr-layer" 
           data-translate="y:250" data-rotate="z:15" 
           data-duration="800" data-delay="200" data-easing="easingBackOut">
        <!-- valid HTML goes here -->									  
      </div>
    </div>
  </div>
</div>

Markup breakdown and attribute specification:

  • The .item-bg is for background for your item, it can also become an animation layer by adding the spicr-layer class and automatically works with animation options set via DATA API. The background layer is not animating out, for performance reasons.
  • As shown in the above sample code, you can use any container for your content and layers, while for the first parent of each layer you can also set a perspective class, in case your layer needs to animate 3D transform functions.
  • As suggested by the above sample code, the item markup is not constrained by any rule, you can use any container, flexbox, alignment, etc. Anything you need to create a nice visual experience.
  • The .spicr-layer contained can use any and all the above DATA API options to set animation.

Slider Example

Based on the above sample codes, let's have a quick demo:

Translation

This item can do translations.

Rotation

This item can do rotations.

No animation set

This item has no settings, it will only fade.

Disabled all animations

This item has layers but all use the data-opacity="false" attribute.

No layer

This item has no layer.

No background

This item has no background.

« »

For this demo we've bypassed the default $slider-height:600px; by using a h-100 class for the <div class="item"> and other wrappers and set a fixed height of 33vh to the target <div class="spicr-slider"> Element. The demo also showcases how the .spicr-slider instance handles various cases of incomplete settings or incorrect markup without crashing or any error.

If you inspect the markup demo you will also discover other gems like flexbox, alignments, spacing and other goodies.


The carousel functionality is different in many ways, first of all, it was designed to deal with text-content, text blocks and handles the layer animation the same for all layer, except when a delay is set, it will produce a stagger effect. The Usage Section of this page is a carousel instance.

When the current active and the next active item have different heights, the carousel instance will make a nice transition from the current height to the height of the next active item. For this reason, the default overflow of the .spicr-carousel is hidden, but you can override that too, as we will see in a later example.

The required markup to create a carousel is similar but the animation DATA API apply to the target Element itself, so let's have a look:

<!-- spicr-carousel basic markup -->
<div class="spicr spicr-carousel" data-function="spicr" data-interval="false" data-touch="false"
     data-duration="700" data-delay="200" data-easing="easingCircularInOut" 
     data-translate="x:100%" data-rotate="x:90">
  <div class="spicr-inner">
    <div class="item active">
      <!-- item content -->
    </div>
    <div class="item">
      <!-- item content -->
    </div>
  </div>
  <!-- pages navigation -->
  <ol class="spicr-pages top-right">
    <a data-slide="prev"></a>
    <a data-slide="next"></a>
  </ol>
</div>	

Markup breakdown and attribute specifications:

  • The data-function="spicr" attribute enables the Spicr automatic initialization for your Element.
  • The .spicr-carousel class dictates how the layer animation works. This means that the animation DATA API is expected from the target .spicr-carousel Element and apply to all child .spicr-layer Elements. If no .spicr-layer element is found, the component will still go to the next item.
  • The .spicr-carousel Element uses all DATA API attributes, but the coordinates for translation and transform-origin are based on each individual layer.
  • The first <div class="item"> must always be active, which means having the active class or else Spicr will animate its layers and make it active on initialization.
  • The data-interval is either false or an integer Number, the default value is 5000ms.
  • The data-touch is either true or false. For .spicr-carousel instances this option can be disabled to avoid confusing the user. The default value is true.
  • The <div class="spicr-pages"> can use either elements with data-slide-to="Number" attribute or the data-slide="next/prev" attribute or both types as we will see in an example soon. In addition, the component provides positional classes like bottom-left or top-right to be used for your carousel instance navigation.

Remember that carousel expects to animate more text content rather than media, in the examples below we're going to try and showcase the best use cases. OK now it's time to take a look at a sample carousel item markup.

<div class="item active">
  <!-- you can use any container -->
  <div class="container perspective">
    <!-- this is the the content spicr-layer, with some sample settings -->
    <div class="spicr-layer">
      <!-- valid HTML goes here -->
    </div>
  </div>
</div>

Markup breakdown and attribute specifications:

  • The .spicr-layer doesn't have any DATA API attributes, but will inherit them all from the parent .spicr-carousel Element.
  • You can again use any type of markup structure you want, flexbox or not, but remember it's main functionality.

Example breakdown:

  • As the title of the first item suggests, this example uses no animation setting, and even disables the opacity transition via the data-opacity="false" attribute. This is to verify the component's reliability in various scenarios, when no transition is set, no layer is found and most importantly no error in the console.
  • In this demo we've used the top-right position class for the <div class="spicr-pages"> Element.
  • The component provides basic styling for icons to be used for the <div class="spicr-pages"> elements, the .spicr-icon class.

Example breakdown:

  • This example showcases a basic, classic horizontal slide animation via the data-translate="x:100%" attribute.
  • For this demo we've also removed the opacity transition via the data-opacity="false" attribute.
  • This is a case where you want to keep the overflow: hidden for your .spicr-carousel Element.

Example breakdown:

  • For these two demos we've set a different overflow via the overflow-visible class, for better visual presentation.
  • This first example showcases a cube animation with the data-rotate="y:90" and data-transform-origin="z:-50%" attributes, the animations looks like the items form a cube in front of the viewer.
  • This second example showcases a cube animation with the data-rotate="x:90" and data-transform-origin="z:50%v" attributes, the animation looks like the items form a cube around the viewer.
  • For this kind of setup you might want to use a fixed height, a vw based line-height for your .spicr-carousel items or a combination of both, to make sure they always have the same size to produces a consistent animation.

Example breakdown:

  • This demo showcases how the component works with the data-delay attribute on a multi-layer .spicr-carousel Element. It creates a stagger effect back and forth depending on the slide direction.
  • The data-rotate="y:90" and data-transform-origin="z:-50%" attributes set on the target Element are determined based on each .spicr-layer individually.
  • This demo should also highlight the height transition as items of the .spicr-carousel Element don't have equal height.

Spicr Quirks

  • The Spicr default distribution file spicr.min.js is compatible with the default KUTE.js distribution file kute.min.js which includes the transformFunctions component, one of the many combinations for modern browsers.
  • Spicr comes with a special custom build which incudes a custom-built KUTE.js, the spicr-standalone.min.js file, one of the default distribution files also geared towards modern browsers.
  • On initialization, Spicr will check the target Element class, contents and attributes of the target and child elements and animate first <div class="item"> if it doesn't have the active class.
  • Spicr will not update transform-origin on window resize, but will recalculate it on the next cycle.
  • Depending on the attributes specific for its DATA API, Spicr will process all your attributes' values and feed KUTE.js with pre-processed values for immediate tween initialization.
  • The Spicr component will attach the initialization object to the target into the element.Spicr object, giving you access to the initialization object even for DATA API initialized targets.
  • There are a set of standalone versions that include custom KUTE.js builds (also tons of build options) just in case you want to use KUTE.js exclusively with Spicr or other animations, but you can go either way.
  • For various builds and compatibility requirements, Spicr comes with a series of value processing specific to each KUTE.js build (included or not) to make sure the values are exactly what your chosen KUTE.js components expect.
  • Reinitializing the Spicr for a specific target just to change options should work fine, but will disrupt any and all active animations.
  • Another standalone build is designed to support IE9+ browsers and uses the new and improved KUTE.js transformLegacy component and is called spicr-standalone-legacy.js.
  • When building a legacy custom build, you also have the polyfill that covers support for IE9+ browsers, a build file called polyfill-legacy.js.
  • This very demo page works on IE9+ and uses the spicr-standalone-legacy.js mentioned above and some special fallbacks have been developed for various content items, mainly grid and flexbox.
  • The component doesn't support nested Spicr initializations.

Powered by KUTE.js

KUTE.js is a modern animation engine, which combined with Spicr, can deliver awesome user experiences on a wide range of browsers.

More on KUTE.js »

Developer Wiki

For more information on custom builds, legacy support and other developer information, don't forget to check the wiki.

Spicr Wiki »

Other Resources