css实现九款loading加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:css实现九款loading加载动画效果代码

代码标签: loading 加载 动画 效果

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <style>
        body {
            font-size: 16px;
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }
        html, body, div, span, applet, object, iframe,
        h1, h2, h3, h4, h5, h6, p, blockquote, pre,
        a, abbr, acronym, address, big, cite, code,
        del, dfn, em, img, ins, kbd, q, s, samp,
        small, strike, strong, sub, sup, tt, var,
        b, u, i, center,
        dl, dt, dd, ol, ul, li,
        fieldset, form, label, legend,
        table, caption, tbody, tfoot, thead, tr, th, td,
        article, aside, canvas, details, embed,
        figure, figcaption, footer, header, hgroup,
        menu, nav, output, ruby, section, summary,
        time, mark, audio, video, textarea, input {
            margin: 0;
            padding: 0;
            border: 0;
            vertical-align: baseline;
            box-sizing: border-box;
            font-family: 'Proxima Nova';
        }
        /* HTML5 display-role reset for older browsers */
        article, aside, details, figcaption, figure,
        footer, header, hgroup, menu, nav, section {
            display: block;
        }
        body {
            line-height: 1;
        }
        ol, ul {
            list-style: none;
        }
        blockquote, q {
            quotes: none;
        }
        blockquote:before, blockquote:after,
        q:before, q:after {
            content: '';
            content: none;
        }
        input {
            font-family: 'Proxima Nova';
        }
        table {
            border-collapse: collapse;
            border-spacing: 0;
        }
        a {
            text-decoration: none;
            font-size: 16px;
            color: #333;
            /* 取消点击时背景色 */
            -webkit-tap-highlight-color: transparent;
            -webkit-user-select: none;
            -moz-user-focus: none;
            -moz-user-select: none;
        }
        /* custom css */
        div:active,section:active {
            -webkit-tap-highlight-color: transparent;
            -o-tap-highlight-color: transparent;
            -moz-tap-highlight-color: transparent;
        }
        .clearfix {
            zoom: 1;
        }
        .clearfix:after {
            display: block;
            clear: both;
            content: "";
            visibility: hidden;
            height: 0;

        }

        body {
            background-color: #abcdef;
        }
        .demoBox {
            width: 100%;
            padding: 50px 0;
        }
        .demoBox .title {
            text-align: center;
            font-size: 50px;
            margin-bottom: 30px;
        }
        .demoBox .demoList {
            max-width: 600px;
            margin: 0 auto;
            display: flex;
            flex-flow: row wrap;
            align-items: center;
            justify-content: space-around;
        }
        .demoBox .demoList .demoItem {
            width: calc(33.3% - 10px);
            height: 170px;
            margin: 5px 0;
            border: 1px solid rgba(255, 255, 255, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            box-shadow: 0 4px 6px 0 hsla(0, 0%, 0%, 0.3);
        }
        .demoBox .demoList .demoItem .container {
            width: 30px;
            height: 30px;
            position: relative;
        }
        /* google loadings */
        #google .demoItem {
            background-color: rgba(0, 0, 0, 0.9);
        }
        #google .demoItem .container .shape-1 {
            background-color: #1875E5;
        }
        #google .demoItem .container .shape-2 {
            background-color: #C5523F;
        }
        #google .demoItem .container .shape-3 {
            background-color: #499255;
        }
        #google .demoItem .container .shape-4 {
            background-color: #F2B736;
        }
@-webkit-keyframes Animation1Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(16px, 16px);
                transform: translate(16px, 16px);
            }
        }
@keyframes Animation1Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(16px, 16px);
                transform: translate(16px, 16px);
            }
        }
@-webkit-keyframes Animation1Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-16px, 16px);
                transform: translate(-16px, 16px);
            }
        }
@keyframes Animation1Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-16px, 16px);
                transform: translate(-16px, 16px);
            }
        }
@-webkit-keyframes Animation1Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(16px, -16px);
                transform: translate(16px, -16px);
            }
        }
@keyframes Animation1Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(16px, -16px);
                transform: translate(16px, -16px);
            }
        }
@keyframes Animation1Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-16px, -16px);
                transform: translate(-16px, -16px);
            }
        }
@-webkit-keyframes Animation1Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-16px, -16px);
                transform: translate(-16px, -16px);
            }
        }
        .google-animation-1 {
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
        }
        .google-animation-1 .shape {
            width: 10px;
            height: 10px;
            position: absolute;
        }
        .google-animation-1 .shape-1 {
            left: 0;
            -webkit-animation: Animation1Shape1 0.5s ease infinite alternate;
            animation: Animation1Shape1 0.5s ease infinite alternate;
        }
        .google-animation-1 .shape-2 {
            right: 0;
            -webkit-animation: Animation1Shape2 0.5s ease infinite alternate;
            animation: Animation1Shape2 0.5s ease infinite alternate;
        }
        .google-animation-1 .shape-3 {
            bottom: 0;
            -webkit-animation: Animation1Shape3 0.5s ease infinite alternate;
            animation: Animation1Shape3 0.5s ease infinite alternate;
        }
        .google-animation-1 .shape-4 {
            right: 0;
            bottom: 0;
            -webkit-animation: Animation1Shape4 0.5s ease infinite alternate;
            animation: Animation1Shape4 0.5s ease infinite alternate;
        }
