Home Web Front-end CSS Tutorial CSS3 learning page loading animation (5)

CSS3 learning page loading animation (5)

Oct 15, 2018 pm 04:36 PM
css3 css3 animation loading animation

I have posted four articles before, with 22 effects. This article will share with you 6 types of CSS3 page loading animations, for a total of 28 page loading animation effects. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

In the previous article [CSS3 Learning Page Loading Animation (4)], I shared 6 more CSS3 loading animations, and I will continue to share them today (the title is continued from the previous time).

Twenty-three, effect twenty-three

##Two squares are initially positioned to the upper left (top: 0; left: 0;);

A complete movement is divided into four stages: in the first stage, the upper left moves to the upper right, and rotates 90 °, the width and height are reduced; in the second stage, the upper right is moved to the lower right, rotated 180°, and the width and height are restored; in the third stage, the lower right is moved to the lower left, rotated 270°, and the width and height are reduced; in the fourth stage, the lower left Move to the upper left, rotate 360°, and restore the width and height.

The animation delay time difference is negative half of the animation time.

{animation: party_ball 2s ease infinite;}
@keyframes party_ball {
      25% {
        -webkit-transform: scale(.5) rotateZ(90deg);
        transform: scale(.5) rotateZ(90deg);
        top: 0;
        left: 100%;
      }
      50% {
        -webkit-transform: scale(1) rotateZ(180deg);
        transform: scale(1) rotateZ(180deg);
        top: 100%;
        left: 100%;
      }
      75% {
        -webkit-transform: scale(.5) rotateZ(270deg);
        transform: scale(.5) rotateZ(270deg);
        top: 100%;
        left: 0;
      }
      100% {
        -webkit-transform: scale(1) rotateZ(360deg);
        transform: scale(1) rotateZ(360deg);
        top: 0;
        left: 0;
      }
    }
Copy after login

Twenty-four, effect twenty-four

##Similar to the beating effect of a flame, position the three square p's horizontally in the center, vertically at the bottom, and set the initial width and height to 0.

While moving upward, change the width and height of the square.

{animation: fire_ball 1.5s linear infinite;}@keyframes fire_ball {
      50% {
        height: 30px;
        width: 30px;
        top: 50%;
      }
      100% {
        height: 0;
        width: 0;
        top: 0;
      }
    }
Copy after login

Twenty-five, effect twenty-five

##It's very similar to the game I played when I was a kid - Pac-Man

The production of Pac-Man on the left: the width and height of the two p's are 0, only set the border, and set the color attribute of the right border to transparent , the code and effect are as follows:

.pac_head {
      border: 25px solid #fff;
      border-right-color: transparent;
      border-radius: 50%;
    }
Copy after login

Pac-Man’s mouth has been made. The remaining two p’s are one forward rotation on the Z axis and one reverse Z axis. The axis rotates and the eating action is made.

The three small balls on the right are all set to move to the middle of the right side and move towards Pac-Man's mouth. Just adjust the animation time of the balls and Pac-Man appropriately.

@keyframes pac_ball {
      100% {
        right: 55%;
      }
    }
Copy after login

Twenty-six, effect twenty-six

##Bobbing PaperThe difficulty of this effect lies in how to create the effect of falling and deformation. it's actually really easy. First of all, you must understand that a square, as long as it is rotated by a multiple of 90 around the Z axis, will look exactly the same as the original image. Then it is very simple to create this effect. There is no need to consider adding a deformation effect to each corner. .

Deformation effect: This kind of deformation can be produced by changing the value of border-radius.

