div+css实现三维狗圈旋转动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现三维狗圈旋转动画效果代码

代码标签: div css 三维 狗圈 旋转 动画

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

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

<head>
  <meta charset="UTF-8">
  

  
<style>
@charset "UTF-8";
@import url("https://fonts.googleapis.com/css2?family=Noto+Color+Emoji&display=swap");
div {
  transform-style: preserve-3d;
  box-sizing: padding-box;
}

body {
  font-family: "Victor Mono", monospace;
  font-size: 7vmin;
  background-color: #F9F6EF;
  color: #1f2020;
  display: grid;
  place-content: center;
  min-height: 100svh;
  min-height: 100vh;
  margin: 0;
  perspective: 1000px;
}

.cont {
  text-transform: uppercase;
  width: 50vmin;
  height: 50vmin;
  border-radius: 100vmax;
  position: relative;
  animation: z360 10s linear infinite;
}

.ac {
  position: absolute;
  offset-path: border-box;
  offset-distance: calc(var(--i) / var(--tc) * 100%);
  transform: rotatex(90deg);
  background-color: #f3d060;
  border: 1px solid #f3d060;
  border-width: 1px 1vmin;
  text-shadow: 0.025em 0.025em 0 #fff;
}
.ac:before {
  content: "";
  position: absolute;
  inset: -0.5px -0.55vmin;
  backdrop-filter: invert(100%);
  transform: translatez(-1px);
}
.ac:after {
  content: "";
  position: absolute;
  inset: -3px -1vmin;
  border-style: solid;
  border-color: #000 #f3d060;
  border-width: 5px 1px;
}

@keyframes z360 {
  0% {
    transform: rotatex(-125deg) rotatez(0deg);
  }
  50% {
    transform: rotatex(-60deg) rotatez(-180deg);
  }
  100% {
    transform: rotatex(-125deg) rotatez(-360deg);
  }
}
.cont:before, .cont:after {
  font-family: "Noto Color Emoji", sans-serif;
  transform-style: preserve-3d;
  content: "💠";
  position: absolute;
  font-size: 18vmin;
  color: #e4e4e2;
  transform: translatey(-2.5vmin) rotatey(90deg) rotatex(calc(-720deg / var(--tc))) translatex(-0.73lh) translatez(calc(-4vmin + 1px));
}
.cont:after {
  color: #dfccb7;
  filter: sepia(50%);
  transform: translatey(-2.5vmin) rotatey(90deg) rotatex(calc(-720deg / var(--tc))) translatex(-0.7lh) translatez(-4vmin);
}
</style>


  
</head>

<body translate="no">
  <div class="cont" style="--tc:29&quo.........完整代码请登录后点击上方下载按钮下载查看

网友评论0