html+css: 打招呼的卡比兽动画

 

body

<div class="snorlax">
  <div class="snorlax__head">
    <div class="snorlax__head-outline"></div>
    <div class="snorlax__ear snorlax__ear--left"></div>
    <div class="snorlax__ear snorlax__ear--right"></div>
    <div class="snorlax__brow snorlax__brow--left"></div>
    <div class="snorlax__brow snorlax__brow--right"></div>
    <div class="snorlax__eye snorlax__eye--left"></div>
    <div class="snorlax__eye snorlax__eye--right"></div>
    <div class="snorlax__mouth">
      <div class="snorlax__tooth snorlax__tooth--left"></div>
      <div class="snorlax__tooth snorlax__tooth--right"></div>
    </div>
  </div>
  <div class="snorlax__arm-left">
    <div class="snorlax__arm-wrapper">
      <div class="snorlax__claws--left"></div>
      <div class="snorlax__arm-left-arm"></div>
    </div>
  </div>
  <div class="snorlax__arm-right">
    <div class="snorlax__claws--right"></div>
    <div class="snorlax__arm-right-arm"></div>
    <div class="snorlax__claw"></div>
  </div>
  <div class="snorlax__body">
    <div class="snorlax__body-shade"></div>
    <div class="snorlax__belly">
      <div class="snorlax__belly-segment snorlax__belly-segment--one"></div>
      <div class="snorlax__belly-segment snorlax__belly-segment--two"></div>
    </div>
  </div>
  <div class="snorlax__left-foot">
    <div class="snorlax__left-foot-foot"></div>
    <div class="snorlax__foot-claw snorlax__foot-claw--one">
      <div></div>
    </div>
    <div class="snorlax__foot-claw snorlax__foot-claw--two">
      <div></div>
    </div>
    <div class="snorlax__foot-claw snorlax__foot-claw--three">
      <div></div>
    </div>
  </div>
  <div class="snorlax__right-foot">
    <div class="snorlax__right-foot-foot"></div>
    <div class="snorlax__foot-claw snorlax__foot-claw--four">
      <div></div>
    </div>
    <div class="snorlax__foot-claw snorlax__foot-claw--five">
      <div></div>
    </div>
    <div class="snorlax__foot-claw snorlax__foot-claw--six">
      <div></div>
    </div>
  </div>
</div>

 

css

*,
*:after,
*:before {
  box-sizing: border-box;
}
:root {
  --size: 60;
  --unit: calc((var(--size) / 300) * 1vmin);
  --belly: #f1debb;
  --dark-belly: #b59c78;
  --body: #355a50;
  --dark-body: #162c37;
  --foot: #965b3c;
  --claws: #fafafa;
}
body {
  min-height: 100vh;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  background: #177082;
  -webkit-box-pack: center;
          justify-content: center;
}
.snorlax {
  height: calc(237 * var(--unit));
  width: calc(300 * var(--unit));
  position: relative;
}
.snorlax *,
.snorlax *:after,
.snorlax *:before {
  position: absolute;
}
.snorlax:before {
  content: '';
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 20%;
  border-radius: 50%;
  -webkit-filter: blur(10px);
          filte
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值