gsap实现文字字母跳动动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap实现文字字母跳动动画效果代码

代码标签: gsap 文字 字母 跳动 动画

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

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

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

  
<style>
/* Reset and base styles */
html,
body {
	padding: 0;
	margin: 0;
	height: 100%;
	background: radial-gradient(circle, #111, #000);
	overflow: hidden;
}

body {
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 100vh;
	perspective: 1000px;
}

/* Grid layout */
.grid {
	display: grid;
	grid-template-columns: repeat(15, 1fr);
	grid-template-rows: repeat(15, 1fr);
	gap: 10px;
	width: 90vmin;
	height: 90vmin;
	transform-style: preserve-3d;
}

/* Grid cells */
.cell {
	background: rgba(255, 255, 255, 0.1);
	border: 1px solid rgba(255, 255, 255, 0.05);
	border-radius: 5px;
	transition: transform 0.3s ease, background 0.3s ease;
	cursor: pointer;
	box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.cell:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.1) rotateX(10deg) rotateY(10deg);
	box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

/* Text container */
.text-container {
	position: absolute;
	top: 10%;
	left: 50%;
	transform: translateX(-50%);
	text-align: center;
	z-index: 10;
}

/* Text animation */
h1 {
	font-size: 6rem;
	color: white;
	font-family: "Arial", sans-serif;
	text-transform: uppercase;
	margin: 0;
	text-shadow: 0 0 10px rgba(255, 255, 255, 0.8),
		0 0 20px rgba(255, 255, 255, 0.6);
}

[data-splitting] .char {
	display: inline-block;
	animation: dance 2s infinite ease-in-out;
	animation-delay: calc(0.1s * var(--char-index));
}

@keyframes dance {
	0%,
	1.........完整代码请登录后点击上方下载按钮下载查看

网友评论0