js+css实现一个中性的音乐播放器效果代码
代码语言:html
所属分类:多媒体
代码描述:js+css实现一个中性的音乐播放器效果代码
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> /*____________________________________________________________ # Variables # Auxiliary styles # Container ## Player ### Music Switch ### Album ### Music Info ### Music Time ### Music Bar ### Music Order ### Music Control # @media ## @media 433px ## @media 414px ## @media 375px ## @media 320px ## @media Height 850px ## @media Height 690px ## @media Height 530px ## @media Height 360px ## @media Height 300px ## @media Height 230px ____________________________________________________________*/ /*____________________________________________________________ # Variables ____________________________________________________________*/ /*____________________________________________________________ # Auxiliary styles ____________________________________________________________*/ * { padding: 0; margin: 0; outline: none; box-sizing: border-box; user-select: none; -webkit-tap-highlight-color: transparent; } ::-webkit-scrollbar { width: 0; } /*____________________________________________________________ # Container ____________________________________________________________*/ .container { width: 100%; height: 100vh; background-color: #f5f6e7; background-size: cover; background-repeat: no-repeat; background-position: center; background-image: url(""); } /*____________________________________________________________ ## Player ____________________________________________________________*/ .player { position: absolute; top: 50%; left: 50%; width: 433px; height: 814px; transform: translate(-50%, -50%); border-radius: 50px; background-color: #f5f6e7; box-shadow: -3px -3px 9px 0.1px #fff, 3px 3px 9px 0.1px #ccc; overflow: hidden; } .contentWrapper { position: absolute; top: 50%; left: 50%; width: 365px; height: 708px; transform: translate(-50%, -50%); } /*____________________________________________________________ ### Music Switch ____________________________________________________________*/ .musicSwitch { position: absolute; left: 50%; height: 44px; width: 340px; transform: translateX(-50%); } .musicSwitch ._prev, .musicSwitch ._next { width: 44px; height: 44px; } .musicSwitch ._prev { float: left; } .musicSwitch ._prev:before { background-position: 8px center; background-image: url("//repo.bfw.wiki/bfwrepo/image/60ecd7efbb296.png"); } .musicSwitch ._next { float: right; } .musicSwitch ._next:before { background-position: 10px center; background-image: url("//repo.bfw.wiki/bfwrepo/image/60ecd803210a6.png"); } .button { background: #f5f6e7; border-radius: 50%; box-shadow: -3px -3px 9px 0.1px #fff, 3px 3px 9px 0.1px #ccc; position: relative; cursor: pointer; } .button:before { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); content: ""; background-color: #f5f6e7; width: 85%; height: 85%; display: inline-block; border-radius: 50%; box-shadow: -1px -1px 2px 0.1px #fff, 5px 5px 10px 0.1px #ccc; background-size: 50%; background-repeat: no-repeat; } .button:active:before { background-size: 49%; box-shadow: inset -3px -3px 5px 0.1px #fff, inset 3px 3px 5px 0.7px #ccc; } /*____________________________________________________________ ### Album ____________________________________________________________*/ .jerryHerman .album:before { background-image: url(//repo.bfw.wiki/bfwrepo/image/5e584482a56eb.png); } .elvisPresley .album:before { background-image: url(//repo.bfw.wiki/bfwrepo/image/5fcd6f952cb56.png); } .album { position: absolute; top: 86px; left: 50%; transform: translateX(-50%); display: inline-block; width: 300px; height: 300px; border-radius: 100%; text-align: center; box-shadow: 15px 15px 30px -10px rgba(0, 0, 0, 0.15), -20px -20px 20px -10px white, -0.5px -0.5px 0 white, 0.5px 0.5px 0 rgba(0, 0, 0, 0.02); z-index: 5; background-color: #f5f6e7; } .album._pause:before { animation: rotateAlbum 15s linear infinite; } .album:before { position: absolute; content: ""; display: block; width: 85%; height: 85%; border-radius: inherit; left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); box-shadow: inset 4px 4px 6px -1px rgba(0, 0, 0, 0.3), inset -4px -4px 6px -1px rgba(0, 0, 0, 0.3); background-image: url("//repo.bfw.wiki/bfwrepo/image/5fcd6f952cb56.png"); background-size: cover; background-color: transparent; animation: rotateAlbum 15s linear infinite paused; } .album:after { position: absolute; content: ""; display: block; width: 70%; height: 70%; border-radius: inherit; left: 50%; top: 50%; background-color: rgba(0, 0, 0, 0.025); border: 1px solid rgba(0, 0, 0, 0.01); transf.........完整代码请登录后点击上方下载按钮下载查看
网友评论0