html代码
代码如下 | 复制代码 |
<div class="loader">加载中...</div> <div class="loader2">加载中...</div> <div class="loader3">加载中...</div> <div class="loader4">加载中...</div> <div class="loader5">加载中...</div> |
css代码
代码如下 | 复制代码 |
body {background:#0dcecb;} .loader, .loader:before, .loader:after { background: #FFF; -webkit-animation: load1 1s infinite ease-in-out; animation: load1 1s infinite ease-in-out; width: 1em; height: 4em; } .loader:before, .loader:after { position: absolute; top: 0; content: ''; } .loader:before { left: -1.5em; } .loader { text-indent: -9999em; margin: 40% auto; position: relative; font-size: 11px; -webkit-animation-delay: 0.16s; animation-delay: 0.16s; } .loader:after { left: 1.5em; -webkit-animation-delay: 0.32s; animation-delay: 0.32s; } @-webkit-keyframes load1 { 0%, 80%, 100% { box-shadow: 0 0 #FFF; height: 4em; } 40% { box-shadow: 0 -2em #ffffff; height: 5em; } } @keyframes load1 { 0%, 80%, 100% { box-shadow: 0 0 #FFF; height: 4em; } 40% { box-shadow: 0 -2em #ffffff; height: 5em; } } .loader2, .loader2:before, .loader2:after { border-radius: 50%; } .loader2:before, .loader2:after { position: absolute; content: ''; } .loader2:before { width: 5.2em; height: 10.2em; background: #0dcecb; border-radius: 10.2em 0 0 10.2em; top: -0.1em; left: -0.1em; -webkit-transform-origin: 5.2em 5.1em; transform-origin: 5.2em 5.1em; -webkit-animation: load2 2s infinite ease 1.5s; animation: load2 2s infinite ease 1.5s; } .loader2 { font-size: 11px; text-indent: -99999em; margin: 30% auto; position: relative; width: 10em; height: 10em; box-shadow: inset 0 0 0 1em #FFF; } .loader2:after { width: 5.2em; height: 10.2em; background: #0dcecb; border-radius: 0 10.2em 10.2em 0; top: -0.1em; left: 5.1em; -webkit-transform-origin: 0px 5.1em; transform-origin: 0px 5.1em; -webkit-animation: load2 2s infinite ease; animation: load2 2s infinite ease; } @-webkit-keyframes load2 { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } @keyframes load2 { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } } .loader3 { .loader4 { |