split实现多种文字跳动动画
代码语言:html
所属分类:动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> - Animated Verbs</title>
<link href="https://fonts.googleapis.com/css?family=Lexend+Deca&display=swap" rel="stylesheet">
<style>
* {
box-sizing: border-box;
}
html, body {
height: 100%;
}
.container {
max-height: 100vh;
overflow-y: scroll;
-webkit-perspective: 1000px;
perspective: 1000px;
position: relative;
-ms-scroll-snap-type: y mandatory;
scroll-snap-type: y mandatory;
-webkit-overflow-scrolling: touch;
}
.headline {
align-items: center;
display: flex;
font-family: 'Lexend Deca', sans-serif;
font-weight: 700;
font-size: calc(1rem + 15vmin);
height: 100vh;
justify-content: center;
scroll-snap-align: start;
width: 100vw;
}
.headline:nth-child(1) {
background-color: #f9ca24;
}
.headline:nth-child(2) {
background-color: #3498db;
}
.headline:nth-child(3) {
background-color: #ff7979;
}
.headline:nth-child(4) {
background-color: #1abc9c;
}
.headline:nth-child(5) {
background-color: #e74c3c;
}
.headline:nth-child(6) {
background-color: #f8c291;
}
.char {
-webkit-animation-name: var(--name);
animation-name: var(--name);
-webkit-animation-duration: var(--speed);
animation-duration: var(--speed);
-webkit-animation-delay: var(--delay);
animation-delay: var(--delay);
-webkit-animation-timing-function: var(--ease);
animation-timing-function: var(--ease);
-webkit-animation-direction: var(--direction, normal);
animation-direction: var(--direction, normal);
-webkit-animation-iteration-count: infinite;
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0