大数跨境
0
0

可爱的小狗(可复制源代码)

可爱的小狗(可复制源代码) 趣聊科技圈
2024-09-28
1

效果演示

html 代码

<link rel="stylesheet" href="index.css">
<div class="dog">
  <div class="dog-body">
    <div class="dog-tail"><div class="dog-tail"><div class="dog-tail"><div class="dog-tail"><div class="dog-tail"><div class="dog-tail"><div class="dog-tail"><div class="dog-tail"></div></div></div></div></div></div></div></div></div>
  <div class="dog-torso"></div>
  <div class="dog-head">
    <div class="dog-ears"><div class="dog-ear"></div><div class="dog-ear"></div></div><div class="dog-eyes"><div class="dog-eye"></div><div class="dog-eye"></div></div><div class="dog-muzzle"><div class="dog-tongue"></div></div>
  </div>
</div>

css 代码

@-webkit-keyframes bounce{from{transform:scale(2);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;}to{transform:scale(0.8);-webkit-animation-timing-function:cubic-bezier(0,0,0,1);animation-timing-function:cubic-bezier(0,0,0,1);}}@keyframes bounce{from{transform:scale(2);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;}to{transform:scale(0.8);-webkit-animation-timing-function:cubic-bezier(0,0,0,1);animation-timing-function:cubic-bezier(0,0,0,1);}}@-webkit-keyframes bounce-shadow{from{transform:scale(2.5,2.6)translateY(-50%);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;}to{transform:scale(0.5)translateY(0);-webkit-animation-timing-function:cubic-bezier(0,0,0,1);animation-timing-function:cubic-bezier(0,0,0,1);}}@keyframes bounce-shadow{from{transform:scale(2.5,2.6)translateY(-50%);-webkit-animation-timing-function:ease-in;animation-timing-function:ease-in;}to{transform:scale(0.5)translateY(0);-webkit-animation-timing-function:cubic-bezier(0,0,0,1);animation-timing-function:cubic-bezier(0,0,0,1);}}.dog{width:100px;height:100px;z-index:1;}.dog:before{content:"";display:block;position:absolute;width:100%;height:100%;border-radius:50%;background:rgba(0,0,0,0.03);transform:translateY(-30%)scale(1.5);}.dog *{position:absolute;}.dog-body{top:-50%;-webkit-animation:dog-body 200ms ease-in-out infinite alternate;animation:dog-body 200ms ease-in-out infinite alternate;}.dog-body:before{content:"";position:absolute;bottom:90%;right:50%;width:90%;height:90%;border-top-left-radius:100%;border-bottom-left-radius:10%;border-top-right-radius:10%;background:rgba(255,255,255,0.4);transform-origin:right bottom;-webkit-animation:dog-tail-blur 200ms 33.3333333333ms ease-in-out infinite alternate both;animation:dog-tail-blur 200ms 33.3333333333ms ease-in-out infinite alternate both;}@-webkit-keyframes dog-tail-blur{from{transform:rotate(0);opacity:0;}50%{opacity:1;}to{transform:rotate(90deg);opacity:0;}}@keyframes dog-tail-blur{from{transform:rotate(0);opacity:0;}50%{opacity:1;}to{transform:rotate(90deg);opacity:0;}}@-webkit-keyframes dog-body{from{transform:translateX(-10%);}to{transform:translateX(10%);}}@keyframes dog-body{from{transform:translateX(-10%);}to{transform:translateX(10%);}}.dog-head{-webkit-animation:dog-head 1800ms cubic-bezier(0.11,0.79,0,0.99) infinite;animation:dog-head 1800ms cubic-bezier(0.11,0.79,0,0.99) infinite;}@-webkit-keyframes dog-head{from,to{transform:rotate(45deg);}33.3%{transform:rotate(-45deg);}66.6%{transform:rotate(0);}}@keyframes dog-head{from,to{transform:rotate(45deg);}33.3%{transform:rotate(-45deg);}66.6%{transform:rotate(0);}}.dog-torso{top:-20%;animation:dog-torso 200ms ease-in-out infinite alternate-reverse;}@-webkit-keyframes dog-torso{from{transform:translateX(-5%);}to{transform:translateX(5%);}}@keyframes dog-torso{from{transform:translateX(-5%);}to{transform:translateX(5%);}}.dog-eyes{width:60%;top:55%;left:20%;z-index:1;}.dog-eyes:before{content:"";display:block;height:40px;width:40px;border-radius:40px;position:absolute;background:rgb(6,221,46);top:-10px;left:-10px;z-index:0;border:4px solid rgb(198,11,231);border-left-width:0;border-bottom-width:0;border-top-width:0;transform:rotate(-45deg);}
  .dog-eye {width10px;height10px;border-radius50%;background#000;z-index1;-webkit-animation: dog-eye 1800ms infinite;animation: dog-eye 1800ms infinite;}
  @-webkit-keyframes dog-eye {fromto {-webkit-animation-timing-function: step-end;animation-timing-function: step-end;opacity1;}50%, 55% {-webkit-animation-timing-function: step-start;animation-timing-function: step-start;opacity0;}}
  @keyframes dog-eye {fromto {-webkit-animation-timing-function: step-end;animation-timing-function: step-end;opacity1;}50%, 55% {-webkit-animation-timing-function: step-start;animation-timing-function: step-start;opacity0;}}
  .dog-eye:first-child {left0;}
  .dog-eye:last-child {right0;}
  .dog-muzzle {width60%;left20%;height50%;border-bottom-left-radius100%;border-bottom-right-radius100%;backgroundrgb(9167206);bottom: -15%;}
  .dog-muzzle:before.dog-muzzle:after {content"";display: block;position: absolute;}
  .dog-muzzle:before {width6px;height20px;bottom0;leftcalc(50% - 3px);background#EAEBEC;}
  .dog-muzzle:after {background: black;width20px;height15px;bottom12px;leftcalc(50% - 10px);border-bottom-left-radius60% 60%;border-bottom-right-radius60% 60%;border-top-left-radius50% 40%;border-top-right-radius50% 40%;}
  .dog-tongue {width40px;height100%;leftcalc(50% - 20px);z-index: -1;transform-origin: center top;-webkit-animation: dog-tongue 1800ms -50ms ease-in-out infinite;animation: dog-tongue 1800ms -50ms ease-in-out infinite;}
  @-webkit-keyframes dog-tongue {fromto {transformrotate(0);}16.6666666667% {transformrotate(30deg);}33.3333333333%, 66.6666666667% {transformrotate(0);}50%, 83.3333333333% {transformrotate(-20deg);}}
  @keyframes dog-tongue {fromto {transformrotate(0);}16.6666666667% {transformrotate(30deg);}33.3333333333%, 66.6666666667% {transformrotate(0);}50%, 83.3333333333% {transformrotate(-20deg);}}
  .dog-tongue:before {content"";position: absolute;display: block;width100%;height100%;border-radius40px;background#FD3163;-webkit-animation: dog-tongue-inner 100ms ease-in-out infinite alternate;animation: dog-tongue-inner 100ms ease-in-out infinite alternate;}
  @-webkit-keyframes dog-tongue-inner {from {transformtranslateY(5%);}to {transformtranslateY(22%);}}
  @keyframes dog-tongue-inner {from {transformtranslateY(5%);}to {transformtranslateY(22%);}}
  .dog-ears {width40%;top25%;left30%;-webkit-animation: dog-ears 1800ms 100ms ease infinite;animation: dog-ears 1800ms 100ms ease infinite;}
  @-webkit-keyframes dog-ears {42.3%, 71.6% {transformrotate(-5deg);}50.3%, 79.6% {transformrotate(5deg);}5% {transformrotate(5deg);}12% {transformrotate(-5%);}from, 33.3%, 66%, to {transformrotate(0);}}
  @keyframes dog-ears {42.3%, 71.6% {transformrotate(-5deg);}50.3%, 79.6% {transformrotate(5deg);}5% {transformrotate(5deg);}12% {transformrotate(-5%);}from, 33.3%, 66%, to {transformrotate(0);}}
  .dog-ear {bottom: -10px;height50px;width50px;background#EAEBEC;-webkit-animation-duration400ms;animation-duration400ms;-webkit-animation-direction: alternate;animation-direction: alternate;-webkit-animation-timing-function: ease-in-out;animation-timing-function: ease-in-out;-webkit-animation-fill-mode: both;animation-fill-mode: both;-webkit-animation-iteration-count: infinite;animation-iteration-count: infinite;}
  .dog-ear:first-child {border-bottom-left-radius80%;border-top-right-radius80%;right100%;box-shadow: inset -15px 15px 0 1px white;transform-origin: right bottom;transformrotate(10deg);}
  .dog-ear:last-child {border-top-left-radius80%;border-bottom-right-radius80%;left100%;box-shadow: inset 15px 15px 0 0 white;transform-origin: left bottom;transformrotate(-10deg);}
  .dog-tail {width22px;height24.2px;background: white;bottom40%;border-radius11px;leftcalc(50% - 11px);transform-origin: center bottom;}
  .dog-tail .dog-tail {-webkit-animation: dog-tail-segment 200ms ease-in-out infinite alternate;animation: dog-tail-segment 200ms ease-in-out infinite alternate;}
  @-webkit-keyframes dog-tail-segment {from {transformrotate(-10deg);}to {transformrotate(10deg);}}
  @keyframes dog-tail-segment {from {transformrotate(-10deg);}to {transformrotate(10deg);}}
  .dog-body > .dog-tail {bottom90%;-webkit-animation: dog-tail 200ms ease-in-out infinite alternate;animation: dog-tail 200ms ease-in-out infinite alternate;}
  @-webkit-keyframes dog-tail {from {transformrotate(-45deg);}to {transformrotate(45deg);}}
  @keyframes dog-tail {from {transformrotate(-45deg);}to {transformrotate(45deg);}}.dog-body,.dog-torso,.dog-head {border-radius50%;background: white;position: absolute;height100%;width100%;}.dog-body.dog-torso {box-shadow: inset 0 -15px 0 0 #EAEBEC;}body {display: flex;flex-direction: column;justify-content: center;align-items: center;}htmlbody {background#43cce1;width100%;height100%;margin0;padding0;}*, *:before, *:after {box-sizing: border-box;position: relative;}


【声明】内容源于网络
0
0
趣聊科技圈
🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
内容 511
粉丝 0
趣聊科技圈 🧐探索科技,发现乐趣。🤩带你玩遍科技好物!
总阅读63
粉丝0
内容511