Files
giteaone 6cb65df45f effects
更新不同效果
2026-11-18 11:31:07 +08:00

38 lines
2.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* ─────────────────────────────────────────────────────────────
荧光渐变互动壁纸 — 共用配置
这里只放所有效果共享的部分:
· artwork —— 图形本身(vector / pixel 渲染、尺寸、颜色…)
· palette —— 共用荧光色板(点亮渐变 / 3D 高光 / 粒子都从这里取色)
· default_effect —— 页面打开时默认启用的效果
各效果自己的参数在 effects/ 目录下的独立配置文件里:
· effects/GraduallyBounces.js —— 渐亮弹跳(点击/停留点亮)
· effects/3Deffects.js —— 3D 跟随(鼠标方向与速度驱动倾斜)
以经典 <script> 加载(见 index.html),因此 file:// 直接打开
与静态服务器两种方式都会生效;修改后刷新页面即可。
请勿改成 <script type="module">:模块脚本在 file:// 下会被
浏览器的跨源策略拦截。
───────────────────────────────────────────────────────────── */
window.WALLPAPER_CONFIG = {
default_effect: 'GraduallyBounces', // 默认效果:'GraduallyBounces' 或 '3Deffects'
artwork: {
render_mode: 'vector', // vector = 直接沿 SVG 轮廓染渐变;pixel = 像素块模式
size: 'min(88vw, 88vh)', // 中央图形的宽度(任意 CSS 长度)
color: '#ffffff', // SVG 图形静置时的颜色(十六进制;两种渲染模式均生效)
opacity: 0.25, // SVG 图形静置时的不透明度 0–1(点击后的荧光效果不受影响)
pixel_resolution: 180, // 像素模式横向块数(越大越细腻)
pixel_threshold: 0.18, // 像素块的最小有效覆盖率,低于此值不点亮
hover_scale: 1.01 // 鼠标悬停时图形的放大系数(1 = 不放大,建议 1.02–1.08)
},
/* 共用色板:所有效果从这里取色(至少 3 个,最多 12 个) */
palette: [
'#d9ff3f',
'#39ffc2',
'#3aa0ff',
'#b06bff',
'#ff4f9a',
'#ffb63f'
]
};