Skip to content

Lighthouse Beacon

A lighthouse rises from the button, the beacon rotates casting light, ocean waves light up below, and the destination marker appears

Lighthouse Beacon

by FreeCsStyles Dev's

AnimatedStorybook
🌐🎨⚛️💚🅰️🔥☁️
#lighthouse#beacon#guide#ocean#navigate#light

Embed this component

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

<iframe src="/embed/lighthouse-beacon-button" sandbox="allow-scripts" loading="lazy" title="Lighthouse Beacon" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Lighthouse Beacon, 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-lighthouse" id="lighthouseBtn" onclick="triggerLighthouse()">
  <span class="lighthouse-icon">🏗️</span>
  <span class="beacon-light"></span>
  <span class="ocean"></span>
  <span class="destination">📍</span>
  <span class="text">🔭 Guide</span>
</button>
<script>
function triggerLighthouse() {
  const btn = document.getElementById('lighthouseBtn');
  if (btn.classList.contains('is-rising')) return;
  btn.classList.add('is-rising');
  btn.querySelector('.text').innerText = '🏗️ Rising...';
  setTimeout(() => { btn.classList.add('is-beacon'); btn.querySelector('.text').innerText = '💡 Guiding...'; }, 600);
  setTimeout(() => { btn.classList.add('is-ocean'); }, 1200);
  setTimeout(() => { btn.classList.add('is-destination'); btn.querySelector('.text').innerText = '📍 Found!'; }, 2000);
  setTimeout(() => { btn.classList.remove('is-rising','is-beacon','is-ocean','is-destination'); btn.querySelector('.text').innerText = '🔭 Guide'; }, 5000);
}
</script>
CSS
.btn-lighthouse{width:180px;height:50px;border-radius:12px;border:2px solid #38bdf8;background:#0c4a6e;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .5s cubic-bezier(.4,0,.2,1);font-family:system-ui,sans-serif}
.btn-lighthouse .lighthouse-icon{position:absolute;font-size:18px;opacity:0;transform:translateY(20px)}
.btn-lighthouse .beacon-light{position:absolute;top:50%;left:50%;width:120px;height:4px;background:linear-gradient(90deg,transparent,#fbbf24,transparent);transform:translate(-50%,-50%);opacity:0;transform-origin:center}
.btn-lighthouse .ocean{position:absolute;bottom:0;left:0;width:100%;height:8px;background:linear-gradient(90deg,#0ea5e9,#38bdf8,#0ea5e9);opacity:0;border-radius:0 0 12px 12px}
.btn-lighthouse .destination{position:absolute;top:-5px;right:-5px;font-size:16px;opacity:0;transform:scale(0)}
.btn-lighthouse .text{z-index:2;transition:.3s}
.btn-lighthouse.is-rising .lighthouse-icon{opacity:1;animation:lighthouse-rise .6s cubic-bezier(.34,1.56,.64,1) forwards}
.btn-lighthouse.is-beacon .beacon-light{opacity:1;animation:beacon-sweep 1.5s linear infinite}
.btn-lighthouse.is-beacon .lighthouse-icon{opacity:1;transform:translateY(0)}
.btn-lighthouse.is-ocean .ocean{opacity:1;animation:ocean-wave 2s ease-in-out infinite}
.btn-lighthouse.is-destination .destination{opacity:1;animation:dest-pop .5s cubic-bezier(.34,1.56,.64,1)}
.btn-lighthouse.is-destination{box-shadow:0 0 30px rgba(56,189,248,0.5);background:#075985}
@keyframes lighthouse-rise{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}
@keyframes beacon-sweep{0%{transform:translate(-50%,-50%) rotate(0deg)}100%{transform:translate(-50%,-50%) rotate(360deg)}}
@keyframes ocean-wave{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@keyframes dest-pop{0%{opacity:0;transform:scale(0)}60%{opacity:1;transform:scale(1.3)}100%{opacity:1;transform:scale(1)}}
Tailwind CSS
<button class="w-[180px] h-[50px] rounded-xl border-2 border-sky-400 bg-sky-900 text-white text-base font-bold cursor-pointer relative flex items-center justify-center overflow-hidden transition-all duration-500 font-sans">
  <span class="relative z-10">🔭 Guide</span>
</button>
React
import { useState } from 'react';
export function LighthouseBeaconButton() {
  const [phase, setPhase] = useState('idle');
  const handleClick = () => {
    if (phase !== 'idle') return;
    setPhase('rising');
    setTimeout(() => setPhase('beacon'), 600);
    setTimeout(() => setPhase('ocean'), 1200);
    setTimeout(() => setPhase('destination'), 2000);
    setTimeout(() => setPhase('idle'), 5000);
  };
  const labels = { idle: '🔭 Guide', rising: '🏗️ Rising...', beacon: '💡 Guiding...', ocean: '🌊 Lighting...', destination: '📍 Found!' };
  const bg = phase === 'destination' ? '#075985' : '#0c4a6e';
  return (
    <button onClick={handleClick} disabled={phase !== 'idle'}
      style={{ width: 180, height: 50, borderRadius: 12, border: '2px solid #38bdf8', background: bg, 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.5s cubic-bezier(0.4,0,0.2,1)', boxShadow: phase === 'destination' ? '0 0 30px rgba(56,189,248,0.5)' : 'none' }}>
      {(phase === 'rising' || phase === 'beacon' || phase === 'ocean' || phase === 'destination') && <span style={{ position: 'absolute', fontSize: 18, animation: 'lighthouse-rise 0.6s cubic-bezier(0.34,1.56,0.64,1) forwards' }}>🏗️</span>}
      {(phase === 'beacon' || phase === 'ocean' || phase === 'destination') && <span style={{ position: 'absolute', top: '50%', left: '50%', width: 120, height: 4, background: 'linear-gradient(90deg,transparent,#fbbf24,transparent)', animation: 'beacon-sweep 1.5s linear infinite', transformOrigin: 'center' }}></span>}
      {(phase === 'ocean' || phase === 'destination') && <span style={{ position: 'absolute', bottom: 0, left: 0, width: '100%', height: 8, background: 'linear-gradient(90deg,#0ea5e9,#38bdf8,#0ea5e9)', animation: 'ocean-wave 2s ease-in-out infinite', borderRadius: '0 0 12px 12px' }}></span>}
      {phase === 'destination' && <span style={{ position: 'absolute', top: -5, right: -5, fontSize: 16, animation: 'dest-pop 0.5s cubic-bezier(0.34,1.56,0.64,1)' }}>📍</span>}
      <span style={{ position: 'relative', zIndex: 2 }}>{labels[phase]}</span>
    </button>
  );
}
Vue
<template>
  <button class="btn-lighthouse" :class="phase" @click="handleClick" :disabled="phase!=='idle'">
    <span class="lighthouse-icon">🏗️</span>
    <span class="beacon-light"></span>
    <span class="ocean"></span>
    <span class="destination">📍</span>
    <span class="text">{{ label }}</span>
  </button>
</template>
<script setup>
import { ref, computed } from 'vue';
const phase = ref('idle');
const labels = { idle: '🔭 Guide', rising: '🏗️ Rising...', beacon: '💡 Guiding...', ocean: '🌊 Lighting...', destination: '📍 Found!' };
const label = computed(() => labels[phase.value]);
function handleClick() {
  if (phase.value !== 'idle') return;
  phase.value = 'rising';
  setTimeout(() => phase.value = 'beacon', 600);
  setTimeout(() => phase.value = 'ocean', 1200);
  setTimeout(() => phase.value = 'destination', 2000);
  setTimeout(() => phase.value = 'idle', 5000);
}
</script>
<style scoped>
.btn-lighthouse{width:180px;height:50px;border-radius:12px;border:2px solid #38bdf8;background:#0c4a6e;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .5s;font-family:system-ui,sans-serif}
.btn-lighthouse .lighthouse-icon{position:absolute;font-size:18px;opacity:0;transform:translateY(20px)}
.btn-lighthouse .beacon-light{position:absolute;top:50%;left:50%;width:120px;height:4px;background:linear-gradient(90deg,transparent,#fbbf24,transparent);transform:translate(-50%,-50%);opacity:0;transform-origin:center}
.btn-lighthouse .ocean{position:absolute;bottom:0;left:0;width:100%;height:8px;background:linear-gradient(90deg,#0ea5e9,#38bdf8,#0ea5e9);opacity:0;border-radius:0 0 12px 12px}
.btn-lighthouse .destination{position:absolute;top:-5px;right:-5px;font-size:16px;opacity:0;transform:scale(0)}
.btn-lighthouse .text{z-index:2}
.btn-lighthouse.rising .lighthouse-icon{opacity:1;animation:lr .6s cubic-bezier(.34,1.56,.64,1) forwards}
.btn-lighthouse.beacon .beacon-light{opacity:1;animation:bs 1.5s linear infinite}
.btn-lighthouse.beacon .lighthouse-icon{opacity:1;transform:translateY(0)}
.btn-lighthouse.ocean .ocean{opacity:1;animation:ow 2s ease-in-out infinite}
.btn-lighthouse.destination .destination{opacity:1;animation:dpop .5s cubic-bezier(.34,1.56,.64,1)}
.btn-lighthouse.destination{box-shadow:0 0 30px rgba(56,189,248,.5);background:#075985}
@keyframes lr{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}
@keyframes bs{0%{transform:translate(-50%,-50%) rotate(0)}100%{transform:translate(-50%,-50%) rotate(360deg)}}
@keyframes ow{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}
@keyframes dpop{0%{opacity:0;transform:scale(0)}60%{opacity:1;transform:scale(1.3)}100%{opacity:1;transform:scale(1)}}
</style>
Svelte
<script>
  let phase = 'idle';
  const labels = { idle: '🔭 Guide', rising: '🏗️ Rising...', beacon: '💡 Guiding...', ocean: '🌊 Lighting...', destination: '📍 Found!' };
  function handleClick() {
    if (phase !== 'idle') return;
    phase = 'rising';
    setTimeout(() => phase = 'beacon', 600);
    setTimeout(() => phase = 'ocean', 1200);
    setTimeout(() => phase = 'destination', 2000);
    setTimeout(() => phase = 'idle', 5000);
  }
</script>
<button class="btn-lighthouse" class:rising={phase==='rising'} class:beacon={phase==='beacon'} class:ocean={phase==='ocean'} class:destination={phase==='destination'} on:click={handleClick} disabled={phase!=='idle'}>
  <span class="lighthouse-icon">🏗️</span>
  <span class="beacon-light"></span>
  <span class="ocean"></span>
  <span class="destination">📍</span>
  <span class="text">{labels[phase]}</span>
</button>
<style>
.btn-lighthouse{width:180px;height:50px;border-radius:12px;border:2px solid #38bdf8;background:#0c4a6e;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .5s;font-family:system-ui,sans-serif}
.btn-lighthouse .lighthouse-icon{position:absolute;font-size:18px;opacity:0;transform:translateY(20px)}.btn-lighthouse .beacon-light{position:absolute;top:50%;left:50%;width:120px;height:4px;background:linear-gradient(90deg,transparent,#fbbf24,transparent);transform:translate(-50%,-50%);opacity:0;transform-origin:center}.btn-lighthouse .ocean{position:absolute;bottom:0;left:0;width:100%;height:8px;background:linear-gradient(90deg,#0ea5e9,#38bdf8,#0ea5e9);opacity:0;border-radius:0 0 12px 12px}.btn-lighthouse .destination{position:absolute;top:-5px;right:-5px;font-size:16px;opacity:0;transform:scale(0)}.btn-lighthouse .text{z-index:2}.btn-lighthouse.rising .lighthouse-icon{opacity:1;animation:lr .6s cubic-bezier(.34,1.56,.64,1) forwards}.btn-lighthouse.beacon .beacon-light{opacity:1;animation:bs 1.5s linear infinite}.btn-lighthouse.beacon .lighthouse-icon{opacity:1;transform:translateY(0)}.btn-lighthouse.ocean .ocean{opacity:1;animation:ow 2s ease-in-out infinite}.btn-lighthouse.destination .destination{opacity:1;animation:dpop .5s cubic-bezier(.34,1.56,.64,1)}.btn-lighthouse.destination{box-shadow:0 0 30px rgba(56,189,248,.5);background:#075985}@keyframes lr{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@keyframes bs{0%{transform:translate(-50%,-50%) rotate(0)}100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes ow{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}@keyframes dpop{0%{opacity:0;transform:scale(0)}60%{opacity:1;transform:scale(1.3)}100%{opacity:1;transform:scale(1)}}
</style>
Angular
import { Component } from '@angular/core';
@Component({
  selector: 'app-lighthouse-beacon-button',
  template: `<button class="btn-lighthouse" [class.rising]="phase==='rising'" [class.beacon]="phase==='beacon'" [class.ocean]="phase==='ocean'" [class.destination]="phase==='destination'" (click)="handleClick()" [disabled]="phase!=='idle'">
    <span class="lighthouse-icon">🏗️</span>
    <span class="beacon-light"></span>
    <span class="ocean"></span>
    <span class="destination">📍</span>
    <span class="text">{{ label }}</span>
  </button>`,
  styles: [`.btn-lighthouse{width:180px;height:50px;border-radius:12px;border:2px solid #38bdf8;background:#0c4a6e;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .5s;font-family:system-ui,sans-serif}.btn-lighthouse .lighthouse-icon{position:absolute;font-size:18px;opacity:0;transform:translateY(20px)}.btn-lighthouse .beacon-light{position:absolute;top:50%;left:50%;width:120px;height:4px;background:linear-gradient(90deg,transparent,#fbbf24,transparent);transform:translate(-50%,-50%);opacity:0;transform-origin:center}.btn-lighthouse .ocean{position:absolute;bottom:0;left:0;width:100%;height:8px;background:linear-gradient(90deg,#0ea5e9,#38bdf8,#0ea5e9);opacity:0;border-radius:0 0 12px 12px}.btn-lighthouse .destination{position:absolute;top:-5px;right:-5px;font-size:16px;opacity:0;transform:scale(0)}.btn-lighthouse .text{z-index:2}.btn-lighthouse.rising .lighthouse-icon{opacity:1;animation:lr .6s cubic-bezier(.34,1.56,.64,1) forwards}.btn-lighthouse.beacon .beacon-light{opacity:1;animation:bs 1.5s linear infinite}.btn-lighthouse.beacon .lighthouse-icon{opacity:1;transform:translateY(0)}.btn-lighthouse.ocean .ocean{opacity:1;animation:ow 2s ease-in-out infinite}.btn-lighthouse.destination .destination{opacity:1;animation:dpop .5s cubic-bezier(.34,1.56,.64,1)}.btn-lighthouse.destination{box-shadow:0 0 30px rgba(56,189,248,.5);background:#075985}@keyframes lr{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@keyframes bs{0%{transform:translate(-50%,-50%) rotate(0)}100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes ow{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}@keyframes dpop{0%{opacity:0;transform:scale(0)}60%{opacity:1;transform:scale(1.3)}100%{opacity:1;transform:scale(1)}}`]
})
export class LighthouseBeaconButtonComponent {
  phase = 'idle';
  labels: Record<string,string> = { idle: '🔭 Guide', rising: '🏗️ Rising...', beacon: '💡 Guiding...', ocean: '🌊 Lighting...', destination: '📍 Found!' };
  get label() { return this.labels[this.phase]; }
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'rising';
    setTimeout(() => this.phase = 'beacon', 600);
    setTimeout(() => this.phase = 'ocean', 1200);
    setTimeout(() => this.phase = 'destination', 2000);
    setTimeout(() => this.phase = 'idle', 5000);
  }
}
LWC — HTML template
<template><button class="btn-lighthouse" class:rising={isRising} class:beacon={isBeacon} class:ocean={isOcean} class:destination={isDestination} onclick={handleClick} disabled={disabled}>
  <span class="lighthouse-icon">🏗️</span>
  <span class="beacon-light"></span>
  <span class="ocean"></span>
  <span class="destination">📍</span>
  <span class="text">{label}</span>
</button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class LighthouseBeaconButton extends LightningElement {
  phase = 'idle';
  get disabled() { return this.phase !== 'idle'; }
  get isRising() { return this.phase === 'rising'; }
  get isBeacon() { return this.phase === 'beacon'; }
  get isOcean() { return this.phase === 'ocean'; }
  get isDestination() { return this.phase === 'destination'; }
  get label() { return { idle: '🔭 Guide', rising: '🏗️ Rising...', beacon: '💡 Guiding...', ocean: '🌊 Lighting...', destination: '📍 Found!' }[this.phase]; }
  handleClick() {
    if (this.phase !== 'idle') return;
    this.phase = 'rising';
    setTimeout(() => this.phase = 'beacon', 600);
    setTimeout(() => this.phase = 'ocean', 1200);
    setTimeout(() => this.phase = 'destination', 2000);
    setTimeout(() => this.phase = 'idle', 5000);
  }
}
LWC — CSS
.btn-lighthouse{width:180px;height:50px;border-radius:12px;border:2px solid #38bdf8;background:#0c4a6e;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .5s;font-family:system-ui,sans-serif}.btn-lighthouse .lighthouse-icon{position:absolute;font-size:18px;opacity:0;transform:translateY(20px)}.btn-lighthouse .beacon-light{position:absolute;top:50%;left:50%;width:120px;height:4px;background:linear-gradient(90deg,transparent,#fbbf24,transparent);transform:translate(-50%,-50%);opacity:0;transform-origin:center}.btn-lighthouse .ocean{position:absolute;bottom:0;left:0;width:100%;height:8px;background:linear-gradient(90deg,#0ea5e9,#38bdf8,#0ea5e9);opacity:0;border-radius:0 0 12px 12px}.btn-lighthouse .destination{position:absolute;top:-5px;right:-5px;font-size:16px;opacity:0;transform:scale(0)}.btn-lighthouse .text{z-index:2}.btn-lighthouse.rising .lighthouse-icon{opacity:1;animation:lr .6s cubic-bezier(.34,1.56,.64,1) forwards}.btn-lighthouse.beacon .beacon-light{opacity:1;animation:bs 1.5s linear infinite}.btn-lighthouse.beacon .lighthouse-icon{opacity:1;transform:translateY(0)}.btn-lighthouse.ocean .ocean{opacity:1;animation:ow 2s ease-in-out infinite}.btn-lighthouse.destination .destination{opacity:1;animation:dpop .5s cubic-bezier(.34,1.56,.64,1)}.btn-lighthouse.destination{box-shadow:0 0 30px rgba(56,189,248,.5);background:#075985}@keyframes lr{0%{opacity:0;transform:translateY(20px)}100%{opacity:1;transform:translateY(0)}}@keyframes bs{0%{transform:translate(-50%,-50%) rotate(0)}100%{transform:translate(-50%,-50%) rotate(360deg)}}@keyframes ow{0%,100%{transform:translateY(0)}50%{transform:translateY(-2px)}}@keyframes dpop{0%{opacity:0;transform:scale(0)}60%{opacity:1;transform:scale(1.3)}100%{opacity:1;transform:scale(1)}}
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 Lighthouse Beacon fits

  • Guide
  • Navigate
  • Tutorial
  • Documentation

Interaction states & animations

  • Lighthouse Rise
  • Beacon Rotate
  • Ocean Glow
  • Destination Reveal

Topics

  • #lighthouse
  • #beacon
  • #guide
  • #ocean
  • #navigate
  • #light

Accessibility notes

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

Browser support

  • All modern browsers