div+css实现文本文字三维翻转动画效果代码

代码语言:html

所属分类:动画

代码描述:div+css实现文本文字三维翻转动画效果代码

代码标签: div css 文本 文字 三维 翻转 动画

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

<!DOCTYPE html>
<html lang="zh-CN">

<head>

  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">

<style>
    * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* 解决手机浏览器点击有选框的问题 */
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);

  font-family: "阿里巴巴普惠体";
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;

  min-height: 100vh;
  background-color: #333;
}

.box {
  width: 100%;
  height: 350px;

  position: relative;

  transform-style: preserve-3d;
}
.box div {
  width: 100%;
  height: 100%;

  position: absolute;

  transform-style: preserve-3d;

  animation: animate 24s linear infinite;
}
@keyframes animate {
  0% {
    transform: perspective(1000px) rotateX(0deg);
  }
  100% {
    transform: perspective(1000px) rotateX(360deg);
  }
}

.box div span {
  inset: 0;

  position: absolute;

  transform: rotateX(calc(var(--i) * 15deg));
}
.box div span::before {
  content: "BFW.WIKI";

  width: 100%;
  height: 100%;
  text-align: center;
  color: #fffd;
  font-size: 8em;
  font-weight: 800;
  text-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  -webkit-text-stroke: 2px #000;

  position: absolute;
}
.box div span:nth-child(3n + 2):before {
  color: #e3f2fddd;
}
.box div span:nth-child(3n + 3):before {
  color: #fce4ecdd;
}

</style>

</head>

<body>

  <div c.........完整代码请登录后点击上方下载按钮下载查看

网友评论0