









记录正在发生的一切
写在前面
记录我学习和实践中正在发生的一切
标签
AI工具 Anadius APNG C++ DeepSeek Docker Electron GIF GitHub Hexo Linux Markdown Mermaid mizuki Mizuki Office PAC Python Steam Tampermonkey The Sims 4 Visual Studio Windows SDK 个人成长 个体觉醒 产品设计 代理设置 加密 动效 博客写作 备份 安全 实用工具 工具 排坑 时间维度 服务部署 杂谈 权力反思 模拟人生4 汉化教程 油猴脚本 测试 温柔记录 游戏 游戏感悟 演示 漫画 独立开发 示例 视频 系统 网盘工具 网站维护 网络 网络代理 网络配置 自动化 自定义 自我觉察 软件推荐 软路由 远程控制 避坑 音乐播放器 黑神话悟空
站点统计
34
7
66
41,499
0 天
0 天前
一
二
三
四
五
六
日
626 字
3 分钟
APlayer 接入网易云歌单教程
一、前期准备#
在开始之前,需要注释掉配置文件 plugins 里面的 aplayer 插件。
二、配置步骤#
1. 创建播放器文件#
在 themes/redefine/layout/_partial/scripts/ 目录下创建 meting.ejs 文件。
2. 添加播放器代码#
在 meting.ejs 中添加以下代码:
{% folding cyan, 播放器代码 %}
1<!-- require APlayer -->2<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.css">3<script src="https://cdn.jsdelivr.net/npm/aplayer/dist/APlayer.min.js"></script>4<!-- require MetingJS -->5<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>6
7<style>8.aplayer {9 background: transparent !important;10 border: none !important;11}12.aplayer .aplayer-info {13 border: none !important;14 background: rgba(255, 255, 255, 0.2) !important;15 backdrop-filter: blur(12px);16 padding: 10px !important;17 border-radius: 10px;18 box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);19}20.aplayer .aplayer-list {21 background: rgba(255, 255, 255, 0.2) !important;22 backdrop-filter: blur(12px);23 border-radius: 10px;24 box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);25}26.aplayer .aplayer-list ol li {27 border: none !important;28 color: #000 !important;29}30.aplayer .aplayer-list ol li:hover {31 background: rgba(255, 255, 255, 0.3) !important;32}33.aplayer .aplayer-list ol li.aplayer-list-light {34 background: rgba(255, 255, 255, 0.4) !important;35}36/* 添加以下样式来处理灰色背景 */37.aplayer.aplayer-fixed {38 background: transparent !important;39}40.aplayer.aplayer-fixed .aplayer-body {41 background: transparent !important;42}43.aplayer.aplayer-fixed .aplayer-miniswitcher {44 background: rgba(255, 255, 255, 0.2) !important;45 backdrop-filter: blur(12px);46 box-shadow: -2px 0 6px rgba(255, 255, 255, 0.1);47}48.aplayer .aplayer-lrc {49 text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;50 background: transparent !important;51}52.aplayer .aplayer-lrc:before,53.aplayer .aplayer-lrc:after {54 background: transparent !important;55}56/* 添加一些额外的样式优化 */57.aplayer .aplayer-info .aplayer-music {58 color: #000 !important;59}60.aplayer .aplayer-info .aplayer-controller .aplayer-time {61 color: #000 !important;62}63.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {64 background: rgba(255, 255, 255, 0.4) !important;65}66
67/* 添加按钮样式 */68.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-loaded {69 background: rgba(255, 255, 255, 0.8) !important;70}71
72.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar .aplayer-played {73 background: #fff !important;74}75
76.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap {77 border-color: rgb(229, 231, 235) !important;78}79
80/* 播放按钮样式 */81.aplayer .aplayer-info .aplayer-controller .aplayer-play-icon {82 border: 2px solid #fff !important;83 border-radius: 50%;84}85
86.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon {87 border-color: #fff !important;88}89
90/* 进度条底色 */91.aplayer .aplayer-info .aplayer-controller .aplayer-bar-wrap .aplayer-bar {92 border-bottom: 1px solid rgb(229, 231, 235) !important;93 background: rgba(255, 255, 255, 0.2) !important;94}95
96/* 音量条样式 */97.aplayer .aplayer-volume-bar-wrap .aplayer-volume-bar {98 border-bottom: 1px solid rgb(229, 231, 235) !important;99 background: rgba(255, 255, 255, 0.2) !important;100}101
102.aplayer .aplayer-volume-bar-wrap .aplayer-volume-bar .aplayer-volume {103 background: #fff !important;104}105
106/* 按钮悬停效果 */107.aplayer .aplayer-info .aplayer-controller .aplayer-time .aplayer-icon:hover {108 border-color: #fff !important;109}110</style>111
112<meting-js113 server="netease"114 type="playlist"115 id="7641592364"116 fixed="true"117 autoplay="false"118 theme="#2980b9"119 loop="all"120 order="random"121 preload="auto"122 volume="0.7">123</meting-js>{% endfolding %}
3. 主题配置#
在 _config.redefine.yml 中添加:
1music_player:2 enable: true3 type: aplayer4 source: netease5 id: 76415923644. 引入播放器#
在 themes/redefine/layout/components/footer/footer.ejs 尾部添加:
1<%- partial('_partial/scripts/meting') %>三、样式优化#
- 半透明背景:rgba(255, 255, 255, 0.2)
- 毛玻璃效果:backdrop-filter: blur
- 优化文字颜色和按钮样式
- 圆角和阴影效果
四、最终效果#
- 播放器固定在页面底部
- 支持播放/暂停/切歌等功能
- 可以播放完整的网易云歌单
- 界面透明美观,与网站风格统一
注意事项#
- 需要确保网络连接正常
- 歌单ID必须正确
- 如需更换歌单,修改 meting-js 中的 id 即可
APlayer 接入网易云歌单教程
https://blog.jisuk.top/posts/aplayer/ 部分信息可能已经过时