Snow Globe by Fluri
Shake your phone. Make it snow. Snow globe for any website.
Live demo → · All Fluri themes · No-code install for WordPress, Shopify, Wix & more at fluri.xyz
- Zero dependencies, about 19 KB minified
- Snow drifts like it’s in water and settles in caps on your real headings, buttons and cards
- Shake the phone to swirl it, tilt it and the snow slides; iPhone permission handled with one tap
- On desktop, shake the mouse or press the little globe
- Never blocks clicks; visible on light and dark pages; respects
prefers-reduced-motion
- Works with plain HTML, React, Vue, Svelte, Astro, Next.js and anything else
- TypeScript types included
Quick start: one line of HTML
Paste this before </body>:
<script src="https://cdn.jsdelivr.net/npm/@fluritheme/snow-globe@1/dist/snow-globe.global.js" data-auto></script>
Pass options as JSON:
<script src="https://cdn.jsdelivr.net/npm/@fluritheme/snow-globe@1/dist/snow-globe.global.js" data-auto data-options='{"message":"Here’s 10% off your first order.","code":"SNOWGLOBE10"}'></script>
The running effect is available as window.FluriSnowGlobe.instance.
Shaking on phones
Android phones shake straight away. iPhones ask for permission to use motion sensors, which Safari only allows after a tap, so the hint becomes a small "Tap here, then shake your phone" button. Without permission the globe button still works. On desktop, quickly moving the mouse back and forth shakes the globe.
Reward for shaking
Set message, code and optionally link to show a small card after the first shake, once per visit: a nice way to hand out a Christmas discount.
Install with npm
npm install @fluritheme/snow-globe
import { createSnowGlobe } from "@fluritheme/snow-globe";
const globe = createSnowGlobe({
palette: "glitter", // "snow" | "gold" | "pastel" | "brand"
amount: 1, // 0.3–2
// Optional reward after the first shake:
message: "Here’s 10% off your first order.",
code: "SNOWGLOBE10",
});
globe.shake(); // shake it from code
globe.shake(2); // a blizzard
// When leaving the page or unmounting a component:
globe.destroy();
React
import { useEffect } from "react";
import { createSnowGlobe } from "@fluritheme/snow-globe";
export function SnowGlobe() {
useEffect(() => {
const effect = createSnowGlobe();
return () => effect.destroy();
}, []);
return null;
}
Options
| Option |
What it does |
Default |
amount |
Amount of snow, 0.3–2 |
1 |
palette |
"snow", "glitter", "gold", "pastel" or "brand" |
"glitter" |
brandColor |
Your colour for the "brand" palette |
"#6e56cf" |
speed |
How fast it settles, 0.5–2 |
1 |
glass |
Curved glass reflections around the edges |
true |
motion |
Shake and tilt with the phone’s motion sensors |
true |
mouseShake |
Shaking the mouse back and forth makes it snow |
true |
button |
A small globe button that shakes it |
true |
position |
Button corner: "bottom-left" or "bottom-right" |
"bottom-left" |
surfaces |
Where snow piles up (CSS selector) |
"h1,h2,h3,.card,article,button,img,[data-snow-surface]" |
pile |
Snow piles up along the bottom of the screen |
true |
ambient |
Keep a light snowfall going after it settles |
true |
rewardTitle / message / code / link / linkText |
Optional reward card after the first shake |
— |
hint |
Hint text until the first shake, or false |
built-in |
root |
Limit the effect to one element |
document |
zIndex |
Stacking order |
2147483000 |
Methods
shake(strength?)
settle()
enableMotion()
showReward()
update(options)
getState()
pause()
resume()
destroy()
Great for
- Christmas shops: a discount for everyone who shakes the globe
- Winter landing pages, gift guides and holiday campaigns
- Portfolios and agencies that want a playful mobile moment
No code? Use Fluri
Don’t want to touch code? Fluri installs Snow Globe on WordPress, Shopify, Webflow, Wix, Squarespace and Framer with one snippet, with live settings and a dashboard. There are more than a dozen animated themes, from a pet dragon to a koi pond. See them all →
License
MIT © František Gejdoš · fluri.xyz