diff --git a/blog.config.js b/blog.config.js index 14d1ee47..b0d093db 100644 --- a/blog.config.js +++ b/blog.config.js @@ -60,6 +60,9 @@ const BLOG = { // 鼠标点击烟花特效 FIREWORKS: process.env.NEXT_PUBLIC_FIREWORKS || true, // 鼠标点击烟花特效 + // 是否启用彩色的烟花 + FIREWORKSCOLOR: true, + FIREWORKSBIG: true, // 悬浮挂件 WIDGET_PET: process.env.NEXT_PUBLIC_WIDGET_PET || true, // 是否显示宠物挂件 diff --git a/components/Fireworks.js b/components/Fireworks.js index 3ccdec7e..74729199 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,7 +18,10 @@ export const Fireworks = () => { * @param config */ function createFireworks(config) { - const defaultColors = ['102, 167, 221', '62, 131, 225', '33, 78, 194'] + let defaultColors = [] + BLOG.FIREWORKSCOLOR + ? defaultColors = ['255, 20, 97', '24, 255, 146', '90, 135, 255', '251, 243, 140'] + : defaultColors = ['102, 167, 221', '62, 131, 225', '33, 78, 194'] const defaultConfig = { colors: defaultColors, numberOfParticules: 20,