Skip to content

Firefly Night

Highlight button with fireflies appearing, circling, forming checkmark, and fading gently

Firefly Night

by FreeCsStyles Dev's

AnimatedStorybook
🌐🎨⚛️💚🅰️🔥☁️
#firefly#night#glow#highlight#gentle#magical

Embed this component

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

<iframe src="/embed/firefly-night" sandbox="allow-scripts" loading="lazy" title="Firefly Night" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Firefly Night, 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-firefly"><span class="icon">✨</span><span class="text">Highlight</span><div class="fireflies"><span class="fly fly-1"></span><span class="fly fly-2"></span><span class="fly fly-3"></span><span class="fly fly-4"></span><span class="fly fly-5"></span></div></button>
CSS
.btn-firefly{width:180px;height:60px;border-radius:12px;border:none;background:linear-gradient(135deg,#1e3a5f,#0f172a);color:#fef08a;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;gap:8px;overflow:hidden;transition:all .4s;font-family:system-ui,sans-serif;z-index:1}.btn-firefly .icon,.btn-firefly .text{position:relative;z-index:2;transition:all .3s}.btn-firefly .fireflies{position:absolute;inset:0;pointer-events:none;z-index:3}.btn-firefly .fly{position:absolute;width:6px;height:6px;background:#fef08a;border-radius:50%;box-shadow:0 0 10px #fef08a,0 0 20px #facc15;opacity:0}.btn-firefly .fly-1{top:20%;left:10%}.btn-firefly .fly-2{top:70%;right:15%}.btn-firefly .fly-3{top:40%;left:50%}.btn-firefly .fly-4{top:15%;right:30%}.btn-firefly .fly-5{bottom:20%;left:30%}.btn-firefly.is-glowing .fly{animation:firefly-float 2s ease-in-out infinite}.btn-firefly.is-glowing .fly-1{animation-delay:0s}.btn-firefly.is-glowing .fly-2{animation-delay:.3s}.btn-firefly.is-glowing .fly-3{animation-delay:.6s}.btn-firefly.is-glowing .fly-4{animation-delay:.9s}.btn-firefly.is-glowing .fly-5{animation-delay:1.2s}.btn-firefly.is-glowing .icon{animation:firefly-pulse 1s ease-in-out infinite}.btn-firefly.is-glowing .text{opacity:0}.btn-firefly.is-highlighted{background:linear-gradient(135deg,#365314,#1a2e05);border:2px solid #a3e635;box-shadow:0 0 30px rgba(163,230,53,.4)}.btn-firefly.is-highlighted .fly{animation:firefly-circle 1.5s ease-in-out infinite}.btn-firefly.is-highlighted .icon{animation:firefly-check .5s ease-out forwards}@keyframes firefly-float{0%,100%{opacity:0;transform:translate(0,0) scale(.5)}25%{opacity:1;transform:translate(5px,-10px) scale(1)}50%{opacity:.8;transform:translate(-5px,-5px) scale(.8)}75%{opacity:1;transform:translate(10px,-15px) scale(1)}}@keyframes firefly-circle{0%{opacity:1;transform:rotate(0deg) translateX(20px) rotate(0deg)}100%{opacity:1;transform:rotate(360deg) translateX(20px) rotate(-360deg)}}@keyframes firefly-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.2)}}@keyframes firefly-check{0%{opacity:0;transform:scale(0)}50%{opacity:1;transform:scale(1.2)}100%{opacity:1;transform:scale(1)}}
Tailwind CSS
<button class="relative w-[180px] h-[60px] rounded-xl bg-gradient-to-br from-slate-800 to-slate-900 text-yellow-200 font-bold text-base flex items-center justify-center gap-2 overflow-hidden transition-all duration-300 hover:shadow-lg hover:shadow-yellow-500/30"><span class="relative z-10">✨ Highlight</span></button>
React
import { useState } from 'react';
export function FireflyNightButton() {
  const [phase, setPhase] = useState('idle');
  const handleClick = () => {
    if (phase !== 'idle') return;
    setPhase('glowing');
    setTimeout(() => setPhase('highlighted'), 1500);
    setTimeout(() => setPhase('idle'), 4000);
  };
  return (
    <button onClick={handleClick} disabled={phase !== 'idle'}
      style={{
        width: 180, height: 60, borderRadius: 12, border: phase === 'highlighted' ? '2px solid #a3e635' : 'none',
        background: phase === 'highlighted' ? 'linear-gradient(135deg, #365314, #1a2e05)' : 'linear-gradient(135deg, #1e3a5f, #0f172a)',
        color: '#fef08a', fontSize: 16, fontWeight: 'bold', cursor: 'pointer',
        position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
        overflow: 'hidden', fontFamily: 'system-ui,sans-serif',
        boxShadow: phase === 'highlighted' ? '0 0 30px rgba(163,230,53,0.4)' : 'none',
        transition: 'all 0.4s'
      }}>
      <span style={{ position: 'relative', zIndex: 10 }}>
        {phase === 'idle' ? '✨ Highlight' : phase === 'highlighted' ? '✓ Highlighted' : '✨'}
      </span>
      {phase !== 'idle' && [
        <span key="f1" style={{ position: 'absolute', top: '20%', left: '10%', width: 6, height: 6, background: '#fef08a', borderRadius: '50%', boxShadow: '0 0 10px #fef08a', animation: 'firefly-float 2s ease-in-out infinite', zIndex: 20 }} />,
        <span key="f2" style={{ position: 'absolute', top: '70%', right: '15%', width: 6, height: 6, background: '#fef08a', borderRadius: '50%', boxShadow: '0 0 10px #fef08a', animation: 'firefly-float 2s ease-in-out infinite 0.3s', zIndex: 20 }} />,
        <span key="f3" style={{ position: 'absolute', top: '40%', left: '50%', width: 6, height: 6, background: '#fef08a', borderRadius: '50%', boxShadow: '0 0 10px #fef08a', animation: 'firefly-float 2s ease-in-out infinite 0.6s', zIndex: 20 }} />
      ]}
    </button>
  );
}
Vue
<template>
  <button class="btn-firefly" :class="phaseClass" @click="handleClick" :disabled="phase !== 'idle'">
    <span class="icon">{{ phase === 'idle' ? '✨' : phase === 'highlighted' ? '✓' : '✨' }}</span>
    <span class="text">{{ phase === 'idle' ? 'Highlight' : phase === 'highlighted' ? 'Highlighted' : '' }}</span>
    <div class="fireflies">
      <span class="fly fly-1"></span>
      <span class="fly fly-2"></span>
      <span class="fly fly-3"></span>
      <span class="fly fly-4"></span>
      <span class="fly fly-5"></span>
    </div>
  </button>
</template>
<script setup>
import { ref, computed } from 'vue';
const phase = ref('idle');
const phaseClass = computed(() => `is-${phase.value}`);
function handleClick() {
  if (phase.value !== 'idle') return;
  phase.value = 'glowing';
  setTimeout(() => phase.value = 'highlighted', 1500);
  setTimeout(() => phase.value = 'idle', 4000);
}
</script>
Svelte
<script>
  let phase = 'idle';
  function handleClick() {
    if (phase !== 'idle') return;
    phase = 'glowing';
    setTimeout(() => phase = 'highlighted', 1500);
    setTimeout(() => phase = 'idle', 4000);
  }
</script>
<button class="btn-firefly" class:is-highlighted={phase==='highlighted'} on:click={handleClick} disabled={phase !== 'idle'}>
  <span>{phase === 'idle' ? '✨ Highlight' : phase === 'highlighted' ? '✓ Highlighted' : '✨'}</span>
</button>
Angular
import { Component } from '@angular/core';
@Component({
  selector: 'app-firefly-button',
  template: `<button class="btn-firefly" [class.is-glowing]="phase==='glowing'" [class.is-highlighted]="phase==='highlighted'" (click)="handleClick()" [disabled]="phase!=='idle'"><span>{{ phase==='idle' ? '✨ Highlight' : phase==='highlighted' ? '✓ Highlighted' : '✨' }}</span></button>`,
  styles: [`.btn-firefly{width:180px;height:60px;border-radius:12px;border:none;background:linear-gradient(135deg,#1e3a5f,#0f172a);color:#fef08a;font-size:16px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;overflow:hidden;transition:all .4s}.btn-firefly.is-highlighted{border:2px solid #a3e635;box-shadow:0 0 30px rgba(163,230,53,.4)}`]
})
export class FireflyButtonComponent {
  phase = 'idle';
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'glowing';
    setTimeout(() => this.phase = 'highlighted', 1500);
    setTimeout(() => this.phase = 'idle', 4000);
  }
}
LWC — HTML template
<template><button class="btn-firefly" onclick={handleClick} disabled={disabled}><span>{label}</span></button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class FireflyNightButton extends LightningElement {
  phase = 'idle';
  get disabled() { return this.phase !== 'idle'; }
  get label() { return this.phase === 'idle' ? '✨ Highlight' : this.phase === 'highlighted' ? '✓ Highlighted' : '✨'; }
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'glowing';
    setTimeout(() => { this.phase = 'highlighted'; }, 1500);
    setTimeout(() => { this.phase = 'idle'; }, 4000);
  }
}
LWC — CSS
.btn-firefly{width:180px;height:60px;border-radius:12px;border:none;background:linear-gradient(135deg,#1e3a5f,#0f172a);color:#fef08a;font-size:16px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;overflow:hidden;transition:all .4s}.btn-firefly.is-highlighted{border:2px solid #a3e635;box-shadow:0 0 30px rgba(163,230,53,.4)}
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 Firefly Night fits

  • Highlight Actions
  • Favorite/Bookmark
  • Special Selection
  • Highlight Content

Interaction states & animations

  • Fireflies Appear
  • Circle
  • Checkmark Form
  • Gentle Fade

Topics

  • #firefly
  • #night
  • #glow
  • #highlight
  • #gentle
  • #magical

Accessibility notes

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

Browser support

  • All modern browsers