css 启动页 loading动画
2024-10-21 06:05:43
<div class="index-html-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 */
.index-html-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 */
.index-html-loader .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 */
.index-html-loader .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 */
.index-html-loader .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 */
.index-html-loader .circlesup {
position: absolute;
top: -4.7em;
right: 12.1em;
}
.index-html-loader .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*/
.index-html-loader .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 */
.index-html-loader .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*/
}
.index-html-loader .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;
}
.index-html-loader .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);
}
.index-html-loader .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;
}
.index-html-loader .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);
}
.index-html-loader .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;
}
.index-html-loader .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);
}
.index-html-loader .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;
}
.index-html-loader .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 */
@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);
}
}
@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>
最新文章
- [No0000AC]全局鼠标键盘模拟器
- Java集合框架List,Map,Set等全面介绍
- Android布局-TableLayout表格布局
- 随机打乱工具sklearn.utils.shuffle,将原有的序列打乱,返回一个全新的错乱顺序的值
- POJ 1410 Intersection(判断线段交和点在矩形内)
- [CF676C]Vasya and String(尺取法,原题)
- 宏HASH_GET_FIRST
- 如何把jquery 的dialog和ztree结合
- iOS动画技术笔记
- cocos2d-x游戏开发系列教程-中国象棋02-main函数和欢迎页面
- 配置静态监听解决ORA-12514错误的案例(转)
- 手机自动化测试:Appium代码之Logger
- PHP 底层的运行机制与原理 --转
- github和本地仓库关联
- HDU 6432(不连续环排列 ~)
- python之路——12
- tomcat下部署应用helloworld
- [转]delphi 有授权许可的字符串拷贝函数源码
- 【netcore入门】在Windows IIS上部署.NET Core 2.1项目
- 简单的Git流程