首页 > 其他分享 >css 启动页 loading动画

css 启动页 loading动画

时间:2022-09-19 22:55:30浏览次数:60  
标签:动画 rotate moz transform loading scale webkit animation css

 

 



<div class="loader">
<div class="text">Loading...</div>
<div class="horizontal">
<div class="circlesup">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<div class="circlesdwn">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
</div>
<div class="vertical">
<div class="circlesup">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
<div class="circlesdwn">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
</div>
</div>
<style>
/* Start the loader code, first, let's align it the center of screen */
.loader {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-mos-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
text-align: center;
/* disable selection and cursor changes */
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: default;
}

/* Text align it the center of screen and connect the looped animation for 2 seconds */
.text {
position: absolute;
left: -1.3em;
top: -1.7em;
-webkit-animation: text 2s infinite;
-moz-animation: text 2s infinite;
-moz-animation: text 2s infinite;
-ms-animation: text 2s infinite;
-o-animation: text 2s infinite;
animation: text 2s infinite;
}

/* Set for the first layer vertical position */
.vertical {
position: absolute;
top: -1.84em;
left: -0.4em;
-webkit-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-ms-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
}

/* Set for the second layer horizontal position */
.horizontal {
position: absolute;
top: 0em;
left: 0em;
-webkit-transform: rotate(0deg);
-moz-transform: rotate(0deg);
-ms-transform: rotate(0deg);
-o-transform: rotate(0deg);
transform: rotate(0deg);
}

/* The next two classes do mirror for animation */
.circlesup {
position: absolute;
top: -4.7em;
right: 12.1em;
}

.circlesdwn {
position: absolute;
top: 2.5em;
right: -13.5em;
-webkit-transform: rotate(180deg);
-moz-transform: rotate(180deg);
-ms-transform: rotate(180deg);
-o-transform: rotate(180deg);
transform: rotate(180deg);
}

/* Create a container for our circles, rotate it 45 degrees and set animation*/
.circle {
position: absolute;
width: 15em;
height: 15em;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
-webkit-animation: orbit 2s infinite;
-moz-animation: orbit 2s infinite;
-moz-animation: orbit 2s infinite;
-ms-animation: orbit 2s infinite;
-o-animation: orbit 2s infinite;
animation: orbit 2s infinite;
z-index: 5;
}

/* Style's of our circles */
.circle:after {
content: '';
position: absolute;
width: 2em;
height: 2em;
-webkit-border-radius: 100%;
-moz-border-radius: 100%;
-ms-border-radius: 100%;
-o-border-radius: 100%;
border-radius: 100%;
background: #13A3A5;
/* Pick a color 1*/
}

.circle:nth-child(2) {
-webkit-animation-delay: 100ms;
-moz-animation-delay: 100ms;
-ms-animation-delay: 100ms;
-o-animation-delay: 100ms;
animation-delay: 100ms;
z-index: 4;
}

.circle:nth-child(2):after {
background: #56bebf;
/* Pick a color 2*/
-webkit-transform: scale(0.8, 0.8);
-moz-transform: scale(0.8, 0.8);
-ms-transform: scale(0.8, 0.8);
-o-transform: scale(0.8, 0.8);
transform: scale(0.8, 0.8);
}

.circle:nth-child(3) {
-webkit-animation-delay: 225ms;
-moz-animation-delay: 225ms;
-ms-animation-delay: 225ms;
-o-animation-delay: 225ms;
animation-delay: 225ms;
z-index: 3;
}

.circle:nth-child(3):after {
background: #ffa489;
/* Pick a color 3*/
-webkit-transform: scale(0.6, 0.6);
-moz-transform: scale(0.6, 0.6);
-ms-transform: scale(0.6, 0.6);
-o-transform: scale(0.6, 0.6);
transform: scale(0.6, 0.6);
}

.circle:nth-child(4) {
-webkit-animation-delay: 350ms;
-moz-animation-delay: 350ms;
-ms-animation-delay: 350ms;
-o-animation-delay: 350ms;
animation-delay: 350ms;
z-index: 2;
}

.circle:nth-child(4):after {
background: #ff6d37;
/* Pick a color 4*/
-webkit-transform: scale(0.4, 0.4);
-moz-transform: scale(0.4, 0.4);
-ms-transform: scale(0.4, 0.4);
-o-transform: scale(0.4, 0.4);
transform: scale(0.4, 0.4);
}


.circle:nth-child(5) {
-webkit-animation-delay: 475ms;
-moz-animation-delay: 475ms;
-ms-animation-delay: 475ms;
-o-animation-delay: 475ms;
animation-delay: 475ms;
z-index: 1;
}

.circle:nth-child(5):after {
background: #DB2F00;
/* Pick a color 5*/
-webkit-transform: scale(0.2, 0.2);
-moz-transform: scale(0.2, 0.2);
-ms-transform: scale(0.2, 0.2);
-o-transform: scale(0.2, 0.2);
transform: scale(0.2, 0.2);
}

/* Animation keys */
@-webkit-keyframes orbit {
0% {
-webkit-transform: rotate(45deg);
}

5% {
-webkit-transform: rotate(45deg);
-webkit-animation-timing-function: ease-out;
}

70% {
-webkit-transform: rotate(405deg);
-webkit-animation-timing-function: ease-in;
}

100% {
-webkit-transform: rotate(405deg);
}
}

@-moz-keyframes orbit {
0% {
-moz-transform: rotate(45deg);
}

5% {
-moz-transform: rotate(45deg);
-moz-animation-timing-function: ease-out;
}

70% {
-moz-transform: rotate(405deg);
-moz-animation-timing-function: ease-in;
}

100% {
-moz-transform: rotate(405deg);
}
}