@keyframes beat_ball {
      25% {
        transform: translateY(25%) rotate(22.5deg);//下落
        border-bottom-right-radius: 10%;
      }
      50% {
        border-bottom-right-radius: 100%;
        transform: translateY(50%) scale(1, 0.8) rotate(45deg)   //scale,是为了让形变看起来有弹性      }
      75% {
        transform: translateY(25%) rotate(67.5deg)   //上升      }
      100% {
        transform: translateY(0) rotate(90deg)        //旋转90°结束一个周期,刚好和初始状态一模一样,那就直接重复执行动画即可      }
    }
Copy after login

The shadow effect is even better. Make a flat ellipse, box-shadow and add the shadow effect, and change the size at the right time.

@keyframes beat_shadow {
      50%{
        transform: scale(1.25,0.8);
      }
    }
Copy after login

Twenty-seven, effect twenty-seven

##A p and a pseudo class are made. p is responsible for rotation, and the pseudo class is responsible for changing the height. Each one performs its own duties.

@keyframes locker_ball {           //p旋转
      25%{
        transform: rotateZ(180deg);
      }
      50%{
        transform: rotateZ(180deg);
      }
      75%{
        transform: rotateZ(360deg);
      }
      100%{
        transform: rotateZ(360deg);
      }
    }
    @keyframes locker_ballh {     //伪类高度改变
      25%{
        height: 40px;
      }
      50%{
        height: 0;
      }
      75%{
        height: 0;
      }
      100%{
        height: 40px;
      }
    }
Copy after login

Twenty-eight, effect twenty-eight

##The effect of the clock (my positioning seems not to be in the middle)The effect of the clock can be achieved using only one keyframe animation, which is to rotate 360°, just change the position of the two pointers The animation movement time is enough.

@keyframes clock {
      100%{
        transform: rotateZ(360deg);
      }
    }
Copy after login
In this series of animations, some pause effects are achieved through key frame control to maintain the state from a certain percentage to a certain percentage; while others are achieved through motion curve ease.

Finished with flowers! I hope this series can be helpful to everyone's learning. For more related tutorials, please visit

CSS basic video tutorial

,

CSS3 video tutorial

,

bootstrap tutorial

!

The above is the detailed content of CSS3 learning page loading animation (5). For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Will R.E.P.O. Have Crossplay?
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to achieve wave effect with pure CSS3? (code example) How to achieve wave effect with pure CSS3? (code example) Jun 28, 2022 pm 01:39 PM

How to achieve wave effect with pure CSS3? This article will introduce to you how to use SVG and CSS animation to create wave effects. I hope it will be helpful to you!

How to use Vue to implement loading animation and progress bar effects? How to use Vue to implement loading animation and progress bar effects? Jun 27, 2023 pm 04:36 PM

Vue is a popular front-end framework that greatly simplifies website or application development. One of the common features is loading animation and progress bar effects to make the interface more attractive and interactive. In this article, we will explore how to achieve these effects using Vue. Loading animation effect Loading animation effect means that while waiting for data to be loaded, an animation effect will appear on the website or application to indicate that the data is loading. This helps convey the concept of wait time to the user, thus preventing them from getting bored or losing interest. The following is the implementation of the loading action

Use CSS skillfully to realize various strange-shaped buttons (with code) Use CSS skillfully to realize various strange-shaped buttons (with code) Jul 19, 2022 am 11:28 AM

This article will show you how to use CSS to easily realize various weird-shaped buttons that appear frequently. I hope it will be helpful to you!

How to hide elements in css without taking up space How to hide elements in css without taking up space Jun 01, 2022 pm 07:15 PM

Two methods: 1. Using the display attribute, just add the "display:none;" style to the element. 2. Use the position and top attributes to set the absolute positioning of the element to hide the element. Just add the "position:absolute;top:-9999px;" style to the element.

How to implement lace borders in css3 How to implement lace borders in css3 Sep 16, 2022 pm 07:11 PM

In CSS, you can use the border-image attribute to achieve a lace border. The border-image attribute can use images to create borders, that is, add a background image to the border. You only need to specify the background image as a lace style; the syntax "border-image: url (image path) offsets the image border width inward. Whether outset is repeated;".

It turns out that text carousel and image carousel can also be realized using pure CSS! It turns out that text carousel and image carousel can also be realized using pure CSS! Jun 10, 2022 pm 01:00 PM

How to create text carousel and image carousel? The first thing everyone thinks of is whether to use js. In fact, text carousel and image carousel can also be realized using pure CSS. Let’s take a look at the implementation method. I hope it will be helpful to everyone!

How to enlarge the image by clicking the mouse in css3 How to enlarge the image by clicking the mouse in css3 Apr 25, 2022 pm 04:52 PM

Implementation method: 1. Use the ":active" selector to select the state of the mouse click on the picture; 2. Use the transform attribute and scale() function to achieve the picture magnification effect, the syntax "img:active {transform: scale(x-axis magnification, y Axis magnification);}".

How to set animation rotation speed in css3 How to set animation rotation speed in css3 Apr 28, 2022 pm 04:32 PM

In CSS3, you can use the "animation-timing-function" attribute to set the animation rotation speed. This attribute is used to specify how the animation will complete a cycle and set the speed curve of the animation. The syntax is "element {animation-timing-function: speed attribute value;}".

See all articles