diff --git a/.gitignore b/.gitignore
index dcb5930f..a1a007c3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -36,6 +36,7 @@ yarn-error.log*
# dev
/data.json
/yarn.lock
+/pnpm-lock.yaml
.idea
.vscode
diff --git a/README.md b/README.md
index 137323ab..d166eac3 100644
--- a/README.md
+++ b/README.md
@@ -66,6 +66,14 @@
 Ylarod 🔧 🐛 |
 Etherrreal. 🔧 🐛 |
+
+  Joshua Astray 🔧 🐛 |
+
+  Vixcity 🔧 🐛 |
+
+  ipatpat 🔧 🐛 |
+
+  xloong 🔧 🐛 |
diff --git a/blog.config.js b/blog.config.js
index 418c2bc3..0dc79180 100644
--- a/blog.config.js
+++ b/blog.config.js
@@ -25,10 +25,14 @@ const BLOG = {
// 网站默认使用PingFangSC及NotoSansSC,
// 如需自定义字体,请将CUSTOM_FONT改为 true,并将CUSTOM_FONT_URL改为你的字体CSS地址,同时在CUSTOM_FONT_SANS与CUSTOM_FONT_SERIF中指定你的font-family
CUSTOM_FONT: process.env.NEXT_PUBLIC_CUSTOM_FONT || false, // 是否使用自定义字体
+ // 自定义字体示例: 请先将 CUSTOM_FONT 改为 true, 并将 CUSTOM_FONT_URL 改为你的字体CSS地址,同时在 CUSTOM_FONT_SANS 与 CUSTOM_FONT_SERIF 中指定你的 fontfamily
CUSTOM_FONT_URL: ['https://npm.elemecdn.com/lxgw-wenkai-webfont@1.6.0/style.css'], // 自定义字体的CSS
CUSTOM_FONT_SANS: ['LXGW WenKai'], // 自定义无衬线字体
CUSTOM_FONT_SERIF: ['LXGW WenKai'], // 自定义衬线字体
+ // 侧栏布局 是否反转(左变右,右变左) 已支持主题: hexo next medium fukasawa example
+ LAYOUT_SIDEBAR_REVERSE: false,
+
// 一个小插件展示你的facebook fan page~ @see https://tw.andys.pro/article/add-facebook-fanpage-notionnext
FACEBOOK_PAGE_TITLE: process.env.NEXT_PUBLIC_FACEBOOK_PAGE_TITLE || null, // 邊欄 Facebook Page widget 的標題欄,填''則無標題欄 e.g FACEBOOK 粉絲團'
FACEBOOK_PAGE: process.env.NEXT_PUBLIC_FACEBOOK_PAGE || null, // Facebook Page 的連結 e.g https://www.facebook.com/tw.andys.pro
@@ -51,20 +55,46 @@ const BLOG = {
POST_LIST_PREVIEW: process.env.NEXT_PUBLIC_POST_PREVIEW || 'false', // 是否在列表加载文章预览
POST_PREVIEW_LINES: 12, // 预览博客行数
POST_RECOMMEND_COUNT: 6, // 推荐文章数量
- POSTS_PER_PAGE: 6, // post counts per page
+ POSTS_PER_PAGE: 12, // post counts per page
POSTS_SORT_BY: 'notion', // 排序方式 'date'按时间,'notion'由notion控制
PREVIEW_CATEGORY_COUNT: 16, // 首页最多展示的分类数量,0为不限制
PREVIEW_TAG_COUNT: 16, // 首页最多展示的标签数量,0为不限制
// 鼠标点击烟花特效
- FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || false, // 鼠标点击烟花特效
+ FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || false, // 开关
+ // 烟花色彩,感谢 https://github.com/Vixcity 提交的色彩
+ FIREWORKS_COLOR: ['255, 20, 97', '24, 255, 146', '90, 135, 255', '251, 243, 140'],
// 悬浮挂件
WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件
WIDGET_PET_LINK: 'https://cdn.jsdelivr.net/npm/live2d-widget-model-wanko@1.0.5/assets/wanko.model.json', // 挂件模型地址 @see https://github.com/xiazeyu/live2d-widget-models
WIDGET_PET_SWITCH_THEME: true, // 点击宠物挂件切换博客主题
+ // 音乐播放插件
+ MUSIC_PLAYER: process.env.NEXT_PUBLIC_MUSIC_PLAYER || false, // 是否使用音乐播放插件
+ MUSIC_PLAYER_VISIBLE: process.env.NEXT_PUBLIC_MUSIC_PLAYER_VISIBLE || true, // 是否在左下角显示播放和切换,如果使用播放器,打开自动播放再隐藏,就会以类似背景音乐的方式播放,无法取消和暂停
+ MUSIC_PLAYER_AUTO_PLAY: process.env.NEXT_PUBLIC_MUSIC_PLAYER_AUTO_PLAY || true, // 是否自动播放,不过自动播放时常不生效(移动设备不支持自动播放)
+ MUSIC_PLAYER_SHOW_LRC: process.env.NEXT_PUBLIC_MUSIC_PLAYER_SHOW_LRC || false, // 是否展示歌词(前提是有配置歌词路径,对 meting 无效)
+ MUSIC_PLAYER_ORDER: 'list', // 默认播放方式,顺序 list,随机 random
+ MUSIC_PLAYER_AUDIO_LIST: [ // 示例音乐列表。除了以下配置外,还可配置歌词,具体配置项看此文档 https://aplayer.js.org/#/zh-Hans/
+ {
+ name: '风を共に舞う気持ち',
+ artist: 'Falcom Sound Team jdk',
+ url: 'https://music.163.com/song/media/outer/url?id=731419.mp3',
+ cover: 'https://p2.music.126.net/kn6ugISTonvqJh3LHLaPtQ==/599233837187278.jpg'
+ },
+ {
+ name: '王都グランセル',
+ artist: 'Falcom Sound Team jdk',
+ url: 'https://music.163.com/song/media/outer/url?id=731355.mp3',
+ cover: 'https://p1.music.126.net/kn6ugISTonvqJh3LHLaPtQ==/599233837187278.jpg'
+ }
+ ],
+ MUSIC_PLAYER_METING: process.env.NEXT_PUBLIC_MUSIC_PLAYER_METING || false, // 是否要开启 MetingJS,从平台获取歌单。会覆盖自定义的 MUSIC_PLAYER_AUDIO_LIST,更多配置信息:https://github.com/metowolf/MetingJS
+ MUSIC_PLAYER_METING_SERVER: process.env.NEXT_PUBLIC_MUSIC_PLAYER_METING_SERVER || 'netease', // 音乐平台,[netease, tencent, kugou, xiami, baidu]
+ MUSIC_PLAYER_METING_ID: process.env.NEXT_PUBLIC_MUSIC_PLAYER_METING_ID || '60198', // 对应歌单的 id
+
// ----> 评论互动 可同时开启多个支持 WALINE VALINE GISCUS CUSDIS UTTERRANCES GITALK
// twikoo
diff --git a/components/CommonScript.js b/components/CommonScript.js
index ae924fbd..446b0017 100644
--- a/components/CommonScript.js
+++ b/components/CommonScript.js
@@ -101,6 +101,10 @@ const CommonScript = () => {
}}
/>
>)}
+
+ {/* 引入音乐播放 */}
+ {JSON.parse(BLOG.MUSIC_PLAYER) && }
+ {JSON.parse(BLOG.MUSIC_PLAYER) && JSON.parse(BLOG.MUSIC_PLAYER_METING) && }
>)
}
diff --git a/components/Fireworks.js b/components/Fireworks.js
index 3ccdec7e..6d80772e 100644
--- a/components/Fireworks.js
+++ b/components/Fireworks.js
@@ -4,6 +4,7 @@
*/
import React from 'react'
import anime from 'animejs'
+import BLOG from 'blog.config'
export const Fireworks = () => {
React.useEffect(() => {
@@ -17,9 +18,8 @@ export const Fireworks = () => {
* @param config
*/
function createFireworks(config) {
- const defaultColors = ['102, 167, 221', '62, 131, 225', '33, 78, 194']
const defaultConfig = {
- colors: defaultColors,
+ colors: BLOG.FIREWORKSCOLOR,
numberOfParticules: 20,
orbitRadius: {
min: 50,
@@ -44,7 +44,7 @@ function createFireworks(config) {
let pointerY = 0
// sky blue
- const colors = config.colors || defaultColors
+ const colors = config.colors
const canvasEl = document.querySelector('.fireworks')
const ctx = canvasEl.getContext('2d')
diff --git a/components/MusicPlayer.js b/components/MusicPlayer.js
new file mode 100644
index 00000000..7e788639
--- /dev/null
+++ b/components/MusicPlayer.js
@@ -0,0 +1,7 @@
+import dynamic from 'next/dynamic'
+
+const MusicPlayer = dynamic(
+ () => import('@/components/Player'),
+ { ssr: false }
+)
+export default MusicPlayer
diff --git a/components/Player.js b/components/Player.js
new file mode 100644
index 00000000..c85b30a0
--- /dev/null
+++ b/components/Player.js
@@ -0,0 +1,52 @@
+import React from 'react'
+import BLOG from '@/blog.config'
+
+const Player = () => {
+ const [player, setPlayer] = React.useState()
+ const ref = React.useRef(null)
+
+ const showLrc = JSON.parse(BLOG.MUSIC_PLAYER_SHOW_LRC)
+ const playerVisible = JSON.parse(BLOG.MUSIC_PLAYER_VISIBLE)
+ const autoPlay = JSON.parse(BLOG.MUSIC_PLAYER_AUTO_PLAY)
+
+ const meting = JSON.parse(BLOG.MUSIC_PLAYER_METING)
+
+ React.useEffect(() => {
+ if (!meting && window.APlayer) {
+ setPlayer(new window.APlayer({
+ container: ref.current,
+ fixed: true,
+ showlrc: showLrc,
+ autoplay: autoPlay,
+ order: BLOG.MUSIC_PLAYER_ORDER,
+ audio: BLOG.MUSIC_PLAYER_AUDIO_LIST
+ }))
+ }
+ return () => {
+ setPlayer(undefined)
+ }
+ }, [])
+
+ return (
+
+
+ {meting
+ ?
+ :
+ }
+
+ )
+}
+
+export default Player
diff --git a/components/SideBarDrawer.js b/components/SideBarDrawer.js
index dac43d75..47052db9 100644
--- a/components/SideBarDrawer.js
+++ b/components/SideBarDrawer.js
@@ -29,22 +29,22 @@ const SideBarDrawer = ({ children, isOpen, onOpen, onClose, className }) => {
const sideBarDrawerBackground = window.document.getElementById('sidebar-drawer-background')
if (showStatus) {
- sideBarDrawer.classList.replace('-ml-56', 'ml-0')
+ sideBarDrawer.classList.replace('-ml-60', 'ml-0')
sideBarDrawerBackground.classList.replace('hidden', 'block')
} else {
- sideBarDrawer.classList.replace('ml-0', '-ml-56')
+ sideBarDrawer.classList.replace('ml-0', '-ml-60')
sideBarDrawerBackground.classList.replace('block', 'hidden')
}
}
- return