Cool animations and clever microinteractions are all the rage right now. However, most developers know how long and tedious it can be to constantly write and rewrite CSS animations. It can start to feel like you're reinventing the wheel. Wouldn't it be nice to have a library of common animations that you can pull from anytime for any of your projects?
Statcounter provides customisable hit counters, visitor tracking, web analytics and website stats for Tumblr. Sign up for an account at Statcounter to get your code. These instructions will be repeated after you've created an account and added your first project. Apr 02, 2019 Adding a pre-built counter. If you prefer to add a pre-built counter to your web page, here are a few ways to do so. Check with the web host for your web page. Often the company hosting your web page offer free solutions and provide instructions on how to add the counter code to your web page.
Enter Animate.cssA collection of 'just-add-water CSS animations' created by Daniel Eden
With Animate.css, you can easily animate any element with only one line of code. But, if you need to get a little more fancy, it also offers quite a few customization options. In this tutorial, we'll learn how to use Animate.css by building a one page website. Let's get started!
There are two ways to get up and running with Animate.css. The first way is to download it from the official website. Once you've done this, all you have to do is add it to your project folder and link to it in your HTML.
*Note: Animate.css contains only one file! This minimizes load time and keeps everything simple.*
The second option for getting started is to use a CDN. You can find this here. Once you've got it, you can link to it just like before:
And, that's it! No more setup is necessary to begin using all the awesome animations that come with Animate.css. All we have to do now is add some water..
The first thing we will do is a simple static animation that activates right when the page loads. Obviously, this animation will have to be at the top of the page - unless it repeats over and over. So, we'll start off with a full screen hero element and animate the text inside when the page is loaded. Here's the basic HTML we need:
Now, all we need to do to animate the two headings is give them the
bounceInDown classes. The first class is necessary to use any Animate.css animation. But, the second class is just one of many options we could use here. The official Github docs have a full list of animations you can use.
This is nice, but we can definitely expand on it. Let's add an arrow at the bottom of our hero that bounces continuously to let the user know they can scroll down. We'll give this element two classes:
As we have it right now, this animation will only happen once. However, there are three CSS properties you can use to control this animation. They are:
For our purposes, we only need to use the first and the third to slow down the animation and make it infinite. Thus, our final markup for the first section look's like this:
*Note: Most of the CSS in these examples has been omitted for the sake of clarity. Check out the full demo for the arrow styles, etc.*
And, here's the CSS that makes the magic happen ad infinitum:
And, here's a pen showing it all in action:
As you can see, it's super simple to do these static animations. In the next section, we'll add some complexity by using jQuery to dynamically trigger Animate.css.
The first type of dynamic animation we'll look at is a scroll animation. With a little bit of jQuery we can check to see if an element is in the viewport. Then, all we have to do is add our Animate.css classes to it. We'll use three blocks of text, each with an icon, to demonstrate this. Here's the markup:
Now we can use jQuery to check see if the elements have been scrolled into view. In the code below, we are using the distance a user has scrolled, the height of the window, and the element's offset from the top to calculate this. For further explanation, you can look at this question on Stackoverflow. We then use the scroll event and this function to add the class
fadeInLeft to our elements.
Once again, that's all there is to it! All we need is a simple scrolling function to add our classes to the text blocks to create slick scroll animations. And, Animate.css does the rest. Here's our updated pen with the static and scroll animations:
Now let's turn to animations triggered by a click event.
To illustrate click animation with Animate.css we'll create a contact form. When the form is submitted, we'll use some jQuery to check it for empty inputs. If any of these are empty, we'll give them a red border and shake them to let the user know they missed something. Here's the basic markup for form:
Now many of you might be thinking, 'Wow, this painfully easy! All we have to do is add the classes we want when the button is clicked just like with the scroll animations!' However, in this situation there's a little bit of a caveat. With the scroll animations, we only needed them to run once after they had been scrolled into view. They don't keep fading in every time they're scrolled in. But, in our present situation, we want our inputs to shake every time the button is clicked. Here's an example of this problem:
Notice how the inputs don't shake after the first time. This is because they already have the classes
.one() method is essentially identical to the
.on() method. You can read more about its nuances here.*
Now that we have this nifty jQuery method, let's go through the logic of what we need to happen.
inputswhen the submit button is clicked.
inputis empty, we need to give it the classes
.form-error(this last one is for styling the
To accomplish these three goals, we'll create an 'on click' function with
Bear in mind that the class
As a final bonus section, I'd like to take a quick look at some really funky animations that Animate.css has in its library. I'm honestly not sure if these could ever be used in a production site, but they're kind of fun to tinker with!
If you navigate to the official Animate.css site, you'll notice there's a category of animations labeled 'special.' There are several effects in this category, but right now, I want to take a look at
hinge in particular. You can use this animation just like any other one in the Animate.css library, but it's definitely unique. It's probably easier to show rather than explain what exactly it does. So, check out the GIF below:
In the example above, all I've done is add an animation for each time the text is clicked - just like before. It's also worth noting that using this animation takes some extra code to use properly. This is because the
hinge effect uses its parent container as a reference for the swinging motion. Thus, if you leave the element you want to animate 'out in space,' part of the animation may happen off screen. Here's the last bit of code.
*Note: This code is pretty much identical to our other 'on click' animations.*
Here's a link to the finished project with all the bell and whistles:
And, that about wraps it up for our tour Animate.css! Let's recap what we've gone over:
I hope you enjoyed this guide (my first!) and are beginning to see all the clever ways this library can be implemented in web design. If you have any questions or comments please feel free to leave me a note in the comments.
Putting a hit counter on a web page helps you track how many people visit it. There are several ways to go about putting a counter on your page, either by adding a pre-built one or creating your own.Tip
We highly recommend using the Google's Analytics service over any web page counter, as it gives you a lot more valuable information.
If you prefer to add a pre-built counter to your web page, here are a few ways to do so.
Wrongs cuore di eleganzawrenegade stables for sale. WRNGS Cuore di Eleganza Being the last foal out of Classy Heart, Cuore grew up an orphan after the death of her dam, bottle-fed and carefully watched through her early years. She is the only Wrenegade-owned horse to be kept on Jalal's main property, to keep her closer to the family and easier to watch out for, as DImitri had become incredibly.
A counter like the one used above increases in count if you or any visitor refreshes their browser.
To create a counter, you need to create a Perl, PHP, or another script. Then, you need to either refer to that script through a server-side include or another method. We recommend you already know or learn Perl or PHP programming to create the counter script.
The code for creating a counter can vary, depending on the programming language used and the type of counter you want to add to your web page. Below are some web pages that offer sample counter script code, which you can use as a guide to creating a counter.
We have not tested the sample counter scripts provided on these web pages, so we cannot guarantee they're bug-free.