css实现文字折叠翻页打开显示动画效果代码
代码语言:html
所属分类:动画
代码描述:css实现文字折叠翻页打开显示动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link href="https://fonts.googleapis.com/css2?family=Rubik:wght@300;400;500&display=swap" rel="stylesheet"> <style> body, html { font-family: "Rubik", sans-serif; font-weight: 500; height: 100%; text-align: center; font-size: min(12vh, 12vw); justify-content: space-around; background-color: #f4faff; background: radial-gradient(#f4faff, #d7e6eb); --color-tiktok-blue: rgb(111, 239, 233); --color-tiktok-red: rgb(234, 51, 84); --color-mint: rgb(197, 246, 207); --color-mint-dark: rgb(98, 240, 153); --jiggle-duration: 1000ms; --jiggle-delay: 200ms; --fold-slide-duration: 1000ms; --fold-slide-delay: 0ms; --fold-duration: 1500ms; --fold-delay: 200ms; } [data-line] { cursor: pointer; padding: calc(12.5vh - 0.125em) 0; white-space: nowrap; } [data-line][data-line="1"] { padding-top: calc(25vh - 0.25em); } [data-text=jiggle] { position: relative; z-index: 1; } [data-text=jiggle]:before, [data-text=jiggle]:after { content: attr(data-text); position: absolute; left: 0; top: 0; z-index: -1; } [data-text=jiggle]:before { animation: jiggle-before var(--jiggle-duration) ease-in-out infinite var(--jiggle-delay); color: var(--color-tiktok-blue); } [data-text=jiggle]:after { animation: jiggle-after var(--jiggle-duration) ease-in-out infinite var(--jiggle-delay); color: var(--color-tiktok-red); } @keyframes jiggle-before { 20% { left: -5px; top: -5px; } 40% { left: 3px; top: 3px; } 60% { left: -2px; top: -2px; } } @keyframes jiggle-after { 20% { left: 5px; top: 5px; } 40% { left: -3px; top: -3px; } 60% { left: 2px;.........完整代码请登录后点击上方下载按钮下载查看
网友评论0