js实现鼠标移动伞位置躲避重力下落的物体效果代码
代码语言:html
所属分类:动画
代码描述:js实现鼠标移动伞位置躲避重力下落的物体效果代码
代码标签: 移动 伞 位置 躲避 重力 下落 的 物体 效果
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <style> body { background: #ffedec; overflow: hidden; } .container { position: absolute; top: calc( 50% - 200px ); left: calc( 50% - 125px ); width: 250px; height: 450px; } .hole { display: block; position: absolute; top: 0; left: calc( 50% - 97px ); width: 193px; height: 59px; z-index: 1; } .umbrella { position: absolute; bottom: 0; left: calc( 50% - 125px ); width: 250px; transform-origin: 50% 0; z-index: 2; } .umbrella__illus { display: block; margin-top: -22px; width: 100%; } .umbrella__selec { position: absolute; top: calc( 50% - 208px ); left: calc( 50% - 159px ); width: 317px; height: 396px; fill: white; } .object { position: absolute; top: 0; left: 50%; background-position: center; background-repeat: no-repeat; background-size: contain; pointer-events: none; transition: opacity 0.1s linear; } .object--1 { width: 2.875em; height: 2.3125em; background-image: url("//repo.bfw.wiki/bfwrepo/svg/object/object-1.svg"); } .object--2 { width: 6.375em; height: 4.875em; background-image: url("//repo.bfw.wiki/bfwrepo/svg/object/object-2.svg"); } .object--3 { width: 3.062em; height: 2.375em; background-image: url("//repo.bfw.wiki/bfwrepo/svg/object/object-3.svg"); } .object--4 { width: 1.875em; height: 4.84375em; background-image: url("//repo.bfw.wiki/bfwrepo/svg/object/object-4.svg"); } .object--5 { width: 2.96875em; height: 3.375em; background-image: url("//repo.bfw.wiki/bfwrepo/svg/object/object-5.svg"); } .object--6 { width: 2.875em; height: 2.25em; background-image: url("//repo.bfw.wiki/bfwrepo/svg/object/object-6.svg"); } .object--7 { width: 4em; height: 4em; backg.........完整代码请登录后点击上方下载按钮下载查看
网友评论0