css实现签名动画效果
代码语言:html
所属分类:动画
代码描述:css实现签名动画效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> @-webkit-keyframes letters { 100% { stroke-dashoffset: -3351; } } @keyframes letters { 100% { stroke-dashoffset: -3351; } } @-webkit-keyframes turning { 48% { -webkit-transform: rotate(0); transform: rotate(0); } 50%, 98% { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } } @keyframes turning { 48% { -webkit-transform: rotate(0); transform: rotate(0); } 50%, 98% { -webkit-transform: rotate(-45deg); transform: rotate(-45deg); } } body { background-color: #01003a; display: -webkit-box; display: flex; height: 100vh; -webkit-box-pack: center; justify-content: center; -webkit-box-align: center; align-items: center; } .letters-path { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: var(--length) calc(var(--length) * 2); stroke-dashoffset: var(--length); -webkit-animation: letters 6s infinite ease-out; animation: letters 6s infinite ease-out; } .letters-path--back { stroke: #fff; stroke-width: 12; -webkit-transform: scale(0.6) translateY(20vh) translateX(25vh); transform: scale(0.6) translateY(20vh) translateX(25vh); } .letters-path-1 { stroke: #fff; stroke-width: 2; } .letter-s { width: 70vh; height: 70vh; position: relative; } .letter-s__background { width: 100%; height: 100%; -webkit-animation: turning 12s infinite cubic-bezier(0.4, 3, 0.39, -0.92); animation: turning 12s infinite cubic-bezier(0.4, 3, 0.39, -0.92); } .letter-s__tail-wrap { position: absolute; top: 0; left: 0; width: 100%; height: 100%; -webkit-animation: turning 12s infinite cubic-bezier(0.4, 3, 0.39, -0.92); animation: turning 12s infinite cubic-bezier(0.4, 3, 0.39, -0.92); } .letter-s__tail { height: 50.1%; position: absolute; bottom: 0; left: 0; } .letters-svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } </style> </head> <body translate="no"> <div class='letter-s'> <img alt='.........完整代码请登录后点击上方下载按钮下载查看
网友评论0