- Views: 84
- Replies: 2
Spread some festive cheer by adding a snowfall effect to your XenForo forum! This guide will walk you through the steps to integrate a simple snowfall script into your forum.
Save the template.
Save the changes.
Step 1: Create the JavaScript File
- Create a new JavaScript file named <span>snowfall.js</span>.
- Add the following code to the file:
JAVASCRIPT:
You must log in to view
(59 lines)
- Save the file and upload it to the <span>js/snowfall/</span> directory of your XenForo installation. If the <span>snowfall</span> folder does not exist, create it.
Step 2: Add the Script to XenForo
- Log in to your XenForo Admin Control Panel.
- Navigate to Appearance > Templates > PAGE_CONTAINER.
- Locate the </body> tag at the bottom of the template.
- Add the following line just before the </body> tag:
JAVASCRIPT:
You must log in to view
(1 lines)
Save the template.
Step 3: Optional Styling
To adjust the opacity of the snowfall effect, you can add some CSS to your XenForo style:- Go to Appearance > Styles > Templates > Extra.less.
- Add the following CSS:
CSS:
You must log in to view
(3 lines)
Save the changes.
Step 4: Test the Effect
Visit your forum in a browser and refresh the page. You should see a beautiful snowfall effect on your forum.Notes
- The script is lightweight and runs efficiently on most modern browsers.
- You can adjust the <span>maxParticles</span> value in the script to control the number of snowflakes.