Table of Contents
Advantages of LESS animation
Usage
LESS-Prefixer
How to use
Supported attributes
LESS-Animation
mixin directly references
mixin parameter reference
Update log
Home Web Front-end HTML Tutorial CSS3 Animation css3 animation library built on less_html/css_WEB-ITnose

CSS3 Animation css3 animation library built on less_html/css_WEB-ITnose

Jun 24, 2016 am 11:50 AM

Advantages of LESS animation

· Rapid development of css3 animation

· Using less mixins writing method, no redundant css will be generated

· Already added Mainstream browser prefixes to ensure maximum compatibility

· LESS-Animation Some mixins support passing parameters and customizing animation amplitude

(PS: sublime’s less2css plug-in may not support compiling some of this library For new writing methods, it is recommended to use official less compilation, Koala, front-end construction tools, etc. Communication group: 145423956)

Usage

This less file mainly contains two functions: LESS-Prefixer. and LESS-Animation.

·Download the _animation.less file, git address:

git@github.com:w3cmark/css3.git
Copy after login

 

·Introduced in the main less file _animation.less

@import "_animation.less";
Copy after login

 

LESS-Prefixer

LESS-Prefixer is a set of LESS mixins that can This allows you to remove the prefixes for writing in each browser when writing CSS3, simplifying code writing.

How to use

· If you write css3 transition:

div{  -webkit-transition:all 0.2s ease-out;  -o-transition:all 0.2s ease-out;  -ms-transition:all 0.2s ease-out;  -moz-transition:all 0.2s ease-out;  transition:all 0.2s ease-out;}
Copy after login

 

· Writing after introducing _animation.less:

div{  .transition(all 0.2s ease-out);}
Copy after login

 

Supported attributes

.transition(@arg).transition-delay(@delay).transition-duration(@duration).transition-property(@property).transition-timing-function(@function).transition-delay(@delay).transition-delay(@delay).transform(@arg).transform-origin(@args).transform-style(@style).rotate(@deg).scale(@factor).translate(@x,@y).translate3d(@x,@y,@z).translateHardware(@x,@y).animation(@arg).animation-delay(@delay).animation-direction(@direction).animation-duration(@duration).animation-fill-mode(@mode).animation-iteration-count(@count).animation-name(@name).animation-play-state(@state).animation-timing-function(@function).flex(@arg).flexbox().opacity(@number).box-shadow(@arg).box-sizing(@arg).border-color(@arg).border-image(@arg).border-radius(@arg).background-origin(@arg).background-clip(@arg).background-size(@arg).columns(@args).column-count(@count).column-gap(@gap).column-width(@width).column-rule(@args).gradient(@default, @start, @stop).linear-gradient-top(@default,@color1,@stop1,@color2,@stop2).linear-gradient-top(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3).linear-gradient-top(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3,@color4,@stop4).linear-gradient-left(@default,@color1,@stop1,@color2,@stop2).linear-gradient-left(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3).linear-gradient-left(@default,@color1,@stop1,@color2,@stop2,@color3,@stop3,@color4,@stop4)
Copy after login

 

LESS-Animation

mixin directly references

LESS-Animation is a library based on less that integrates some basic animations (the included animations can be found above Effect preview), just call the corresponding animation mixins directly.

The animation frame name is consistent with the mixin name, making it easy to call.

· Chestnut 1: To quote the bounce animation, just add .bounce() to the element node;

.bounce{  .bounce();  .animation(bounce 1s ease-in-out); } 
Copy after login

· Chestnut 2: To quote the bounceIn animation, just add You need to add .bounceIn();

.box{  .bounceIn();  .animation(bounceIn 1s linear infinite);}
Copy after login

mixin parameter reference

ps:
· Added some parameter passing functions, you can Customize animation amplitude parameters to achieve different amplitudes for the same type of animation;
· The parameter passing function does not affect the original direct reference above, the parameters can be empty, and the original animation amplitude has been set to the default value;

Specific animation name and parameter description

