svg+gsap实现斑马管文字倒计时动画效果代码
代码语言:html
所属分类:动画
代码描述:svg+gsap实现斑马管文字倒计时动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { height: 100vh; display: flex; align-items: center; justify-content: center; background: #000000; } .svg { width: 400px; } @media (max-height: 400px) { .svg { width: 250px; } } .svg .paths { display: none; } .svg .circle { fill: #ffffff; } .svg.gooey .circles { filter: url("#filter"); } .controller { position: fixed; top: 20px; right: 20px; color: #000; font-family: sans-serif; font-size: 10px; text-transform: uppercase; padding: 15px 20px 12px 15px; background: #fff; border-radius: 20px; } @media (max-height: 400px) { .controller { top: 10px; right: 10px; } } .controller span { display: inline-block; position: relative; z-index: 1; } .controller span:before { content: ""; position: absolute; top: -3px; left: -22px; width: 16px; height: 16px; background: red; border-radius: 3px; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; cursor: pointer; } .controller span:after { content: ""; background: #fff; position: absolute; z-index: 1; top: 1px; left: -18px; width: 8px; height: 8px; border-radius: 2px; opacity: 0; transition: opacity 0.2s ease-out; } .controller input { opacity: 0.01; height: 0; } .controller input:checked + span:after { opacity: 1; } </style> </head> <body> <svg viewBox="0 0 256 256" class="svg gooey"> <defs> <filter id="filter"> <feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur" /> <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 20 -14" result="filter" /> <feComposite in="SourceGraphic" in2="filter" operator="atop" /> </filter> </defs> <g class="paths"> <path id="path_0" class="path" d="M185,131.2c0,25.5-5.1,45.6-15.4,60.3c-10.3,14.7-24.1,22-41.7,22c-17.5,0-31.4-7.3-41.5-22 c-10.1-14.7-15.2-34.8-15.2-60.3v-6.6c0-25.5,5.1-45.7,15.2-60.4C96.6,49.4,110.4,42,128,42c17.5,0,31.4,7.4,41.7,22.1 c10.3,14.8,15.4,34.9,15.4,60.4V131.2z" /> <path id="path_1" class="path" d="M87.9,79.2c1.1-0.4,53.7-39.2,54.9-39.1v180.5" /> <path id="path_2" class="path" d="M81.7,85.7c-1.4-67,112.3-55.1,90.2,11.6c-12.6,32-70.6,83.7-88.8,113.7h105.8" /> <path id="path_3" class="path" d="M74.8,178.5c3,39.4,63.9,46.7,88.6,23.7c34.3-3.........完整代码请登录后点击上方下载按钮下载查看
网友评论0