feat: 新增音频播放器功能及MV预览组件
style: 优化页面布局及样式细节 refactor: 重构音频播放逻辑与进度条控制 docs: 更新README说明音频播放功能 test: 添加音频播放器交互测试用例
This commit is contained in:
586
css/index.less
586
css/index.less
@@ -33,6 +33,58 @@
|
||||
width: 1200px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.sidebar {
|
||||
position: fixed;
|
||||
top: 175px;
|
||||
right: 100px;
|
||||
z-index: 10;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.pointer {
|
||||
margin-bottom: 192px;
|
||||
.item {
|
||||
width: 4px;
|
||||
height: 50px;
|
||||
margin-bottom: 2px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
|
||||
&.active {
|
||||
background-color: rgba(243, 151, 75, 1);
|
||||
&::after {
|
||||
content: attr(data-index);
|
||||
position: absolute;
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
color: #f3974b;
|
||||
font-size: 14px;
|
||||
top: 0;
|
||||
left: -21px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.item {
|
||||
width: 12px;
|
||||
height: 7px;
|
||||
cursor: pointer;
|
||||
|
||||
&:not(:last-of-type) {
|
||||
margin-bottom: 34px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.introduce {
|
||||
width: 100%;
|
||||
&::after {
|
||||
@@ -164,6 +216,7 @@
|
||||
left: 30px;
|
||||
bottom: 30px;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -293,6 +346,23 @@
|
||||
height: 500px;
|
||||
flex-direction: column;
|
||||
padding-top: 29px;
|
||||
position: relative;
|
||||
|
||||
&:not(:nth-last-child(-n + 3)) {
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
&:not(:nth-child(3n)) {
|
||||
border-right: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
.serial-icon {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 0;
|
||||
width: 21px;
|
||||
height: 37px;
|
||||
}
|
||||
|
||||
.serial {
|
||||
height: 44px;
|
||||
@@ -312,6 +382,7 @@
|
||||
font-size: 20px;
|
||||
color: #000000;
|
||||
margin-left: 40px;
|
||||
margin-right: 40px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
@@ -324,6 +395,8 @@
|
||||
color: #555555;
|
||||
line-height: 24px;
|
||||
margin-bottom: 10px;
|
||||
white-space: pre-line;
|
||||
padding: 0 40px;
|
||||
}
|
||||
|
||||
.time {
|
||||
@@ -332,6 +405,177 @@
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
padding: 0 40px;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.media {
|
||||
position: relative;
|
||||
width: 340px;
|
||||
height: 191px;
|
||||
margin: 0 30px;
|
||||
cursor: pointer;
|
||||
|
||||
.img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.play {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 27px;
|
||||
height: 27px;
|
||||
cursor: pointer;
|
||||
filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.audio-box {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
background-color: #ffffff;
|
||||
border-radius: 20px;
|
||||
margin-top: 60px;
|
||||
.item {
|
||||
height: 314px;
|
||||
padding-top: 29px;
|
||||
position: relative;
|
||||
|
||||
&:not(:nth-last-child(-n + 2)) {
|
||||
border-bottom: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
&:not(:nth-child(2n)) {
|
||||
border-right: 1px solid #ebebeb;
|
||||
}
|
||||
|
||||
.serial-icon {
|
||||
position: absolute;
|
||||
top: 40px;
|
||||
left: 0;
|
||||
width: 21px;
|
||||
height: 37px;
|
||||
}
|
||||
|
||||
.serial {
|
||||
height: 44px;
|
||||
font-family: "AlibabaPuHuiTiB", "Alibaba PuHuiTi Bold", "Alibaba PuHuiTi Heavy", "Alibaba PuHuiTi", sans-serif;
|
||||
font-weight: 700;
|
||||
font-style: normal;
|
||||
color: #000000;
|
||||
font-size: 32px;
|
||||
margin-left: 40px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.content {
|
||||
.album {
|
||||
width: 234px;
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
margin-left: 30px;
|
||||
margin-right: 36px;
|
||||
.img {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
filter: drop-shadow(5px 5px 2.5px rgba(0, 0, 0, 0.35));
|
||||
}
|
||||
|
||||
.icon {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
}
|
||||
|
||||
.info {
|
||||
flex-direction: column;
|
||||
.name {
|
||||
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
|
||||
font-weight: 650;
|
||||
font-style: normal;
|
||||
font-size: 20px;
|
||||
color: #000000;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 260px;
|
||||
height: 10px;
|
||||
margin-bottom: 17px;
|
||||
|
||||
.bar {
|
||||
height: 4px;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&.white {
|
||||
width: 0;
|
||||
border-radius: 10px 0 0 10px;
|
||||
background-color: #5241b0;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #f3974b;
|
||||
border-radius: 50%;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
right: -5px;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
&.black {
|
||||
background-color: rgba(0, 0, 0, 1);
|
||||
border-radius: 0 10px 10px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operate {
|
||||
.speed {
|
||||
width: 16px;
|
||||
height: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.play {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
margin: 0 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,4 +586,346 @@
|
||||
margin: 0 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.custom {
|
||||
background: rgba(249, 249, 249, 1);
|
||||
|
||||
.custom-box {
|
||||
flex-direction: column;
|
||||
position: relative;
|
||||
padding-top: 106px;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.title {
|
||||
width: 160px;
|
||||
height: 39px;
|
||||
margin: 0 auto 32px;
|
||||
}
|
||||
|
||||
.subtitle {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 16px;
|
||||
color: #555555;
|
||||
text-align: center;
|
||||
margin-bottom: 131px;
|
||||
}
|
||||
|
||||
.list {
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
.item {
|
||||
width: 560px;
|
||||
height: 160px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 10px;
|
||||
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.101960784313725);
|
||||
|
||||
&:not(:nth-last-child(-n + 2)) {
|
||||
margin-bottom: 140px;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-bottom: 130px;
|
||||
}
|
||||
|
||||
.info {
|
||||
width: 280px;
|
||||
flex-direction: column;
|
||||
padding-top: 18px;
|
||||
padding-left: 20px;
|
||||
margin-right: 20px;
|
||||
height: 100%;
|
||||
.name {
|
||||
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
|
||||
font-weight: 650;
|
||||
font-style: normal;
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.lyric {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #555555;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
width: 260px;
|
||||
height: 10px;
|
||||
margin-bottom: 17px;
|
||||
|
||||
.bar {
|
||||
height: 4px;
|
||||
border-radius: 10px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
}
|
||||
&.white {
|
||||
width: 20%;
|
||||
border-radius: 10px 0 0 10px;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
width: calc(100% + 5px);
|
||||
height: 100%;
|
||||
background-color: #5241b0;
|
||||
display: block;
|
||||
border-radius: 10px 0 0 10px;
|
||||
}
|
||||
}
|
||||
|
||||
&.black {
|
||||
&::after {
|
||||
content: "";
|
||||
width: calc(100% + 5px);
|
||||
height: 100%;
|
||||
background-color: rgba(0, 0, 0, 1);
|
||||
display: block;
|
||||
border-radius: 0 10px 10px 0;
|
||||
left: -5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #f3974b;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.operate {
|
||||
.speed {
|
||||
width: 16px;
|
||||
height: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.play {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
margin: 0 30px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.info-img {
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
filter: drop-shadow(5px 5px 2.5px rgba(0, 0, 0, 0.35));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bottom {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
height: 384px;
|
||||
z-index: -1;
|
||||
width: 99vw;
|
||||
overflow: hidden;
|
||||
|
||||
.bj {
|
||||
width: 640px;
|
||||
height: 384px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.student {
|
||||
.student-box {
|
||||
background: linear-gradient(180deg, rgba(30, 19, 94, 1) 0%, rgba(82, 65, 176, 1) 100%);
|
||||
padding-top: 105px;
|
||||
padding-bottom: 130px;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
.title {
|
||||
width: 160px;
|
||||
height: 41px;
|
||||
margin-bottom: 93px;
|
||||
}
|
||||
|
||||
.list {
|
||||
margin-bottom: 69px;
|
||||
.img {
|
||||
width: 240px;
|
||||
height: 240px;
|
||||
border-radius: 50%;
|
||||
filter: drop-shadow(5px 5px 2.5px rgba(0, 0, 0, 0.35));
|
||||
&.pitch {
|
||||
width: 320px;
|
||||
height: 320px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
font-family: "PingFangSC-Semibold", "PingFang SC Semibold", "PingFang SC", sans-serif;
|
||||
font-weight: 650;
|
||||
font-style: normal;
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.info {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 14px;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
line-height: 24px;
|
||||
margin-bottom: 62px;
|
||||
|
||||
.icon {
|
||||
width: 12px;
|
||||
height: 14px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 10px;
|
||||
width: 500px;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.bar {
|
||||
// width: 500px;
|
||||
height: 4px;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.circle {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background-color: #f3974b;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
|
||||
.operate {
|
||||
.cut {
|
||||
width: 14px;
|
||||
height: 12px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.speed {
|
||||
width: 16px;
|
||||
height: 12px;
|
||||
margin: 0 40px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.play {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.contact {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: -30px;
|
||||
padding-top: 124px;
|
||||
padding-bottom: 113px;
|
||||
background: #fff;
|
||||
|
||||
.title {
|
||||
width: 144px;
|
||||
height: 38px;
|
||||
margin-bottom: 63px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
font-size: 16px;
|
||||
text-align: center;
|
||||
color: rgb(51, 51, 51);
|
||||
text-align: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.arrows {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
margin-top: 37px;
|
||||
margin-bottom: 53px;
|
||||
}
|
||||
|
||||
.WeChat {
|
||||
width: 160px;
|
||||
height: 160px;
|
||||
margin-bottom: 26px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
width: 82px;
|
||||
height: 16px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.footer {
|
||||
flex-direction: column;
|
||||
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
|
||||
font-weight: 400;
|
||||
font-style: normal;
|
||||
color: #f2f2f2;
|
||||
font-size: 13px;
|
||||
height: 180px;
|
||||
background: linear-gradient(180deg, rgba(82, 65, 176, 1) 0%, rgba(30, 19, 94, 1) 100%);
|
||||
|
||||
.logo {
|
||||
width: 226px;
|
||||
height: 30px;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
}
|
||||
|
||||
.preview {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #4c4c4c;
|
||||
z-index: 1000;
|
||||
.close {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
cursor: pointer;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
}
|
||||
.artplayer-app {
|
||||
width: 800px;
|
||||
height: 600px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user