纯css+svg实现小鹿效果

代码语言:html

所属分类:布局界面

代码描述:纯css+svg实现小鹿效果

代码标签: 小鹿 效果

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


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

<style>
body {
    margin: 0;
    height: 100vh;
    background-color: #666;
    display: flex;
    justify-content: center;
    align-items: center;
}

svg {
    width: 95vmin;
    animation: floating 1s ease-in-out infinite alternate;
}

@keyframes floating {
    0% {
        transform: translatey(0);
    }
    100% {
        transform: translatey(5%);
    }
}

.ab_eye_lids {
    animation: blink 4s ease-in-out infinite;
}

@keyframes blink {
    0% {
        cy: 90.94;
    }
    10% {
        cy: 117.62;
    }
    20%, 100% {
        cy: 90.94;
    }
}
</style>

</head>
<body translate="no">
<svg version="1.1" viewBox="0 0 299.87 217.62" xmlns="http://www.w3.org/2000/svg">
<g id="antibody">
<path id="ab_body" d="m162.45 205.12c0 6.9036-5.5964 12.5-12.5 12.5s-12.5-5.5964-12.5-12.5l1e-5 -50-46.339-46.339 17.678-17.678 41.161 41.161 41.161-41.161 17.678 17.678-46.339 46.339z" fill="#ffff00" fill-rule="evenodd" stroke-width=".26458" />
<path id="ab_left_arm" d="m90.259 59.633a25 25 0 0 1 18.434 26.327 25 25 0 0 1-22.726 22.726 25 25 0 0 1-26.327-18.434" fill="none" stroke="#ffcc00" stroke-linecap="round" stroke-width="17.5" />
<path id="ab_left_inner_arm" d="m83.789 83.781 16.161-1.5165 8.8388 8.8388-17.678 17.678-8.8388-8.8388 1.5165-16.161" fill="#ffcc00" />
<path id="ab_right_arm" d="m209.64 59.633a25 25 0 0 0-18.434 26.327 25 25 0 0 0 22.726 22.726 25 25 0 0 0 26.327-18.434" fill="none" stroke="#ffcc00" stroke-linecap="round" stroke-width="17.5" />
<path id="ab_right_inner_arm" d="m216.11 83.781-16.161-1.5165-8.8388 8.8388 17.678 17.678 8.8388-8.8388-1.5165-16.161" fill="#ffcc00" />
<circle id="ab_right_eye" cx="182.27" cy="117.62" r="8.8388" fill="#000000" stroke="#0000ff" stroke-linecap="round" stroke-width="2" />
<circle id="ab_left_eye" cx="117.63" cy="117.62" r="8.8388" fill="#000000" stroke="#0000ff" stroke-linecap="round" stroke-width="2" />
<circle id="ab_right_inner_eye" cx="180.06" cy="115.41" r="2.2097" fill="#ffffff" />
<circle id="ab_left_inner_eye" cx="115.42" cy="115.41" r="2.2097" fill="#ffffff" />
</g>
<g id="right_antigen" transform="translate(49.95,55.12)">
<g fill="#800000">
<path id="ag_r_bottom_left_arm" d="m150.08 27.055a16.161 16.161 0 0 1 16.699-14.543 16.161 16.161 0 0 1 15.539 15.776 16.161 16.161 0 0 1-14.793 16.477l-1.3637-16.104z" stroke-linecap="round" stroke-width="2" />
<path id="ag_r_bottom_left_inner_arm" d="m169.06 16.919 17.678-17.678 8.8388 8.8388-17.678 17.678z" />
<path id="ag_r_body" d="m217.68-4.9546a17.678 17.678 0 0 1-17.882 17.453 17.678 17.678 0 0 1-17.471-17.864 17.678 17.678 0 0 1 17.847-17.489 17.678 17.678 0 0 1 17.507 17.829" />
<path id="ag_r_bottom_right_arm" transform="scale(-1,1)" d="m-249.77 27.112a16.161 16.161 0 0 1 16.699-14.543 16.161 16.161 0 0 1 15.539 15.776 16.161 16.161 0 0 1-14.793 16.477l-1.3637-16.104z" stroke-linecap="round" stroke-width="2" />
<path id="ag_r_bottom_right_inner_arm" d="m230.78 16.977-17.678-17.678-8.8388 8.8388 17.678 17.678z" />
 <path id="ag_r_top_left_arm" transform="scale(1,-1)" d="m150.23 37.352a16.161 16.161 0 0 1 16.699-14.543 16.161 16.161 0 0 1 15.539 15.776 16.161 16.161 0 0 1-14.793 16.477l-1.3637-16.104z" stroke-linecap="round" stroke-width="2" />
<path id="ag_r_top_left_inner_arm" d="m169.22-27.217 17.678 17.678 8.8388-8.8388-17.678-17.678z" />
<path id="ag_r_top_right_arm" transform="scale(-1)" d="m-249.92 37.41a16.161 16.161 0 0 1 16.699-14.543 16.161 16.161 0 0 1 15.539 15.776 16.161 16.161 0 0 1-14.793 16.477l-1.3637-16.104z" stroke-linecap="round" stroke-width="2" />
<path id="ag_r_top_right_inner_arm" d="m230.94-27.275-17.678 17.678-8.8388-8.8388 17.678-17.678z" />
</g>
<path id="ag_r_left_eye" d="m204.42-13.961a4.4194 4.4194 0 0 1-4.4704 4.3634 4.4194 4.4194 0 0 1-4.3678-4.4661 4.4194 4.4194 0 0 1 4.4617-4.3723 4.4194 4.4194 0 0 1 4.3767 4.4574" fill="#ffffff" stroke="#ff0000" stroke-linecap="round" />
<path id="ag_r_right_eye" d="m213.26-5.1219a4.4194 4.4194 0 0 1-4.4704 4.3634 4.4194 4.4194 0 0 1-4.3678-4.4661 4.4194 4.4194 0 0 1 4.4617-4.3723 4.4194 4.4194 0 .........完整代码请登录后点击上方下载按钮下载查看

网友评论0