@-webkit-keyframes Animation2Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(20px, 20px);
                transform: translate(20px, 20px);
            }
        }
@keyframes Animation2Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(20px, 20px);
                transform: translate(20px, 20px);
            }
        }
@keyframes Animation2Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-20px, 20px);
                transform: translate(-20px, 20px);
            }
        }
@-webkit-keyframes Animation2Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-20px, 20px);
                transform: translate(-20px, 20px);
            }
        }
@keyframes Animation2Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(20px, -20px);
                transform: translate(20px, -20px);
            }
        }
@-webkit-keyframes Animation2Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(20px, -20px);
                transform: translate(20px, -20px);
            }
        }
@keyframes Animation2Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-20px, -20px);
                transform: translate(-20px, -20px);
            }
        }
@-webkit-keyframes Animation2Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                -webkit-transform: translate(-20px, -20px);
                transform: translate(-20px, -20px);
            }
        }
@keyframes Animation2Container {
            0% {
                transform: rotate(0);
            }
            100% {
                transform: rotate(360deg);
            }
        }
@-webkit-keyframes Animation2Container {
            0% {
                transform: rotate(0);
            }
            100% {
                transform: rotate(360deg);
            }
        }
        .google-animation-2 {
            -webkit-animation: Animation2Container 1s ease infinite;
            animation: Animation2Container 1s ease infinite;
        }
        .google-animation-2 .shape {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            position: absolute;
        }
        .google-animation-2 .shape-1 {
            left: 0;
            -webkit-animation: Animation2Shape1 0.5s ease infinite alternate;
            animation: Animation2Shape1 0.5s ease infinite alternate;
        }
        .google-animation-2 .shape-2 {
            right: 0;
            -webkit-animation: Animation2Shape2 0.5s ease infinite alternate;
            animation: Animation2Shape2 0.5s ease infinite alternate;
        }
        .google-animation-2 .shape-3 {
            bottom: 0;
            -webkit-animation: Animation2Shape3 0.5s ease infinite alternate;
            animation: Animation2Shape3 0.5s ease infinite alternate;
        }
        .google-animation-2 .shape-4 {
            right: 0;
            bottom: 0;
            -webkit-animation: Animation2Shape4 0.5s ease infinite alternate;
            animation: Animation2Shape4 0.5s ease infinite alternate;
        }
@keyframes Animation3Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, 5px);
            }
        }
@-webkit-keyframes Animation3Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, 5px);
            }
        }
@keyframes Animation3Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, 5px);
            }
        }
@-webkit-keyframes Animation3Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, 5px);
            }
        }
@keyframes Animation3Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, -5px);
            }
        }
@-webkit-keyframes Animation3Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, -5px);
            }
        }
@keyframes Animation3Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, -5px);
            }
        }
@-webkit-keyframes Animation3Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, -5px);
            }
        }
@keyframes Animation3Container {
            0% {
                transform: rotate(0);
            }
            100% {
                transform: rotate(360deg);
            }
        }
@-webkit-keyframes Animation3Container {
            0% {
                transform: rotate(0);
            }
            100% {
                transform: rotate(360deg);
            }
        }
        .google-animation-3 {
            width: 20px;
            height: 20px;
            -webkit-animation: Animation3Container 1s ease infinite;
            animation: Animation3Container 1s ease infinite;
        }
        .google-animation-3 .shape {
            width: 10px;
            height: 10px;
            position: absolute;
        }
        .google-animation-3 .shape-1 {
            left: 0;
            -webkit-border-top-left-radius: 100%;
            border-top-left-radius: 100%;
            -webkit-animation: Animation3Shape1 0.5s ease infinite alternate;
            animation: Animation3Shape1 0.5s ease infinite alternate;
        }
        .google-animation-3 .shape-2 {
            right: 0;
            -webkit-border-top-right-radius: 100%;
            border-top-right-radius: 100%;
            -webkit-animation: Animation3Shape2 0.5s ease infinite alternate;
            animation: Animation3Shape2 0.5s ease infinite alternate;
        }
        .google-animation-3 .shape-3 {
            bottom: 0;
            -webkit-border-bottom-left-radius: 100%;
            border-bottom-left-radius: 100%;
            -webkit-animation: Animation3Shape3 0.5s ease infinite alternate;
            animation: Animation3Shape3 0.5s ease infinite alternate;
        }
        .google-animation-3 .shape-4 {
            right: 0;
            bottom: 0;
            -webkit-border-bottom-right-radius: 100%;
            border-bottom-right-radius: 100%;
            -webkit-animation: Animation3Shape4 0.5s ease infinite alternate;
            animation: Animation3Shape4 0.5s ease infinite alternate;
        }
@keyframes Animation4Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, 5px);
            }
        }
@-webkit-keyframes Animation4Shape1 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, 5px);
            }
        }
