js+svg实现液体拖拽分离融合动画效果代码
代码语言:html
所属分类:拖放
代码描述:js+svg实现液体拖拽分离融合动画效果代码,鼠标左键单价拖拽液体试试。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> @import url("https://fonts.googleapis.com/css?family=Chewy|Gloria+Hallelujah"); html { height: 100%; width: 100%; } body { margin: 0; padding: 0; height: 100%; width: 100%; background: #121327; overflow: hidden; -webkit-filter: hue-rotate(0deg); filter: hue-rotate(0deg); -moz-animation: huerot 5s ease infinite; -webkit-animation: huerot 5s ease infinite; animation: huerot 5s ease infinite; } /** end for goo container **/ .glowy-blob { position: absolute; left: 50%; top: 50%; -moz-transform: translate(-50, -50); -ms-transform: translate(-50, -50); -webkit-transform: translate(-50, -50); transform: translate(-50, -50); -webkit-filter: url("#goo"); filter: url("#goo"); } .glowy-blob div { width: 80px; height: 80px; background: #85EDE8; -moz-border-radius: 500px; -webkit-border-radius: 500px; border-radius: 500px; display: inline-block; position: absolute; box-shadow: 0px 0px 50px #85EDE8; /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ /**keyframes **/ } .glowy-blob div:nth-child(2) { width: 43px; height: 43px; left: 23px; } .glowy-blob div:nth-child(3) { width: 42px; height: 42px; left: -39px; } .glowy-blob div:nth-child(4) { width: 44px; height: 44px; left: -31px; } .glowy-blob div:nth-child(5) { width: 37px; height: 37px; left: 17px; } .glowy-blob div:nth-child(6) { width: 50px; height: 50px; left: 20px; } .glowy-blob div:nth-child(7) { width: 53px; height: 53px; left: -38px; } .glowy-blob div:nth-child(8) { width: 59px; height: 59px; left: -46px; } .glowy-blob div:nth-child(9) { width: 39px; height: 39px; left: 49px; } .glowy-blob div:nth-child(10) { width: 50px; height: 50px; left: -15px; } .glowy-blob div:nth-child(11) { width: 60px; height: 60px; left: -9px; } .glowy-blob div:nth-child(12) { width: 30px; height: 30px; left: 17px; } .glowy-blob div:nth-child(13) { width: 47px; height: 47px; left: 52px; } .glowy-blob div:nth-child(14) { width: 42px; height: 42px; left: 31px; } .glowy-blob div:nth-child(15) { width: 44px; height: 44px; left: 49px; } .glowy-blob div:nth-child(16) { width: 40px; height: 40px; left: -43px; } .glowy-blob div:nth-child(1) { top: 0; left: 0; -moz-animation: anim-1 2.5s ease-in-out infinite; -webkit-animation: anim-1 2.5s ease-in-out infinite; animation: anim-1 2.5s ease-in-out infinite; -moz-animation-delay: 0s; -webkit-animation-delay: 0s; animation-delay: 0s; } @-moz-keyframes anim-1 { 0% { left: 0; top: 0; } 50% { left: 23px; top: 0; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-1 { 0% { left: 0; top: 0; } 50% { left: 23px; top: 0; } 100% { left: 0; top: 0; } } @keyframes anim-1 { 0% { left: 0; top: 0; } 50% { left: 23px; top: 0; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(2) { top: 0; left: 0; -moz-animation: anim-2 2.5s ease-in-out infinite; -webkit-animation: anim-2 2.5s ease-in-out infinite; animation: anim-2 2.5s ease-in-out infinite; -moz-animation-delay: 1s; -webkit-animation-delay: 1s; animation-delay: 1s; } @-moz-keyframes anim-2 { 0% { left: 0; top: 0; } 50% { left: -39px; top: 10px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-2 { 0% { left: 0; top: 0; } 50% { left: -39px; top: 10px; } 100% { left: 0; top: 0; } } @keyframes anim-2 { 0% { left: 0; top: 0; } 50% { left: -39px; top: 10px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(3) { top: 0; left: 0; -moz-animation: anim-3 2.5s ease-in-out infinite; -webkit-animation: anim-3 2.5s ease-in-out infinite; animation: anim-3 2.5s ease-in-out infinite; -moz-animation-delay: 3s; -webkit-animation-delay: 3s; animation-delay: 3s; } @-moz-keyframes anim-3 { 0% { left: 0; top: 0; } 50% { left: -31px; top: -28px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-3 { 0% { left: 0; top: 0; } 50% { left: -31px; top: -28px; } 100% { left: 0; top: 0; } } @keyframes anim-3 { 0% { left: 0; top: 0; } 50% { left: -31px; top: -28px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(4) { top: 0; left: 0; -moz-animation: anim-4 2.5s ease-in-out infinite; -webkit-animation: anim-4 2.5s ease-in-out infinite; animation: anim-4 2.5s ease-in-out infinite; -moz-animation-delay: 2s; -webkit-animation-delay: 2s; animation-delay: 2s; } @-moz-keyframes anim-4 { 0% { left: 0; top: 0; } 50% { left: 17px; top: 26px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-4 { 0% { left: 0; top: 0; } 50% { left: 17px; top: 26px; } 100% { left: 0; top: 0; } } @keyframes anim-4 { 0% { left: 0; top: 0; } 50% { left: 17px; top: 26px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(5) { top: 0; left: 0; -moz-animation: anim-5 2.5s ease-in-out infinite; -webkit-animation: anim-5 2.5s ease-in-out infinite; animation: anim-5 2.5s ease-in-out infinite; -moz-animation-delay: 1s; -webkit-animation-delay: 1s; animation-delay: 1s; } @-moz-keyframes anim-5 { 0% { left: 0; top: 0; } 50% { left: 20px; top: -11px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-5 { 0% { left: 0; top: 0; } 50% { left: 20px; top: -11px; } 100% { left: 0; top: 0; } } @keyframes anim-5 { 0% { left: 0; top: 0; } 50% { left: 20px; top: -11px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(6) { top: 0; left: 0; -moz-animation: anim-6 2.5s ease-in-out infinite; -webkit-animation: anim-6 2.5s ease-in-out infinite; animation: anim-6 2.5s ease-in-out infinite; -moz-animation-delay: 2s; -webkit-animation-delay: 2s; animation-delay: 2s; } @-moz-keyframes anim-6 { 0% { left: 0; top: 0; } 50% { left: -38px; top: -50px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-6 { 0% { left: 0; top: 0; } 50% { left: -38px; top: -50px; } 100% { left: 0; top: 0; } } @keyframes anim-6 { 0% { left: 0; top: 0; } 50% { left: -38px; top: -50px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(7) { top: 0; left: 0; -moz-animation: anim-7 2.5s ease-in-out infinite; -webkit-animation: anim-7 2.5s ease-in-out infinite; animation: anim-7 2.5s ease-in-out infinite; -moz-animation-delay: 1s; -webkit-animation-delay: 1s; animation-delay: 1s; } @-moz-keyframes anim-7 { 0% { left: 0; top: 0; } 50% { left: -46px; top: 30px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-7 { 0% { left: 0; top: 0; } 50% { left: -46px; top: 30px; } 100% { left: 0; top: 0; } } @keyframes anim-7 { 0% { left: 0; top: 0; } 50% { left: -46px; top: 30px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(8) { top: 0; left: 0; -moz-animation: anim-8 2.5s ease-in-out infinite; -webkit-animation: anim-8 2.5s ease-in-out infinite; animation: anim-8 2.5s ease-in-out infinite; -moz-animation-delay: 1s; -webkit-animation-delay: 1s; animation-delay: 1s; } @-moz-keyframes anim-8 { 0% { left: 0; top: 0; } 50% { left: 49px; top: -2px; } 100% { left: 0; top: 0; } } @-webkit-keyframes anim-8 { 0% { left: 0; top: 0; } 50% { left: 49px; top: -2px; } 100% { left: 0; top: 0; } } @keyframes anim-8 { 0% { left: 0; top: 0; } 50% { left: 49px; top: -2px; } 100% { left: 0; top: 0; } } .glowy-blob div:nth-child(9) { top: 0; left: 0; -moz-animation: anim-9 2.5s ease-in-out infinite; -webkit-animation: anim-9 2.5s ease-in-out infini.........完整代码请登录后点击上方下载按钮下载查看
网友评论0