jquery+bootstrap实现大气自适应黑色酷炫音乐播放器代码
代码语言:html
所属分类:多媒体
代码描述:jquery+bootstrap实现大气自适应黑色酷炫音乐播放器代码,带音量调节、快进快退等功能。
代码标签: jquery bootstrap 大气 黑色 酷炫 音乐 播放器 代码 自适应
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/bootstrap.4.5.2.css"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/all.5.6.1.css"> <style> @import url('//fonts.googleapis.com/css2?family=Sen:wght@400;700;800&display=swap'); html, body { height: 100%; } body { background-color: #25272A; font-family: 'Sen', sans-serif; } button:focus { outline: 0; } audio { display: none; } .row { margin-left: 0px; } #player { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; position: relative; min-height: 800px; min-width: 400px; background-color: #000000; background: rgb(53,59,63); background: linear-gradient(180deg, rgba(53,59,63,1) 0%, rgba(38,41,46,1) 50%, rgba(24,25,28,1) 100%); border-radius: 50px; box-sizing: border-box; color: #FFF; background-clip: padding-box; border: solid 2px rgba(181, 181, 181, 0.03); z-index: 0; margin-top: 20px; } #player:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -2px; border-radius: inherit; border: 1px solid rgba(93, 93, 93, 0.1); border-bottom-width: 0px; background: linear-gradient(rgba(65, 70, 78, 0.85), rgba(32, 35, 39, 0.75)); -webkit-box-shadow: 0px 10px 50px -30px rgba(0,0,0,0.75); -moz-box-shadow: 0px 10px 50px -30px rgba(0,0,0,0.75); box-shadow: 0px 10px 50px -30px rgba(0,0,0,0.75); } #top-row { padding: 30px 20px; } #top-row button { border-radius: 100%; height: 55px; width: 55px; font-size: 1em; color: #84878A; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(29,31,35,1) 0%, rgba(46,53,58,1) 100%); display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; position: relative; text-align: center; box-sizing: border-box; background-clip: padding-box; border: solid 2px transparent; z-index: 2; } #top-row button i { margin: 0px auto; box-shadow: 0px 0px 40px 0px rgba(0,0,0,0.4) } #top-row button:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -2px; border-radius: 100%; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(120,120,120,0.0) 0%, rgba(46,53,58,1) 100%); box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2), -4px -4px 15px 0px rgba(154,154,154,0.3), 2px 2px 20px 0px rgba(25,25,25,0.6); } #top-row #left-button .dropdown-menu { border-width: 0px; width: calc(55px/2); padding: 0px; margin: 0px auto; min-width: auto; text-align: center; margin-top: -5px; left: calc(55px/4); z-index: 1; background: transparent; -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0.0); -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0.0); box-shadow: 0 0 0 rgba(0, 0, 0, 0.0); } #top-row .dropdown-menu input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, rgba(218,80,25,1) 0%, rgba(184,160,34,1) 50%, #1D2021 50%, #1D2021 100%); box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.2), 2px -2px 10px 0px rgba(25,25,25,0.6); } #volume-bar { height: 100px; width: 100px; transform: rotate(270deg) translateY(-24px); transform-origin: center; z-index: 3; } #player-title { font-size: 1.1em; padding-top: 0.85em; color: #84878A; font-weight: 500; text-transform: uppercase; } #top-row #right-button .dropdown-menu { border-width: 0px; width: auto; padding: 0px; margin: 0px auto; width: auto; text-align: center; margin-top: -5px; z-index: 1; /* background: transparent;*/ -webkit-box-shadow: 0 0 0 rgba(0, 0, 0, 0.0); -moz-box-shadow: 0 0 0 rgba(0, 0, 0, 0.0); box-shadow: 0 0 0 rgba(0, 0, 0, 0.0); } .album-border { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; position: relative; text-align: center; box-sizing: border-box; background-clip: padding-box; border: solid 8px transparent; } .album-back { display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; position: relative; text-align: center; box-sizing: border-box; background-clip: padding-box; border: solid 8px transparent; } .album-border img { border-radius: 100%; max-height: 300px; margin: 0px auto; } .album-shadow:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: block; border-radius: 100%; z-index: 2; width: 100%; height: 100%; opacity: 0.1; -webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out; -o-transition: all 0.25s ease-in-out; transition: all 0.25s ease-in-out; background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(255,255,255,0.7) 8%, rgba(255,255,255,0) 100%); background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(8%,rgba(255,255,255,0.7)), color-stop(100%,rgba(255,255,255,0))); background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0.7) 8%,rgba(255,255,255,0) 100%); background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0.7) 8%,rgba(255,255,255,0) 100%); background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(255,255,255,0.7) 8%,rgba(255,255,255,0) 100%); background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(255,255,255,0.7) 8%,rgba(255,255,255,0) 100%); filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#00ffffff',GradientType=0 ); } .album-border:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -10px; border-radius: 100%; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(10,10,10,0.8) 0%, rgba(36,43,48,0.8) 100%); box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2), -5px -5px 30px 0px rgba(150,150,165,0.2), 20px 20px 30px 0px rgba(0,0,0,0.5); -webkit-transition: all 0.4s ease-in-out; -moz-transition: all 0.4s ease-in-out; -o-transition: all 0.4s ease-in-out; transition: all 0.4s ease-in-out; } .album-back-text:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -10px; border-radius: 100%; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(10,10,10,0.8) 0%, rgba(36,43,48,0.8) 100%); box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2), -5px -5px 30px 0px rgba(150,150,165,0.2), 20px 20px 30px 0px rgba(0,0,0,0.5); } .album-shadow { position: absolute; width: 100%; height: 100%; box-shadow: inset 0px 0px 30px 0 #000000; border-radius: 100%; top: 0; left: 0; } #title { padding: 50px 5px 0px; font-size: 1.5em; color: #A7A9AA; font-weight: 500; } #artist { padding: 0px 5px 10px; font-size: 1.0em; color: #84878A; font-weight: 500; } #track { padding: 10px 20px 0px; font-size: 0.8em; color: #84878A; font-weight: 500; } #progress { padding: 0 18px; } #progress input[type=range] { width: 100%; } #progress input[type=range]::-webkit-slider-runnable-track { background: linear-gradient(90deg, rgba(218,80,25,1) 0%, rgba(184,160,34,1) 1%, #1D2021 1%, #1D2021 100%); } #controls { padding: 40px 40px; } #controls button { border-radius: 100%; height: 75px; width: 75px; font-size: 1.25em; color: #84878A; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(29,31,35,1) 0%, rgba(46,53,58,1) 100%); display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; position: relative; text-align: center; box-sizing: border-box; background-clip: padding-box; border: solid 2px transparent; } #controls button:hover:before { opacity: 0.7; } #controls button.active { border-radius: 100%; height: 75px; width: 75px; font-size: 1.25em; color: #FFFFFF; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(230,85,12,1) 0%, rgba(196,38,17,1) 100%); display: -webkit-box; display: flex; -webkit-box-align: center; align-items: center; position: relative; text-align: center; box-sizing: border-box; background-clip: padding-box; border: solid 2px transparent; } #controls button i { margin: 0px auto; box-shadow: 0px 0px 40px 0px rgba(0,0,0,0.4) } .fa-pause { -webkit-transform:scale(0.8,1.0); -moz-transform:scale(0.8,1.0); -ms-transform:scale(0.8,1.0); -o-transform:scale(0.8,1.0); transform:scale(0.8,1.0); } #controls button:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -4px; border-radius: 100%; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(120,120,120,0.0) 0%, rgba(46,53,58,0.2) 100%); box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2), -4px -4px 15px 0px rgba(154,154,154,0.2), 1px 1px 15px 0px rgba(25,25,25,0.6); -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } #controls button.active:before { content: ''; position: absolute; top: 0; right: 0; bottom: 0; left: 0; z-index: -1; margin: -4px; border-radius: 100%; background: rgb(29,31,35); background: linear-gradient(315deg, rgba(196,38,17,1) 0%, rgba(230,85,12,1) 100%); box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.2), -4px -4px 15px 0px rgba(154,154,154,0.3), 1px 1px 15px 0px rgba(25,25,25,0.6); } input[type=range] { height: 25px; -webkit-appearance: none; margin: 0px 0; width: 100%; background-color: transparent; } input[type=range]:focus { outline: none; } input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 10px; cursor: pointer; animate: 0.2s; box-shadow: inset 0px 0px 2px #50555C; background: #F1F1F1; background: linear-gradient(90deg, rgba(218,80,25,1) 0%, rgba(184,160,34,1) 23%, #1D2021 25%, #1D2021 100%); border-radius: 50px; border: 1px solid #000000; box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.2), 1px 1px 3px 0px rgba(120,120,120,0.5); } input[type=range]::-webkit-slider-thumb{ -webkit-appearance: none; box-shadow: 0px 0px 10px #000000; border: 9px solid #24282C; height: 25px; width: 25px; border-radius: 50px; background: rgba(184,160,34,1); cursor: pointer; -webkit-appearance: none; margin-top: -8px; box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.2), -2px -2px 2px 0px rgba(150,150,165,0.1), 2px 2px 5px 0px rgba(0,0,0,0.5); } input[type=range]::-moz-range-track { width: 100%; height: 10px; cursor: pointer; animate: 0.2s; box-shadow: inset 0px 0px 2px #50555C; background: #F1F1F1; background: linear-gradient(90deg, rgba(218,80,25,1) 0%, rgba(184,160,34,1) 23%, #1D2021 25%, #1D2021 100%); border-radius: 50px; border: 1px solid #000000; box-shadow: 0px 0px 2px 0px rgba(0,0,0,0.2), 1px 1px 3px 0px rgba(120,120,120,0.5); } input[type=range]::-moz-range-thumb { box-shadow: 0px 0px 10px #000000; border: 9px solid #24282C; height: 25px; width: 25px; border-radius: 50px; background: rgba(184,160,34,1); cursor: pointer; -webkit-appearance: none; margin-top: -8px; box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.2), -2px -2px 2px 0px rgba(150,150,165,0.1), 2px 2px 5px 0px rgba(0,0,0,0.5); } .flip-card { background-color: transparent; width: 300px; height: 300px; border-radius: 100%; perspective: 1000px; margin: 0px auto; } .flip-card-inner { position: relative; width: 300px; height: 300px; text-align: center; transition: transform 0.8s; transform-style: preserve-3d; margin: 0px auto; } .flip-card:hover .flip-card-inner { transform: rotateY(180deg); } .flip-card:hover .flip-card-front.album-border:before { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; } .flip-card-front, .flip-card-back { position: absolute; width: 300px; height: 300px; backface-visibility: hidden; } .flip-card-back { transform: rotateY(180deg); } #lyrics { box-sizing: border-box; height: 280px; margin-top: 0px; border-radius: 100%; text-align: center; line-height: 1.5em; overflow: hidden; font-size: 1.0em; color: #A7A9AA; font-weight: 500; } .visualizer { width: 284px; height: 284px; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; border-radius: 100%; display: none; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; -webkit-transform: rotateX(60deg) rotateZ(-30deg); transform: rotateX(60deg) rotateZ(-30deg); -webkit-animation: rotate 20s infinite linear; animation: rotate 20s infinite linear; -webkit-animation-play-state: paused; animation-play-state: paused; } .visualizer .circle { width: 284px; height: 284px; position: absolute; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; border-radius: 100%; box-sizing: border-box; box-shadow: 0 0 0px rgba(255,255,255,0.2), inset 0 0 15px rgba(255,255,255,0.1); } .visualizer .circle::before, .visualizer .circle::after { content: ""; display: block; position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; width: 10%; height: 10%; border-radius: 100%; background: rgba(255,255,255,0.2); box-sizing: border-box; box-shadow: 0 0 15px 2px rgba(255,255,255,0.2); } .visualizer .circle::before { -webkit-transform: translateZ(-142px); transform: translateZ(-142px); } .visualizer .circle::after { -webkit-transform: translateZ(142px); transform: translateZ(142px); } .visualizer .circle:nth-child(1) { -webkit-transform: rotateZ(72deg) rotateX(63.435deg); transform: rotateZ(72deg) rotateX(63.435deg); } .visualizer .circle:nth-child(2) { -webkit-transform: rotateZ(144deg) rotateX(63.435deg); transform: rotateZ(144deg) rotateX(63.435deg); } .visualizer .circle:nth-child(3) { -webkit-transform: rotateZ(216deg) rotateX(63.435deg); transform: rotateZ(216deg) rotateX(63.435deg); } .visualizer .circle:nth-child(4) { -webkit-transform: rotateZ(288deg) rotateX(63.435deg); transform: rotateZ(288deg) rotateX(63.435deg); } .visualizer .circle:nth-child(5) { -webkit-transform: rotateZ(360deg) rotateX(63.435deg); transform: rotateZ(360deg) rotateX(63.435deg); } @-webkit-keyframes rotate { 0% { -webkit-transform: rotateX(0) rotateY(0) rotateZ(0); transform: rotateX(0) rotateY(0) rotateZ(0); } 100% { -webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); } } @keyframes rotate { 0% { -webkit-transform: rotateX(0) rotateY(0) rotateZ(0); transform: rotateX(0) rotateY(0) rotateZ(0); } 100% { -webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); } } @-webkit-keyframes stop-rotate { 0% { -webkit-transform: rotateX(0) rotateY(0) rotateZ(0); transform: rotateX(0) rotateY(0) rotateZ(0); } 100% { -webkit-transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); transform: rotateX(360deg) rotateY(360deg) rotateZ(360deg); } } .paused { -webkit-animation-play-state: paused; animation-play-state: paused; } .playing { -webkit-animation-play-state: running; animation-play-state: running; } </style> </head> <body> <!-- partial:index.partial.html --> <div class="d-flex justify-content-center align-items-center container"> <div id="player" class="align-items-start"> <div class="container p-0 m-0 w-100"> <div class="row justify-content-between w-100" id="top-row"> <div class="col-xs-2" id="left-button"> <div class="dropdown keep-open"> <button class="btn-floating btn-lg" role="button" id="volume-menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" role="button"><i class="fas fa-volume-up"></i></button> <div class="dropdown-menu" role="menu" aria-labelledby="volume-menu"> <input type="range" min="0" max="100" value="50" id="volume-bar" /> </div> </div> </div> <div class="col-xs-8 m-.........完整代码请登录后点击上方下载按钮下载查看
网友评论0