Skip to content

Snow Globe

A button that shakes like a snow globe with swirling snowflakes inside

Snow Globe

by FreeCsStyles Dev's

AnimatedPlayful
🌐🎨⚛️💚🅰️🔥☁️
#snow#globe#shake#winter#snowflake#refresh#playful#seasonal

Embed this component

Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/snow-globe.

<iframe src="/embed/snow-globe" sandbox="allow-scripts" loading="lazy" title="Snow Globe" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Snow Globe, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.

HTML
<button class="btn-globe"><span class="text">Refresh</span></button>
CSS
.btn-globe{width:160px;height:50px;border-radius:12px;border:none;background:linear-gradient(135deg,#0284c7,#0369a1);color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .4s;font-family:system-ui,sans-serif;box-shadow:inset 0 0 10px rgba(255,255,255,.3)}.btn-globe .flake{position:absolute;top:-10px;font-size:10px;opacity:0;pointer-events:none}.btn-globe.is-shaking{animation:globe-shake .3s infinite}.btn-globe.is-shaking .flake{animation:snow-swirl 1.5s forwards ease-out}@keyframes globe-shake{0%,100%{transform:rotate(0deg)}25%{transform:rotate(-4deg) translateY(-2px)}75%{transform:rotate(4deg) translateY(2px)}}@keyframes snow-swirl{0%{transform:translate(0,0) scale(.5);opacity:1}50%{transform:translate(var(--tx),25px) scale(1.2);opacity:.8}100%{transform:translate(var(--tx),50px) scale(.2);opacity:0}}
Tailwind CSS
<button class="w-[160px] h-[50px] rounded-xl border-none bg-gradient-to-br from-sky-600 to-blue-700 text-white font-bold cursor-pointer relative flex items-center justify-center overflow-hidden transition-all duration-[400ms] font-sans shadow-[inset_0_0_10px_rgba(255,255,255,0.3)]"><span class="relative z-10">❄️ Refresh</span></button>
React
import { useState } from 'react';
export function SnowGlobe() {
  const [phase, setPhase] = useState('idle');
  const handleClick = () => {
    if (phase !== 'idle') return;
    setPhase('shaking');
    setTimeout(() => setPhase('idle'), 1800);
  };
  return (
    <button onClick={handleClick} disabled={phase !== 'idle'}
      style={{ width: 160, height: 50, borderRadius: 12, border: 'none', background: 'linear-gradient(135deg,#0284c7,#0369a1)', color: '#fff', fontSize: 16, fontWeight: 'bold', cursor: 'pointer', position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center', overflow: 'hidden', fontFamily: 'system-ui,sans-serif', transition: 'all 0.4s', boxShadow: 'inset 0 0 10px rgba(255,255,255,0.3)' }}>
      <span>{phase === 'idle' ? '❄️ Refresh' : '✨ Updated ✓'}</span>
    </button>
  );
}
Vue
<template>
  <button class="btn-globe" :class="phase" @click="handleClick" :disabled="phase!=='idle'">
    <span class="text">{{ phase==='idle' ? 'Refresh' : 'Updated ✓' }}</span>
  </button>
</template>
<script setup>
import { ref } from 'vue';
const phase = ref('idle');
function handleClick() {
  if (phase.value !== 'idle') return;
  phase.value = 'shaking';
  setTimeout(() => phase.value = 'idle', 1800);
}
</script>
Svelte
<script>
  let phase = 'idle';
  function handleClick() { if (phase !== 'idle') return; phase = 'shaking'; setTimeout(() => phase = 'idle', 1800); }
</script>
<button class="btn-globe" class:is-shaking={phase==='shaking'} on:click={handleClick} disabled={phase!=='idle'}>
  <span class="text">{phase==='idle' ? 'Refresh' : 'Updated ✓'}</span>
</button>
Angular
import { Component } from '@angular/core';
@Component({
  selector: 'app-snow-globe',
  template: `<button class="btn-globe" [class.is-shaking]="phase==='shaking'" (click)="handleClick()" [disabled]="phase!=='idle'"><span class="text">{{ phase==='idle' ? 'Refresh' : 'Updated ✓' }}</span></button>`,
  styles: [`.btn-globe{width:160px;height:50px;border-radius:12px;border:none;background:linear-gradient(135deg,#0284c7,#0369a1);color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}`]
})
export class SnowGlobeComponent { phase='idle';handleClick(){if(this.phase!=='idle')return;this.phase='shaking';setTimeout(()=>this.phase='idle',1800);}}
LWC — HTML template
<template><button class="btn-globe" onclick={handleClick} disabled={disabled}><span>{label}</span></button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class SnowGlobe extends LightningElement {
  phase = 'idle';
  get disabled() { return this.phase !== 'idle'; }
  get label() { return this.phase==='idle'?'❄️ Refresh':'✨ Updated ✓'; }
  handleClick() { if(this.phase!=='idle')return;this.phase='shaking';setTimeout(()=>this.phase='idle',1800); }
}
LWC — CSS
.btn-globe{width:160px;height:50px;border-radius:12px;border:none;background:linear-gradient(135deg,#0284c7,#0369a1);color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .4s}
LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
  <apiVersion>59.0</apiVersion>
  <isExposed>true</isExposed>
  <targets><target>lightning__AppPage</target><target>lightning__RecordPage</target><target>lightning__HomePage</target></targets>
</LightningComponentBundle>

Where Snow Globe fits

  • Refresh Actions
  • Loading States
  • Winter Themes
  • Seasonal UI
  • Playful Interactions

Interaction states & animations

  • Shake
  • Snow Swirl
  • Globe Effect

Topics

  • #snow
  • #globe
  • #shake
  • #winter
  • #snowflake
  • #refresh
  • #playful
  • #seasonal

Accessibility notes

Animation is decorative. Button text remains readable. Respect reduced-motion preference.

Browser support

  • All modern browsers