split实现文字路径环绕动画

代码语言:html

所属分类:动画

代码描述:split实现文字路径环绕动画,结合d3实现

代码标签: 路径 环绕 动画

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

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="http://repo.bfw.wiki/bfwrepo/css/splitting.css">
<style>
@import url("https://fonts.googleapis.com/css?family=Lato&display=swap");
* {
  box-sizing: border-box;
}
body {
  background: #0d0d0d;
  min-height: 100vh;
  display: -webkit-box;
  display: flex;
  -webkit-box-align: center;
          align-items: center;
  -webkit-box-pack: center;
          justify-content: center;
  font-family: 'Lato', sans-serif;
}
.container {
  height: 60vmin;
  position: relative;
  width: 60vmin;
}
.char {
  --delay: calc(((var(--char-total) - var(--char-index))) - var(--word-index));
  offset-path: path(var(--path));
  -webkit-animation: travel 6s calc((var(--delay) * (0.15)) * -1s) infinite linear both;
          animation: travel 6s calc((var(--delay) * (0.15)) * -1s) infinite linear both;
  offset-rotate: auto 180deg;
  position: absolute !important;
  font-size: 4vmin;
  font-weight: bold;
  top: 0%;
  left: 0%;
  -webkit-transform: translate(0, -0.5vmin);
          transform: translate(0, -0.5vmin);
  color: #f2f2f2;
}
svg {
  height: 100%;
  width: 100%;
}
path {
  stroke: hsla(var(--hue, 0), 100%, 50%, 0.25);
  stroke-width: 0.25px;
}
.gradient {
  height: 0;
  width: 0;
}
@-webkit-keyframes travel {
  from {
    offset-distance: 0%;
  }
  .........完整代码请登录后点击上方下载按钮下载查看

网友评论0