How to Add Snowfall Effect for a Specific Space in FluentCommunity
During seasonal events (like Christmas or New Year), many communities want to add a festive snowfall effect. However, the challenge in FluentCommunity is that it uses SPA navigation (no full page reload), so normal scripts will only run after pressing F5.
Here is a ready-to-use SnowFX script that:
- Runs only on designated spaces (e.g.,
/forum/space/code/home) - Does not run on other spaces or in the admin panel
- Is SPA-aware β works when you navigate by clicking inside the forum (no refresh needed)
- Lightweight, vanilla JS (no external libraries)
π§ Installation
- Go to Forum Settings β Customization β Custom JavaScript (screenshot below).
- Paste the script into the JavaScript box.
- Edit the
ALLOWED_SPACESlist to include the sub-forums where you want the snow effect. - Save β Done β
π Script (copy & paste)
https://gist.github.com/vanamlevn-creator/59512d1dec68b134c47cbcade92885c9
β Demo
- Works only on
/forum/space/code/home(or any space you define). - When you click around inside FluentCommunity, the snow will appear/disappear correctly.
- No effect in
/forum/adminor/wp-admin.
π Bonus
- You can enable a seasonal mode (only from September to December) by adding a simple date check.
- Or change
cfg.colortoyellowand replace flakes with βπΈβ to simulate falling petals.
Please use gist.github.com or other free (non ads) services. I would appriciate if you change the URL.
