vue实现鼠标跟随的鸟儿在夕阳下飞翔动画效果代码
代码语言:html
所属分类:动画
代码描述:vue实现鼠标跟随的鸟儿在夕阳下飞翔动画效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/normalize.min.css"> <style> .screen { background-image: url(//repo.bfw.wiki/bfwrepo/image/5fb4a3bcc98a0.png); background-position: center; background-repeat: no-repeat; background-size: cover; width: 100vw; height: 100vh; } .bird { width: var(--width); height: var(--height); position: absolute; top: var(--top); left: var(--left); } .bird.active { transform: rotate(var(--angle)) scale(0) translate(var(--dist-x), var(--dist-y)); filter: blur(2vmin); transition: transform 2000ms ease-out, filter 2000ms ease-out; } .wing { --stroke: calc(var(--size) * 0.2); --half-stroke: calc(var(--stroke) / 2); width: 100%; height: 100%; border: solid var(--stroke) #000000; border-bottom: none; position: absolute; top: 0; box-sizing: border-box; border-radius: 50% 50% 0% 0%/100% 100% 0% 0%; } .wing.left { left: calc(50% - var(--half-stroke)); transform-origin: left bottom; animation: left-wing 512ms ease-out infinite; } .wing.right { right: calc(50% - var(--half-stroke)); transform-origin: right bottom; animation: right-wing 512ms ease-out infinite; } @keyframes left-wing { 0% { transform: rotate(0deg); } 25% { transform: rotate(-45deg) skew(10deg, 30deg); } 75% { transform: rotate(45deg); } } @keyframes right-wing { 0% { transform: rotate(0deg); } 25% { transform: rotate(45deg) skew(-10deg, -30deg); } 75% { transform: rotate(-45deg); } } </style> </head> <body > <div id="birds"> <div class="screen" v-on:mousemove="flyBirds" v-on:touchstart="touchstartEvent" v-on:touchend="touchendEvent" v-on:touchmove="touchmoveEvent" v-on:touchcancel="touchcancelEvent"> <div class="bird" v-for=&q.........完整代码请登录后点击上方下载按钮下载查看
网友评论0