Those3DTexts实现文字三维伸缩动画效果代码

代码语言:html

所属分类:三维

代码描述:Those3DTexts实现文字三维伸缩动画效果代码

代码标签: Those3DTexts 文字 三维 伸缩 动画

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

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

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

  
  
<style>
/* T3DTL needs some CSS to work */
@import url("https://cdn.skypack.dev/that-3d-text-library/lib/styles.css");

/* A nice font for the headings. T3DTL works better with chunkier fonts. */
@import url("https://fonts.googleapis.com/css2?family=Lilita+One&display=swap");

/* A little setup to have the text center of the page */
html {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  width: calc(100% - 2em);
  height: calc(100% - 2em);
  padding: 1em;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e4f9f2;
  perspective: 700px;
}

/* Apply the font to all headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Lilita One", cursive;
  font-weight: 400;
  font-size: 10em;
}

/* Hide the text while T3DTL sets things up */
[data-3d-text] {
  opacity: 0;
}

[data-text-ready] {
  opacity: 1;
}

/* DEMO SPECIFIC CSS */

h1 {
  --color-front: #bb66ff;

  /* --z: calc(15 + (var(--sin, 0) + var(--index)) * 15); */
  --layers: 5;
  transform: rotateX(45deg);
  color: #4422aa;
}

[data-index="0"] {
  --color: hsl(calc(360deg * (var(--sin-0) * 0.12)), 50%, 30%);
  --color-front: hsl(calc(360deg * (var(--sin-0) * 0.12)), 90%, 70%);
  --depth: calc(20 + var(--sin-0, 0) * 15);
  --z: calc(1 + (var(--sin-0, 0) + 1) * 20);
}
[data-index="1"] {
  --color: hsl(calc(360deg * (var(--sin-1) * 0.12)), 50%, 30%);
  --color-front: hsl(calc(360deg * (var(--sin-1) * 0..........完整代码请登录后点击上方下载按钮下载查看

网友评论0