TweenMax+svg+snap实现文字字母拆分合并显示动画效果代码
代码语言:html
所属分类:动画
代码描述:TweenMax+svg+snap实现文字字母拆分合并显示动画效果代码
代码标签: TweenMax svg snap 文字 字母 拆分 合并 显示 动画
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @import 'https://fonts.googleapis.com/css?family=Catamaran'; html, body, .background { width: 100%; height: 100%; } .background { position: relative; background: linear-gradient(120deg, rgba(50, 150, 100, 0.6), rgba(0, 0, 100, 0)); } .background:before, .background:after { position: absolute; content: " "; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, rgba(0, 0, 200, 0.6), rgba(0, 0, 200, 0)); } .background:after { background: linear-gradient(240deg, rgba(150, 50, 50, 0.6), rgba(0, 0, 200, 0)); } html, body { width: 100%; height: 100%; margin: 0; padding: 0; font-family: "Catamaran", sans-serif; } body { background: #eeeeff; } .container { display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0; padding: 0; height: 100%; width: 100%; } svg { z-index: 10; } svg .letter { fill: none; stroke: #fff; stroke-width: 5; stroke-miterlimit: 10; } .blinky-mcblinkface { -webkit-animation: 1s blink step-end infinite; animation: 1s blink step-end infinite; } @-webkit-keyframes "blink" { from, to { opacity: 0; } 50% { opacity: 1; } } @keyframes "blink" { from, to { opacity: 0; } 50% { opacity: 1; } } #toggle { position: fixed; top: 10px; left: 10px; z-index: 100; } #toggle a { color: white; text-decoration: none; } #toggle a:hover { color: #eee; } </style> </head> <body> <!-- partial:index.partial.html --> <div class="container background"> <svg id="svg"> <defs> <g id="letter-z"> <path class="letter" d="M16.3,24.5l-29.1-2.1l29.1-39.5h-29.1"/> </g> <g id="letter-y"> <path class="letter" d="M-11.8-14.2L5.9,1.4"/> <path class="letter" d="M15.2-20.9L-5.3,28.3"/> </g> <g id="letter-x"> <path class="letter" d="M18.8-10.5l-34.2,35.4"/> <path class="letter" d="M-11-19.5l26.7,46.4"/> </g> <g id="letter-w"> <path class="letter" d="M22.8-14.4L7.4,21.7L-2.4,7.6l-10.2,14.1l-6.8-34"/> </g> <g id="letter-v"> <path class="letter" d="M16.1-16.3l-13.5,40l-15.2-40"/> </g> <g id="l.........完整代码请登录后点击上方下载按钮下载查看
网友评论0