纯css实现乌龟吃饼loading加载动画效果代码

代码语言:html

所属分类:加载滚动

代码描述:纯css实现乌龟吃饼loading加载动画效果代码

代码标签: 乌龟 吃饼 loading 加载 动画 效果

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


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">
  

  
  
  
<style>
body {
            height: 100vh;
            margin: 0;
            display: flex;
            justify-content: center;
            align-items: center;
            --anim-speed: 3s;
            --color-background: #cfffcd;
            --color-skin: #eea51e;
            --color-toe: #af760c;
            --color-shell-1: #6b4d15;
            --color-shell-2: #af760c;
            --color-shell-3: #d18e10;
            --color-shell-4: #eea51e;
            --color-eye: #4b350c;
            --color-leaf-1: #02fa02;
            --color-leaf-2: #59b70f;

        }
        
        .tortoise-loader {
            overflow: hidden;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: space-between;
            background: var(--color-background);
            width: 100px;
            height: 100px;
            border: 6px solid var(--color-shell-1);
            border-radius: 10px;
        }

        .tortoise {
            display: flex;
            width: 100%;
            justify-content: center;
            z-index: 1;
        }

        .tortoise-shell {
            width: 80px;
            height: 40px;
            border: 5px solid var(--color-shell-1);
            box-shadow: inset 0px -8px var(--color-shell-2), inset 0px -16px var(--color-shell-3);
            background: var(--color-shell-4);
            border-top: none;
            position: absolute;
            border-radius: 0 0 100px 100px;
        }

        @keyframes bite {
            from { transform: translateY(0px) }
            to { transform: translateY(15px) }
        }

        .tortoise-head {
            width: 30px;
            height: 50px;
            background: var(--color-skin);
            border-radius: 0 0 100px 100px;
            animation: calc(var(--anim-speed)*0.25) bite infinite cubic-bezier(.77,.22,.21,.91) alternate;
        }

        .tortoise-head::before {
            content: '';
            height: 20px;
            width: 20px;
            background: var(--color-skin);
            position: absolute;
            transform: translate(5px, 30px) rotate(45deg);
        }

        .tortoise-head::after {
            content: '';
            height: 5px;
            width: 4px;
            background: var(--color-eye);
            position: absolute;
            border-radius: 50%;
            transform: translate(6px, 38px);
            box-shadow: 14px 0px var(--color-eye);
        }

        .tortoise-leg {
            width: 23px;
            height: 40px;
            background: var(--color-skin);
            border-radius: 10px;
            animation: calc(var(--anim-speed)*0.25) legAnim infinite cubic-bezier(.77,.22,.21,.91) alternate;
        }

        .tortoise-leg::before {
            content: '';
            width: 6px;
            height: 8px;
            background: var(--color-toe);
            position: absolute;
            transform: translate(16px, 33px);
            border-radius: 50%;
            box-shadow: -7px 0 var(--color-toe), -.........完整代码请登录后点击上方下载按钮下载查看

网友评论0