迷你音乐播放器
代码语言:html
所属分类:多媒体
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<style>
.icon {
display: inline-block;
width: 2em;
height: 2em;
font-size: 30px;
fill: #D7DCE2;
transition: all .2s ease-in-out;
}
html, body {
height: 100%;
}
body {
background: #ffeff5;
position: relative;
}
.player {
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.player.play .player__timeline {
-webkit-transform: translateY(-90%);
transform: translateY(-90%);
}
.player.play .player__album:after {
box-shadow: 0px 30px 28px -10px rgba(0, 0, 0, 0.2);
}
.player.play .player__album {
top: -65px;
}
.player.play .pause {
display: inline-block;
}
.player.play .play {
display: none;
}
.player__album {
width: 112px;
height: 112px;
border-radius: 50%;
margin-right: 22px;
position: relative;
top: -50px;
transition: all .4s ease-in-out;
}
.player__album:before {
content: '';
width: 25px;
height: 25px;
position: absolute;
z-index: 3;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background: #fff;
border-radius: 50%;
}
.player__album:after {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
border-radius: 50%;
box-shadow: none;
transition: all .3s ease-in-out;
}
.player__albumImg {
background-size: cover;
background-position: center;
background-repeat: no-repeat;
width: 100%;
height: 100%;
border-radius: 50%;
position: relative;
z-index: 2;
display: none;
}
.player__albumImg.active-song {
display: block;
}
.player__bar {
background: #fff;
padding: 10px 25px;
height: 100px;
display: flex;
justify-content: space-between;
border-radius: 15px;
box-shadow: 0 30px 56px 6px rgba(0, 0, 0, 0.1);
position: relative;
z-index: 3;
}
.player__controls {
display: flex;
align-items: center;
}
.player__prev {
-webkit-transform: rotate(180deg);
transform: rotate(180deg);
height: 80px;
width: 80px;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
border-radius: 15px;
transition: all .2s ease-in-out;
margin-right: 3px;
}
.player__prev:hover {
background: #D7DCE2;
}
.player__prev:hover svg {
fill: #fff;
}
.player__play {
cursor: pointer;
height: 80px;
width: 80px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 15px;
transition: all .2s ease-in-out;
margin-right: 3px;
position: relative;
}
.player__play:hover {
background: #D7DCE2;
}
.player__play:hover svg {
fill: #fff;
}
.player__play svg {
font-size: 20px;
position: absolute;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
}
.player__play svg.pause {
display: none;
}
.player__next {
cursor: pointer;
height: 80px;
width: 80px;
display: flex;
justify-content: center;
align-items: center;
border-radius: 15px;
transition: all .2s ease-in-out;
margin-left: -8px;
}
.player__next:hover {
background: #D7DCE2;
}
.player__next:hover svg {
fill: #fff;
}
.player__timeline {
background: #fff6fb;
height: 95px;
border-radius: 15px;
position: absolute;
bottom: 0;
left: 10px;
right: 10px;
-webkit-transform: translateY(0);
transform: translateY(0);
transition: all .3s ease-in-out;
z-index: 1;
padding-left: 160px;
flex-direction: column;
justify-content: center;
}
.player__timelineBar {
background: #E7E7E7;
width: 95%;
height: 4px;
border-radius: 15px;
margin-top: 13px;
position: relative;
}
.player #playhead {
position: absolute;
top: 0;
left: 0;
border-radius: 15px;
width: 0;
height: 100%;
background: #fd6d94;
}
.player__author {
line-height: 1;
font-weight: bold;
margin-bottom: 6.........完整代码请登录后点击上方下载按钮下载查看
网友评论0