基于vue的音乐播放器
代码语言:html
所属分类:布局界面
代码描述:基于vue的音乐播放器,可以收藏、分享、上一首、下一首、进度条显示、封面显示等,很强大
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Mini Music Player - VueJS</title> <link href="https://fonts.googleapis.com/css?family=Bitter:400,700&display=swap&subset=latin-ext" rel="stylesheet" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <style> * { margin: 0; padding: 0; list-style-type: none; } body { background: #dfe7ef; font-family: "Bitter", serif; } * { box-sizing: border-box; } .icon { display: inline-block; width: 1em; height: 1em; stroke-width: 0; stroke: currentColor; fill: currentColor; } .wrapper { width: 100%; display: flex; align-items: center; justify-content: center; min-height: 100vh; background-size: cover; } @media screen and (max-width: 700px), (max-height: 500px) { .wrapper { flex-wrap: wrap; flex-direction: column; } } .player { background: #eef3f7; width: 410px; min-height: 480px; box-shadow: 0px 15px 35px -5px rgba(50, 88, 130, 0.32); border-radius: 15px; padding: 30px; } @media screen and (max-width: 576px), (max-height: 500px) { .player { width: 95%; padding: 20px; margin-top: 75px; min-height: initial; padding-bottom: 30px; max-width: 400px; } } .player__top { display: flex; align-items: flex-start; position: relative; z-index: 4; } @media screen and (max-width: 576px), (max-height: 500px) { .player__top { flex-wrap: wrap; } } .player-cover { width: 300px; height: 300px; margin-left: -70px; flex-shrink: 0; position: relative; z-index: 2; border-radius: 15px; z-index: 1; } @media screen and (max-width: 576px), (max-height: 500px) { .player-cover { margin-top: -70px; margin-bottom: 25px; width: 290px; height: 230px; margin-left: auto; margin-right: auto; } } .player-cover__item { background-repeat: no-repeat; background-position: center; background-size: cover; width: 100%; height: 100%; border-radius: 15px; position: absolute; left: 0; top: 0; } .player-cover__item:before { content: ""; background: inherit; width: 100%; height: 100%; box-shadow: 0px 10px 40px 0px rgba(76, 70, 124, 0.5); display: block; z-index: 1; position: absolute; top: 30px; transform: scale(0.9); filter: blur(10px); opacity: 0.9; border-radius: 15px; } .player-cover__item:after { content: ""; background: inherit; width: 100%; height: 100%; box-shadow: 0px 10px 40px 0px rgba(76, 70, 124, 0.5); display: block; z-index: 2; position: absolute; border-radius: 15px; } .player-cover__img { width: 100%; height: 100%; object-fit: cover; border-radius: 15px; box-shadow: 0px 10px 40px 0px rgba(76, 70, 124, 0.5); user-select: none; pointer-events: none; } .player-controls { flex: 1; padding-left: 20px; display: flex; flex-direction: column; align-items: center; } @media screen and (max-width: 576px), (max-height: 500px) { .player-controls { flex-direction: row; padding-left: 0; width: 100%; flex: unset; } } .player-controls__item { display: inline-flex; font-size: 30px; padding: 5px; margin-bottom: 10px; color: #acb8cc; cursor: pointer; width: 50px; height: 50px; align-items: center; justify-content: center; position: relative; transition: all 0.3s ease-in-out; } @media screen and (max-width: 576px), (max-height: 500px) { .player-controls__item { font-size: 26px; padding: 5px; margin-right: 10px; color: #acb8cc; cursor: pointer; width: 40px; height: 40px; margin-bottom: 0; } } .player-controls__item::before { content: ""; position: absolute; width: 100%; height: 100%; border-radius: 50%; background: #fff; transform: scale(0.5); opacity: 0; box-shadow: 0px 5px 10px 0px rgba(76, 70, 124, 0.2); transition: all 0.3s ease-in-out; transition: all 0.4s cubic-bezier(0.35, 0.57, 0.13, 0.88); } @media screen and (min-width: 500px) { .player-controls__item:hover { color: #532ab9; } .player-controls__item:hover::before { opacity: 1; transform: scale(1.3); } } @media screen and (max-width: 576px), (max-height: 500px) { .player-controls__item:active { color: #532ab9; } .player-controls__item:active::before { opacity: 1; transform: scale(1.3); } } .player-controls__item .icon { position: relative; z-index: 2; } .player-controls__item.-xl { margin-bottom: 0; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0