@-ms-keyframes orbit {
0% {
-ms-transform: rotate(45deg);
}

5% {
-ms-transform: rotate(45deg);
-ms-animation-timing-function: ease-out;
}

70% {
-ms-transform: rotate(405deg);
-ms-animation-timing-function: ease-in;
}

100% {
-ms-transform: rotate(405deg);
}
}

@-o-keyframes orbit {
0% {
-o-transform: rotate(45deg);
}

5% {
-o-transform: rotate(45deg);
-o-animation-timing-function: ease-out;
}

70% {
-o-transform: rotate(405deg);
-o-animation-timing-function: ease-in;
}

100% {
-o-transform: rotate(405deg);
}
}

@keyframes orbit {
0% {
transform: rotate(45deg);
}

5% {
transform: rotate(45deg);
animation-timing-function: ease-out;
}

70% {
transform: rotate(405deg);
animation-timing-function: ease-in;
}

100% {
transform: rotate(405deg);
}
}


@-webkit-keyframes text {
0% {
-webkit-transform: scale(0.2, 0.2);
-webkit-animation-timing-function: ease-out;
}

40%,
60% {
-webkit-transform: scale(1, 1);
-webkit-animation-timing-function: ease-out;
}

70%,
100% {
-webkit-transform: scale(0.2, 0.2);
}
}

@-moz-keyframes text {
0% {
-moz-transform: scale(0.2, 0.2);
-moz-animation-timing-function: ease-out;
}

50% {
-moz-transform: scale(1, 1);
-moz-animation-timing-function: ease-out;
}

60% {
-moz-transform: scale(1, 1);
-moz-animation-timing-function: ease-out;
}

100% {
-moz-transform: scale(0.2, 0.2);
}
}

@-mos-keyframes text {
0% {
-mos-transform: scale(0.2, 0.2);
-mos-animation-timing-function: ease-out;
}

50% {
-mos-transform: scale(1, 1);
-mos-animation-timing-function: ease-out;
}

60% {
-mos-transform: scale(1, 1);
-mos-animation-timing-function: ease-out;
}

100% {
-mos-transform: scale(0.2, 0.2);
}
}

@-o-keyframes text {
0% {
-o-transform: scale(0.2, 0.2);
-o-animation-timing-function: ease-out;
}

50% {
-o-transform: scale(1, 1);
-o-animation-timing-function: ease-out;
}

60% {
-o-transform: scale(1, 1);
-o-animation-timing-function: ease-out;
}

100% {
-o-transform: scale(0.2, 0.2);
}
}

@keyframes text {
0% {
transform: scale(0.2, 0.2);
animation-timing-function: ease-out;
}

50% {
transform: scale(1, 1);
animation-timing-function: ease-out;
}

60% {
transform: scale(1, 1);
animation-timing-function: ease-out;
}

100% {
transform: scale(0.2, 0.2);
}
}
</style>



标签:动画,rotate,moz,transform,loading,scale,webkit,animation,css
From: https://www.cnblogs.com/anans/p/16709429.html

相关文章

  • 使用 Buffered Paint API 绘制带有淡入淡出动画的控件
    使用BufferedPaintAPI绘制带有淡入淡出动画的控件发表于2011年10月23日 Windows窗体提供了许多机制来构建与操作系统风格相匹配的专业自定义UI控件;通过结......
  • CSS3-千峰
    CSS3-千峰.child>li{}---只作用在儿子标签,孙子标签无影响.child+li{}---这个标签后的第一个li.child~li{}---这个标签后的所有li[class]{}div[class]{}div[class=b......
  • #css#如何使用hover,实现父对子的样式改变?
    思路及做法:鼠标移动到父盒子的时候,里面所有的子盒子的样式都发生变化的,只需要直接在hover后面加上空格,并且加上子盒子的类名,里面再写其他样式.父盒子的类名:hover......
  • 动画之复习
    一、动画tween补间动画。通过指定View的初末状态和变化方式,对View的内容完成一系列的图形变换来实现动画效果。Alpha,Scale,Translate,Rotate。frame帧动画。Anim......
  • css font-size设置小于12px失效(转)
    原文:https://blog.csdn.net/weixin_38629529/article/details/1198664951、描述不知道你有没有遇到这样的情况,设置了font-size为10px,打开控制台审查元素也显示的是10px,但......
  • 【自动化测试】xpath、css使用及区别
    CSS和XPATH的功能对比对比项定位方式CSSXPATH常规属性id#id_keyword//*[@id=‘id关键字‘]常规属性class.class_name//*[@class=‘class属性名‘]......
  • 【css】-- flex:1的作用
    flex:1实质上是 flex-grow:1;flex-shrink:1;flex-basis:0;flex默认值为01auto该属性有两个快捷值:auto (11auto)和none(00auto)一、flex-growflex-grow......
  • CSS 中的 :is() 和 :where() 是什么?它们是相同的还是不同的?
    什么是:是()和:where()在CSS中?它们是相同的还是不同的?这:是()伪类函数将选择器列表作为其参数,并选择可以由该列表中的选择器之一选择的任何元素。:is()以上等价于以......
  • 20. 补间动画
    20.补间动画给动画设置一个初始值以及一个结束值,加上一个动画时间,Android系统自动补全。20.1补间动画分类alpha透明度rotate旋转scale缩放translate平移20......
  • 19. 帧动画
    19.帧动画把几张图片进行快速播放形成的动画。19.1素材准备8张图19.2创建animation-list集合<?xmlversion="1.0"encoding="utf-8"?><animation-listxmlns:and......