Change class in viewport: create animations with pure CSS

Change class in viewport: create animations with pure CSS

Wordpress plugin

Install on Wordpress

App Details

When a specific element of the page enters the viewport, it adds the CSS class “in-viewport” to that element.

When the same element goes out from the viewport it remove the CSS class “in-viewport” and adds the class “not-in-viewport”.

To target the elements, you just need to assign them the CSS class “cciv-el”.

It’s useful to add your custom animations on scroll just with a few lines of CSS.

This is a plugin for CSS developers who want to add simple but effective animation only with pure CSS.

In case the user disables JavaScript, the body of the page will have the CSS class “cciv-no-script”. Use it to don’t show strange things when JavaScript is disabled.

The plugin is ultra light. It adds a few lines of pure JavaScript code in the footer and nothing else.

No additional HTTP requests, no additional queries to the database.

If you measure the performance with or without this plugin, you will not notice any difference.

This plugin is useful if:

  • You know how to create an animation in pure CSS.
  • You have the possibility to assign a CSS class to the element you want to animate.
  • You have the possibility to add your custom CSS.

With the following few lines of pure CSS for example you can create a rotation effect.

.cciv-el{transition: 2s transform ease}
.cciv-el.in-viewport{transform:rotateY(0deg)}
.cciv-el.not-in-viewport{transform:rotateY(180deg)}
.cciv-no-script .cciv-el{transform:none !important}

You can read more about CSS animations and transitions on W3Schools:
https://www.w3schools.com/css/css3_animations.asp
https://www.w3schools.com/css/css3_transitions.asp

You can change the selector to target the elements that you want to animate using the filter ‘cciv_el_selector’.
If for example instead of the CSS class .cciv-el you want something specific to your case, you can add this code in the functions.php of your child theme if any, or in a functional plugin:

add_filter( 'cciv_el_selector','my_cciv_selector' ); function my_cciv_selector( $selector ){ return '#my-custom-id .my-custom-class'; //The elements will not be target anymore by .cciv-el but by what you specify here } 

Don’t lose time any more with heavy jQuery effects, you need just a few lines of CSS, the rest is given by this plugin using few lines of 100% pure JavaScript inlined in the footer.

No performance loss, and no time loss if you have CSS skills.

Pricing

Starting from $0 per month.

Check Out the Video Gallery Widget

By Common Ninja

Video GalleryTry For Free!

App Info

Rating

Reviewers

1 reviews

Tags

animations
css effects

Developed By

Jose

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Forms

Forms plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Comments

Comments plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Maps

Maps plugins for Wordpress

Security

Security plugins for Wordpress

Translation

Translation plugins for Wordpress

Ads

Ads plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Chat

Chat plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Membership

Membership plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Contact

Contact plugins for Wordpress

Comments

Comments plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

Video Gallery for Wordpress logo

Video Gallery

Showcase videos with a video gallery that organizes clips from multiple sources in clear visual layouts that keep visitors watching and support higher conversions.

Image Hotspot for Wordpress logo

Image Hotspot

Add interactive image hotspots to your site to turn static visuals into clickable guided experiences that improve engagement.

Facebook Feed for Wordpress logo

Facebook Feed

Show Facebook posts in a live Facebook feed that keeps content fresh, boosts social proof, and helps visitors engage more with your brand.

Strip Button for Wordpress logo

Strip Button

Add a Stripe Button to your website to give customers a fast, trusted checkout experience.

Video Slider for Wordpress logo

Video Slider

Showcase clips with a video slider that plays videos from multiple sources in a smooth slideshow, improving design and keeping visitors engaged.

Currency Converter for Wordpress logo

Currency Converter

Add a currency converter to your site so users can view equivalent values in their local currency for easier global access.

Medium Feed for Wordpress logo

Medium Feed

Show Medium articles in a Medium feed that keeps content fresh, improves readability, and helps visitors discover more posts.

Linkedin Feed for Wordpress logo

Linkedin Feed

Show LinkedIn posts in a live feed that keeps updates current, builds credibility, and helps visitors engage with your brand.

Scroll to Element Button for Wordpress logo

Scroll to Element Button

Scroll to element button that improves navigation by letting visitors jump directly to key sections, reducing friction and boosting overall engagement.

Leaderboard for Wordpress logo

Leaderboard

Add a customizable leaderboard to your site to display rankings, track scores, and encourage friendly competition.

Social Proof for Wordpress logo

Social Proof

Show social proof that displays real user activity to build trust instantly, boost credibility, and help increase conversions across your site.

Announcements for Wordpress logo

Announcements

Add announcements to your site to share important updates, keep visitors informed, and guide them toward actions that support engagement and conversions.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms