分享一个纯css制作的动画化,在网页(手机)载入等的时候能够引用!
CSS代码例如以下:
- /* Custom Stylesheet */
- body, html {
- margin: 0;
- -webkit-font-smoothing: antialiased;
- background: #68ABAD;
- text-align: center;
- }
- /* DEMO 1 */
- .loader1 {
- margin: 0 auto;
- height: 20px;
- width: 20px;
- position:relative;
- -webkit-animation:spin 1.5s linear infinite;
- -moz-animation:spin 1.5s linear infinite;
- }
- .loader1 i{
- height: 20px;
- width: 20px;
- border-radius: 25px;
- display: block;
- position:absolute;
- }
- .loader1 i:before, .loader1 i:after{
- content:'';
- display:block;
- position:absolute;
- height:inherit;
- width:inherit;
- border-radius: inherit;
- }
- .loader1 i:first-child:before {
- background:rgba(52, 149, 221, 0.9);
- -webkit-animation:rotate-top-left 1.5s linear infinite;
- -moz-animation:rotate-top-left 1.5s linear infinite;
- }
- .loader1 i:first-child:after {
- background:rgba(225, 73, 44, 0.9);
- -webkit-animation:rotate-top-right 1.5s linear infinite;
- -moz-animation:rotate-top-right 1.5s linear infinite;
- }
- .loader1 i:last-child:before {
- background:rgba(249, 206, 43, 0.9);
- -webkit-animation:rotate-bottom-left 1.5s linear infinite;
- -moz-animation:rotate-bottom-left 1.5s linear infinite;
- }
- .loader1 i:last-child:after {
- background:rgba(0, 153, 117, 0.9);
- -webkit-animation:rotate-bottom-right 1.5s linear infinite;
- -moz-animation:rotate-bottom-right 1.5s linear infinite;
- }
- @-webkit-keyframes spin{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(-180deg);
- }
- 100%{
- -webkit-transform:rotate(-360deg);
- }
- }
- @-webkit-keyframes rotate-top-right{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(-180deg);
- -webkit-transform-origin: 20% 20%;
- }
- 100%{
- -webkit-transform:rotate(-360deg);
- }
- }
- @-webkit-keyframes rotate-top-left{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(180deg);
- -webkit-transform-origin: 80% 20%;
- }
- 100%{
- -webkit-transform:rotate(360deg);
- }
- }
- @-webkit-keyframes rotate-bottom-right{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(-180deg);
- -webkit-transform-origin: 80% 80%;
- }
- 100%{
- -webkit-transform:rotate(-360deg);
- }
- }
- @-webkit-keyframes rotate-bottom-left{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(180deg);
- -webkit-transform-origin: 20% 80%;
- }
- 100%{
- -webkit-transform:rotate(360deg);
- }
- }
- @-moz-keyframes spin{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(-180deg);
- }
- 100%{
- -moz-transform:rotate(-360deg);
- }
- }
- @-moz-keyframes rotate-top-right{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(-180deg);
- -moz-transform-origin: 20% 20%;
- }
- 100%{
- -moz-transform:rotate(-360deg);
- }
- }
- @-moz-keyframes rotate-top-left{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(180deg);
- -moz-transform-origin: 80% 20%;
- }
- 100%{
- -moz-transform:rotate(360deg);
- }
- }
- @-moz-keyframes rotate-bottom-right{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(-180deg);
- -moz-transform-origin: 80% 80%;
- }
- 100%{
- -moz-transform:rotate(-360deg);
- }
- }
- @-moz-keyframes rotate-bottom-left{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(180deg);
- -moz-transform-origin: 20% 80%;
- }
- 100%{
- -moz-transform:rotate(360deg);
- }
- }
- /* DEMO 2 */
- .loader2 {
- margin: 0 auto;
- position:relative;
- width: 100px;
- height: 100px;
- }
- .loader2 i {
- border-style:solid;
- display:inline-block;
- box-sizing:border-box;
- -moz-box-sizing:border-box;
- border-width:50px;
- border-color:rgba(255,255,255,1);
- border-radius: 50px;
- -moz-animation:blink 1.5s infinite ease-in-out;
- -webkit-animation:blink 1.5s infinite ease-in-out;
- height: 100px;
- width: 100px;
- }
- @-webkit-keyframes blink{
- 50%{
- border-width:0;
- border-color:rgba(255,255,255,0.5);
- }
- 100%{
- border-width:0;
- border-color:rgba(255,255,255,0.5);
- }
- }
- @-moz-keyframes blink{
- 50%{
- border-width:0;
- border-color:rgba(255,255,255,0.5);
- }
- 100%{
- border-width:0;
- border-color:rgba(255,255,255,0.5);
- }
- }
- /* DEMO 3 */
- .loader3 {
- margin: 0 auto;
- position:relative;
- width: 50px;
- height: 50px;
- -webkit-animation:spin 4s infinite ease;
- -moz-animation:spin 4s infinite ease;
- }
- .loader3 i {
- border-style:solid;
- display:inline-block;
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- border:2px dashed rgba(0,0,0,0.7);
- border-radius: 50px;
- -webkit-animation:scale 4s infinite linear;
- -moz-animation:scale 4s infinite linear;
- height: 50px;
- width: 50px;
- }
- @-webkit-keyframes spin{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 25%{
- -webkit-transform:rotate(90deg);
- }
- 50%{
- -webkit-transform:rotate(-90deg);
- }
- 75%{
- -webkit-transform:rotate(180deg);
- }
- 100%{
- -webkit-transform:rotate(-180deg);
- }
- }
- @-webkit-keyframes scale{
- 0%{
- -webkit-transform:scale(1);
- }
- 25%{
- -webkit-transform:scale(0.5);
- }
- 50%{
- -webkit-transform:scale(1);
- }
- 75%{
- -webkit-transform:scale(0.5);
- }
- 100%{
- -webkit-transform:scale(1);
- }
- }
- @-moz-keyframes spin{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 25%{
- -moz-transform:rotate(90deg);
- }
- 50%{
- -moz-transform:rotate(-90deg);
- }
- 75%{
- -moz-transform:rotate(180deg);
- }
- 100%{
- -moz-transform:rotate(-180deg);
- }
- }
- @-moz-keyframes scale{
- 0%{
- -moz-transform:scale(1);
- }
- 25%{
- -moz-transform:scale(0.5);
- }
- 50%{
- -moz-transform:scale(1);
- }
- 75%{
- -moz-transform:scale(0.5);
- }
- 100%{
- -moz-transform:scale(1);
- }
- }
- /* DEMO 4 */
- .loader4 {
- margin: 0 auto;
- position:relative;
- text-align: center;
- border-bottom: 70px solid rgba(255,255,255,0.5);
- border-left: 10px solid transparent;
- border-right: 10px solid transparent;
- height: 0;
- width: 20px
- }
- .loader4:before{
- content:'';
- top: -15px;
- left: -28px;
- display:block;
- position:absolute;
- height:70px;
- width:70px;
- border-radius: 50px;
- border: 5px dashed rgba(255,255,255,0.5);
- -webkit-animation:wind .25s linear infinite;
- -moz-animation:wind .25s linear infinite;
- }
- .loader4 i{
- height: 40px;
- width: 5px;
- margin-left: -1.5px;
- display: inline-block;
- position:absolute;
- -webkit-animation:spin 1.5s linear infinite;
- -moz-animation:spin 1.5s linear infinite;
- }
- .loader4 i:before, .loader4 i:after{
- content:'';
- display:block;
- position:absolute;
- height:inherit;
- width:inherit;
- border-radius: inherit;
- background: white;
- }
- .loader4 i:first-child:before {
- top: -53%;
- -webkit-transform:rotate(-45deg);
- -webkit-transform-origin: 100% 100%;
- -moz-transform:rotate(-45deg);
- -moz-transform-origin: 100% 100%;
- }
- .loader4 i:first-child:after {
- top: -53%;
- -webkit-transform-origin: 0 100%;
- -webkit-transform:rotate(45deg);
- -moz-transform-origin: 0 100%;
- -moz-transform:rotate(45deg);
- }
- .loader4 i:last-child:before {
- top: 45%;
- -webkit-transform-origin: 100% 0;
- -webkit-transform:rotate(-45deg);
- -moz-transform-origin: 100% 0;
- -moz-transform:rotate(-45deg);
- }
- .loader4 i:last-child:after {
- -webkit-transform-origin: 0 0;
- -webkit-transform: rotate(45deg);
- -moz-transform-origin: 0 0;
- -moz-transform: rotate(45deg);
- top: 45%;
- }
- @-webkit-keyframes spin{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(-180deg);
- }
- 100%{
- -webkit-transform:rotate(-360deg);
- }
- }
- @-webkit-keyframes wind{
- 100%{
- -webkit-transform:scale(2);
- border-width: 0;
- }
- }
- @-moz-keyframes spin{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(-180deg);
- }
- 100%{
- -moz-transform:rotate(-360deg);
- }
- }
- @-moz-keyframes wind{
- 100%{
- -moz-transform:scale(2);
- border-width: 0;
- }
- }
- /* DEMO 5 */
- .solar {
- margin: 250px auto 350px;
- height: 50px;
- width: 50px;
- background: orange;
- border-radius: 25px;
- position:relative;
- -webkit-animation:glow 1.5s linear infinite;
- -moz-animation:glow 1.5s linear infinite;
- }
- .solar i{
- border-radius: 250px;
- display:block;
- position:absolute;
- border: 1px solid rgba(255,255,255, 0.15);
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- -webkit-transform-origin: 50% 50%;
- -moz-transform-origin: 50% 50%;
- }
- .solar i:before {
- content:'';
- border-radius: 25px;
- background: black;
- display: block;
- position:absolute;
- top: -5px;
- right: 45%;
- }
- .solar i.mercury {
- width: 80px;
- height: 80px;
- margin-left: -40px;
- left: 50%;
- top: 50%;
- margin-top: -40px;
- -webkit-animation:orbit .5s linear infinite;
- -moz-animation:orbit .5s linear infinite;
- }
- .solar i.mercury:before {
- background: #6F5F5F;
- height: 7px;
- width: 7px;
- }
- .solar i.venus {
- width: 110px;
- height: 110px;
- margin-left: -55px;
- left: 50%;
- top: 50%;
- margin-top: -55px;
- -webkit-animation:orbit 1s linear infinite;
- -moz-animation:orbit 1s linear infinite;
- }
- .solar i.venus:before {
- background: #E7A71F;
- height: 10px;
- width: 10px;
- }
- .solar i.earth {
- width: 140px;
- height: 140px;
- margin-left: -70px;
- left: 50%;
- top: 50%;
- margin-top: -70px;
- -webkit-animation:orbit 1.5s linear infinite;
- -moz-animation:orbit 1.5s linear infinite;
- }
- .solar i.earth:before {
- background: #63BEE2;
- height: 10px;
- width: 10px;
- }
- .solar i.mars {
- width: 170px;
- height: 170px;
- margin-left: -85px;
- left: 50%;
- top: 50%;
- margin-top: -85px;
- -webkit-animation:orbit 2s linear infinite;
- -moz-animation:orbit 2s linear infinite;
- }
- .solar i.mars:before {
- background: red;
- height: 10px;
- width: 10px;
- }
- .solar i.belt {
- box-sizing: border-box;
- -moz-box-sizing: border-box;
- border-width: 25px;
- width: 240px;
- height: 240px;
- margin-left: -120px;
- border-color: rgba(36, 35, 35, 0.21);
- left: 50%;
- top: 50%;
- margin-top: -120px;
- }
- .solar i.jupiter {
- width: 260px;
- height: 260px;
- margin-left: -130px;
- left: 50%;
- top: 50%;
- margin-top: -130px;
- -webkit-animation:orbit 2.5s linear infinite;
- -moz-animation:orbit 2.5s linear infinite;
- }
- .solar i.jupiter:before {
- background: #CF9B2B;
- top: -15px;
- height: 30px;
- width: 30px;
- }
- .solar i.saturn {
- width: 320px;
- height: 320px;
- margin-left: -160px;
- left: 50%;
- top: 50%;
- margin-top: -160px;
- -webkit-animation:orbit 3s linear infinite;
- -moz-animation:orbit 3s linear infinite;
- }
- .solar i.saturn:before {
- background: #CF7A2B;
- top: -10px;
- height: 20px;
- width: 20px;
- }
- .solar i.saturn:after {
- background: #fff;
- width: 30px;
- height: 1px;
- content: '';
- position: absolute;
- display: block;
- background: #FFF;
- width: 30px;
- height: 1px;
- content: '';
- right: 43.5%;
- -webkit-transform:rotate(20deg);
- -moz-transform:rotate(20deg);
- }
- .solar i.uranus {
- width: 360px;
- height: 360px;
- margin-left: -180px;
- left: 50%;
- top: 50%;
- margin-top: -180px;
- -webkit-animation:orbit 3.5s linear infinite;
- -moz-animation:orbit 3.5s linear infinite;
- }
- .solar i.uranus:before {
- background: #10C593;
- top: -8px;
- height: 15px;
- width: 15px;
- }
- .solar i.neptune {
- width: 400px;
- height: 400px;
- margin-left: -200px;
- left: 50%;
- top: 50%;
- margin-top: -200px;
- -webkit-animation:orbit 4s linear infinite;
- -moz-animation:orbit 4s linear infinite;
- }
- .solar i.neptune:before {
- background: #1470E4;
- top: -8px;
- height: 15px;
- width: 15px;
- }
- @-webkit-keyframes orbit{
- 0%{
- -webkit-transform:rotate(0deg);
- }
- 50%{
- -webkit-transform:rotate(-180deg);
- }
- 100%{
- -webkit-transform:rotate(-360deg);
- }
- }
- @-webkit-keyframes glow{
- 0%{
- box-shadow: none;
- }
- 50%{
- background: #FFEB00;
- box-shadow: 0 0 20px orange;
- }
- 100%{
- box-shadow: none;
- }
- }
- @-moz-keyframes orbit{
- 0%{
- -moz-transform:rotate(0deg);
- }
- 50%{
- -moz-transform:rotate(-180deg);
- }
- 100%{
- -moz-transform:rotate(-360deg);
- }
- }
- @-moz-keyframes glow{
- 0%{
- box-shadow: none;
- }
- 50%{
- background: #FFEB00;
- box-shadow: 0 0 20px orange;
- }
- 100%{
- box-shadow: none;
- }
- }
效果如图:看来博客不能引用jsfiddle
分享一个纯css制作的动画化,在网页(手机)载入等的时候能够引用!的更多相关文章
- 一个纯CSS DIV天气动画图标【转扒的】
<p> </p> <style><!-- /* SUNNY */ .sunny { -webkit-animation: sunny 15s linear i ...
- 如何使用纯 CSS 制作四子连珠游戏
序言:你是否想过单纯使用 CSS 也可以制作一款游戏?甚至可以双人对决!这是一篇非常有趣的文章,作者详细讲解了使用纯 CSS 制作四子连珠游戏的思路以及使用奇淫巧技解决困难问题的方法.因为案例本身比较 ...
- 8个纯CSS3制作的动画应用及源码
对于一个复杂的图形或者动画来说,之前我们的处理方式是图片叠加或者利用CSS+JavaScript的方法,然而随着CSS3标准的不断成熟,我们甚至完全可以利用CSS3来绘制一些图片和制作丰富的动画特效. ...
- 如何使用纯CSS制作特效导航条?
先上张图,如何使用纯 CSS 制作如下效果? 在继续阅读下文之前,你可以先缓一缓.尝试思考一下上面的效果或者动手尝试一下,不借助 JS ,能否巧妙的实现上述效果. OK,继续.这个效果是我在业务开发的 ...
- 每日CSS_纯CSS制作进度条
每日CSS_纯CSS制作进度条 2020_12_26 源码 1. 代码解析 1.1 html 代码解析 设置整个容器 <div class="container"> . ...
- 纯CSS制作水平垂直居中“十字架”
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- No.5 - 纯 CSS 制作绕中轴旋转的立方体
body{ background-color: #000; margin:; padding:; } main{ perspective: 800px; } .cube{ transform-styl ...
- 纯CSS制作空心三角形和实心三角形及其实现原理
纯CSS制作空心三角形和实心三角形及其实现原理 在一次项目中需要使用到空心三角形,我瞬间懵逼了.查阅了一些资料加上自己的分析思考,终于是达到了效果,个人感觉制作三角形是使用频率很高的,因此记录下来,供 ...
- 纯CSS制作三角(转)
原原文地址:http://www.w3cplus.com/code/303.html 原文地址:http://blog.csdn.net/dyllove98/article/details/89670 ...
随机推荐
- Mac 安装Fiddler 抓包工具
官方安装文档https://www.telerik.com/download/fiddler/fiddler-osx-beta 如果输入mono Fiddler.exe报下面这个错误 WARNING: ...
- 2012 noip提高 Vigenère 密码
P1079 Vigenère 密码 题目描述 16 世纪法国外交家 Blaise de VigenèreBlaisedeVigene`re 设计了一种多表密码加密算法―― VigenèreVigene ...
- linux shell 自动判断操作系统release 然后连接FTP yum源的脚本
如何搭建本地yum源见附录① 如何搭建FTP yum源见附录② 脚本正文: #!/bin/sh# CenterOS config yumOSV=`rpm -q --qf %{version} cent ...
- webpack 之 缓存处理
针对 这里 的所提到的观点,如果webpack每次都生成相同名字的bundle.js,会导致问题.这里使用webpack的文件hash功能来解决,简简单单地为输出文件添加一个“[hash]”即可. / ...
- 高可用技术之keepalived原理简单了解
Keepalived 工作原理 keepalived是以VRRP协议为实现基础的,VRRP全称Virtual Router Redundancy Protocol,即虚拟路由冗余协议. 虚拟路由冗余协 ...
- pygame试水,写一个贪吃蛇
最近学完python基础知识,就想着做一个游戏玩玩,于是就在https://www.pygame.org/docs/学着做了个贪吃蛇游戏. 首先要导入模块. import pygame import ...
- 数据结构实验1:C++实现静态顺序表类
写了3个多小时,还是太慢了.太菜了! 图1 程序运行演示截图1 实验1 1.1 实验目的 熟练掌握线性表的顺序存储结构. 熟练掌握顺序表的有关算法设计. 根据具体问题的需要,设计出合理的表示数据的顺序 ...
- netcore使用AutoMapper
说明:以下是使用过程中看到的其他博主写的,地址如下: 地址一:https://cloud.tencent.com/developer/article/1395155 地址二:https://www.c ...
- 【07】QQ群管理公告小结:
[07]QQ群管理公告小结: 01,请看公告遵守相关规定. 02,群内除QQ自带的缺省表情外(不是QQ的VIP或大图表情),禁止发送大表情,大图片(展示问题的屏幕截图除外), 03,修改群名片 ...
- python3--shelve 模块
shelve模块是一个简单的k,v将内存数据通过文件持久化的模块,可以持久化任何pickle可支持的python数据格式 import shelve d = shelve.open('shelve_t ...