动画名 参数说明 栗子
.bounce(@t; @n) @t:抖动最小幅度(默认值4px);@n:动画帧名(默认值bounce) .bounce(5px; bounceA)
.pulse(@t; @n) @t:放大幅度(默认值1.05);@n:动画帧名(默认值pulse) .pulse(1.5; pulseA)
.shake(@x; @n) @x:抖动最小幅度(默认值10px);@n:动画帧名(默认值shake) .shake(20px; shakeA)
.swing(@d; @n) @d:旋转最小角度(默认值5deg);@n:动画帧名(默认值swing) .swing(5deg; swingA)
.wobble(@d; @n) @d:摇摆最小幅度(默认值1deg);@n:动画帧名(默认值wobble) .wobble(-2deg; wobbleA)
.fadeIn(@x; @y; @n) @x:x轴移动距离(默认值0);@y:y轴移动距离(默认值0);@n:动画帧名(默认值fadeIn) .fadeIn(-1000px; 0; fadeInA)
.fadeOut(@x; @y; @n) @x:x轴移动距离(默认值0);@y:y轴移动距离(默认值0);@n:动画帧名(默认值fadeOut) .fadeOut(-1000px; 0; fadeOutA)
.turnInDown(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnInDown) .turnInDown(700px; turnInDownA)
.turnInUp(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnInUp) .turnInUp(700px; turnInUpA)
.turnInLeft(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnInLeft) .turnInLeft(700px; turnInLeftA)
.turnInRight(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnInRight) .turnInRight(700px; turnInRightA)
.turnOutDown(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnOutDown) .turnOutDown(700px; turnOutDownA)
.turnOutUp(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnOutUp) .turnOutUp(700px; turnOutUpA)
.turnOutLeft(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnOutLeft) .turnOutLeft(700px; turnOutLeftA)
.turnOutRight(@p; @n) @p:perspective值,元素距视图的距离(默认值600px);@n:动画帧名(默认值turnOutRight) .turnOutRight(700px; turnOutRightA)

Update log

· 20150110 Added turn Entrances (appearance) and turn Exits (disappearance) series animations

· 20150120 Some new animation animation mixins support passing parameters

Online preview effect http://www.w3cmark.com/animation/

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)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
3 weeks 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)

What is the purpose of the <progress> element? What is the purpose of the <progress> element? Mar 21, 2025 pm 12:34 PM

The article discusses the HTML &lt;progress&gt; element, its purpose, styling, and differences from the &lt;meter&gt; element. The main focus is on using &lt;progress&gt; for task completion and &lt;meter&gt; for stati

What is the purpose of the <datalist> element? What is the purpose of the <datalist> element? Mar 21, 2025 pm 12:33 PM

The article discusses the HTML &lt;datalist&gt; element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

What is the purpose of the <meter> element? What is the purpose of the <meter> element? Mar 21, 2025 pm 12:35 PM

The article discusses the HTML &lt;meter&gt; element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates &lt;meter&gt; from &lt;progress&gt; and ex

What are the best practices for cross-browser compatibility in HTML5? What are the best practices for cross-browser compatibility in HTML5? Mar 17, 2025 pm 12:20 PM

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

How do I use HTML5 form validation attributes to validate user input? How do I use HTML5 form validation attributes to validate user input? Mar 17, 2025 pm 12:27 PM

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

What is the viewport meta tag? Why is it important for responsive design? What is the viewport meta tag? Why is it important for responsive design? Mar 20, 2025 pm 05:56 PM

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

How do I use the HTML5 <time> element to represent dates and times semantically? How do I use the HTML5 <time> element to represent dates and times semantically? Mar 12, 2025 pm 04:05 PM

This article explains the HTML5 &lt;time&gt; element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit

What is the purpose of the <iframe> tag? What are the security considerations when using it? What is the purpose of the <iframe> tag? What are the security considerations when using it? Mar 20, 2025 pm 06:05 PM

The article discusses the &lt;iframe&gt; tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

See all articles