gsap+splitting实现字母拆分三维立体旋转动画效果代码

代码语言:html

所属分类:三维

代码描述:gsap+splitting实现字母拆分三维立体旋转动画效果代码

代码标签: gsap splitting 字母 拆分 三维 立体 旋转 动画

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

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

<head>
  <meta charset="UTF-8">
  
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/splitting.css">
<link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/splitting-cells.css">
  
<style>
* {
	padding: 0;
	margin: 0;
	box-sizing: border-box;
}
body {
	display: grid;
	place-items: center;
	height: 100vh;
	background-color: #141414;
}

.rotate-point {
	position: relative;
	width: 10px;
	height: 10px;
	perspective: 250px;
}

.carousel {
	transform-style: preserve-3d;
	transform: rotateY(0deg) rotateX(20deg);
	animation: rotate 20s infinite linear;
}

.cell {
	position: absolute;
	display: grid;
	place-items: center;
	font-size: 5vw;
	text-align: center;
	font-weight: 900;
	color: #dfff00;
	text-transform: uppercase;
	backface-visibility: visible;
	transform: rotateY(calc(var(--i) * 17deg)) translateZ(150px);
}

@keyframes rotate {
	100% {
		transform: rotateY(-360deg) rotateX(20deg);
	}
}
</style>


  
  
</head>

<body translate="no">
  <!-- If anyone can enlighten me as to why the letter I is slightly offset I'd be grateful -->

<div class="rotate-point">
	<div class="carousel">
		<div class="cell" style="--i: 0;">r</div>
		<div class="cell" style="--i: 1;">o</div>
		<div class="cell" style="--i: 2;">t</div>
		<div class=.........完整代码请登录后点击上方下载按钮下载查看

网友评论0