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 AliExpress Reviews Widget

By Common Ninja

AliExpress ReviewsTry 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.

AliExpress Reviews for Wordpress logo

AliExpress Reviews

Show AliExpress reviews to build trust, improve credibility, and help visitors make confident purchase decisions that support higher sales.

Lottie Player for Wordpress logo

Lottie Player

Use a Lottie player to embed lightweight JSON animations that improve visual design, keep pages fast, and create a smoother user experience.

Threads Feed for Wordpress logo

Threads Feed

Show Threads posts in a live feed that keeps content fresh, builds social proof, and helps visitors engage on your site.

Facebook Reviews for Wordpress logo

Facebook Reviews

Show Facebook reviews to build trust, improve credibility, and help visitors make confident purchase decisions that support higher sales.

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.

WhatsApp Chat for Wordpress logo

WhatsApp Chat

Add WhatsApp Chat to your site to communicate with visitors, deliver instant support, and create a smoother, more trustworthy user experience.

Company Branch Flip Cards for Wordpress logo

Company Branch Flip Cards

Display locations with company branch flip cards that help customers find nearby offices, understand key details, and enjoy a smoother overall experience.

X Feed for Wordpress logo

X Feed

Show posts in an X feed that keeps updates visible, improves content discovery, and helps visitors stay engaged with your latest activity.

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.

Feedback Popup for Wordpress logo

Feedback Popup

Collect user insights with a feedback popup that reveals issues early, improves user experience, and captures valuable leads through a clear feedback form.

Slide-In Panel for Wordpress logo

Slide-In Panel

Slide in panel that appears from the top or bottom to highlight offers, capture attention, and guide visitors toward more conversions.

Google Reviews for Wordpress logo

Google Reviews

Show verified customer feedback with Google Reviews to build trust, strengthen credibility, and help visitors make confident purchase decisions.

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