@keyframes Animation4Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, 5px);
            }
        }
@-webkit-keyframes Animation4Shape2 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, 5px);
            }
        }
@keyframes Animation4Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, -5px);
            }
        }
@-webkit-keyframes Animation4Shape3 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(5px, -5px);
            }
        }
@keyframes Animation4Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, -5px);
            }
        }
@-webkit-keyframes Animation4Shape4 {
            0% {
                -webkit-transform: translate(0, 0);
                transform: translate(0, 0);
            }
            100% {
                transform: translate(-5px, -5px);
            }
        }
@-webkit-keyframes Animation4Container {
            0% {
                -webkit-transform: rotate(0);
                transform: rotate(0);
            }
            100% {
                -webkit-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }
@keyframes Animation4Container {
            0% {
                -webkit-transform: rotate(0);
                transform: rotate(0);
            }
            100% {
                -webkit-transform: rotate(360deg);
                transform: rotate(360deg);
            }
        }
        .google-animation-4 {
            -webkit-transform: rotate(45deg);
            transform: rotate(45deg);
            -webkit-animation: Animation4Container 1s ease infinite;
            animation: Animation4Container 1s ease infinite;
        }
        .google-animation-4 .shape {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            position: absolute;
        }
        .google-animation-4 .shape-1 {
            left: 0;
            -webkit-animation: Animation4Shape1 0.3s ease infinite alternate;
            animation: Animation4Shape1 0.3s ease infinite alternate;
        }
        .google-animation-4 .shape-2 {
            right: 0;
            -webkit-animation: Animation4Shape2 0.3s ease infinite 0.3s alternate;
            animation: Animation4Shape2 0.3s ease infinite 0.3s alternate;
        }
        .google-animation-4 .shape-3 {
            bottom: 0;
            -webkit-animation: Animation4Shape3 0.3s ease infinite 0.3s alternate;
            animation: Animation4Shape3 0.3s ease infinite 0.3s alternate;
        }
        .google-animation-4 .shape-4 {
            right: 0;
            bottom: 0;
            -webkit-animation: Animation4Shape4 0.3s ease infinite alternate;
            animation: Animation4Shape4 0.3s ease infinite alternate;
        }
@keyframes Animation5Shape1 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateX(100%);
                transform: translateX(100%);
            }
            50% {
                -webkit-transform: translate(100%, 100%);
                transform: translate(100%, 100%);
            }
            75% {
                -webkit-transform: translate(0, 100%);
                transform: translate(0, 100%);
            }
            100% {
                -webkit-transform: translateX(0);
                transform: translateX(0);
            }
        }
@-webkit-keyframes Animation5Shape1 {
            0% {
                -webkit-transform: translateX(0);
                transform: translateX(0);
            }
            25% {
                -webkit-transform: translateX(100%);
                transform: translateX(100%);
            }
            50% {
                -webkit-transform: translate(100%, 100%);
                transform: translate(100%, 100%);
            }
            75% {
                -webkit-transform: translate(0, 100%);
                transform: translate(0, 100%);
            }
            100% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
        }
@keyframes Animation5Shape2 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateY(100%);
                transform: translateY(100%);
            }
            50% {
                -webkit-transform: translate(-100%, 100%);
                transform: translate(-100%, 100%);
            }
            75% {
                -webkit-transform: translate(-100%, 0);
                transform: translate(-100%, 0);
            }
            100% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
        }
@-webkit-keyframes Animation5Shape2 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateY(100%);
                transform: translateY(100%);
            }
            50% {
                -webkit-transform: translate(-100%, 100%);
                transform: translate(-100%, 100%);
            }
            75% {
                -webkit-transform: translate(-100%, 0);
                transform: translate(-100%, 0);
            }
            100% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
        }
@keyframes Animation5Shape3 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateY(-100%);
                transform: translateY(-100%);
            }
            50% {
                -webkit-transform: translate(100%, -100%);
                transform: translate(100%, -100%);
            }
            75% {
                -webkit-transform: translate(100%, 0);
                transform: translate(100%, 0);
            }
            100% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
        }
@-webkit-keyframes Animation5Shape3 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateY(-100%);
                transform: translateY(-100%);
            }
            50% {
                -webkit-transform: translate(100%, -100%);
                transform: translate(100%, -100%);
            }
            75% {
                -webkit-transform: translate(100%, 0);
                transform: translate(100%, 0);
            }
            100% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
        }
@keyframes Animation5Shape4 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateX(-100%);
                transform: translateX(-100%);
            }
            50% {
                -webkit-transform: translate(-100%, -100%);
                transform: translate(-100%, -100%);
            }
            75% {
                -webkit-transform: translate(0, -100%);
                transform: translate(0, -100%);
            }
            100% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
        }
@-webkit-keyframes Animation5Shape4 {
            0% {
                -webkit-transform: translate(0);
                transform: translate(0);
            }
            25% {
                -webkit-transform: translateX(-100%);
                transform: translateX(-100%);
            }
            50% {
                -webkit-transfor.........完整代码请登录后点击上方下载按钮下载查看

网友评论0