Skip to content

Coffee Brewing

Click to brew — liquid fills from the bottom, steam rises, then a warm amber glow signals fresh coffee

Coffee Brewing

by FreeCsStyles Dev's

StatefulFill Brew
🌐🎨⚛️💚🅰️🔥☁️
#coffee#brew#liquid#fill#steam#warm#progress

Embed this component

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

<iframe src="/embed/coffee-brewing-button" sandbox="allow-scripts" loading="lazy" title="Coffee Brewing" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>

Implementation code

Copy the HTML and CSS for Coffee Brewing, 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-coffee" id="coffeeBtn" onclick="triggerCoffee()">
  <div class="coffee-liquid"></div>
  <span class="text">Brew Coffee</span>
  <div class="steam" style="left:40%;animation-delay:0s"></div>
  <div class="steam" style="left:60%;animation-delay:0.5s"></div>
</button>
<script>
function triggerCoffee() {
  const btn=document.getElementById('coffeeBtn');
  if(btn.classList.contains('is-brewing')) return;
  btn.classList.add('is-brewing'); btn.querySelector('.text').innerText='Pouring...';
  setTimeout(()=>{btn.classList.add('is-ready');btn.querySelector('.text').innerText='Ready!';},2500);
  setTimeout(()=>{btn.classList.remove('is-brewing','is-ready');btn.querySelector('.text').innerText='Brew Coffee';},6500);
}
</script>
CSS
.btn-coffee{width:160px;height:50px;border-radius:12px;border:2px solid #52525b;background:#27272a;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 cubic-bezier(.4,0,.2,1);font-family:system-ui,sans-serif}.btn-coffee .coffee-liquid{position:absolute;bottom:0;left:0;width:100%;height:0%;background:#78350f;transition:height 2.5s ease-in-out;z-index:1}.btn-coffee .text{z-index:2;transition:color .3s}.btn-coffee .steam{position:absolute;bottom:100%;width:6px;height:20px;background:rgba(255,255,255,.4);border-radius:10px;filter:blur(2px);opacity:0}.btn-coffee.is-brewing .coffee-liquid{height:100%}.btn-coffee.is-ready{border-color:#d97706;box-shadow:0 0 15px rgba(217,119,6,.3)}.btn-coffee.is-ready .steam{animation:rise-steam 2s infinite ease-out}@keyframes rise-steam{0%{transform:translateY(10px) scaleX(1);opacity:0}50%{opacity:.6}100%{transform:translateY(-30px) scaleX(2);opacity:0}}
Tailwind CSS
<button class="w-[160px] h-[50px] rounded-xl border-2 border-zinc-600 bg-zinc-800 text-white text-base font-bold cursor-pointer relative flex items-center justify-center overflow-hidden transition-all duration-400 [&.is-brewing_.coffee-liquid]:h-full [&.is-ready]:border-amber-600 [&.is-ready]:shadow-[0_0_15px_rgba(217,119,6,0.3)]" id="tw-coffee">
  <div class="coffee-liquid absolute bottom-0 left-0 w-full h-0 bg-amber-900 transition-all duration-[2.5s] ease-in-out z-[1]"></div>
  <span class="text relative z-[2]">Brew Coffee</span>
  <div class="steam absolute bottom-full w-[6px] h-5 bg-white/40 rounded-[10px] blur-sm opacity-0" style="left:40%;animation:rise-steam 2s infinite ease-out 0s"></div>
  <div class="steam absolute bottom-full w-[6px] h-5 bg-white/40 rounded-[10px] blur-sm opacity-0" style="left:60%;animation:rise-steam 2s infinite ease-out 0.5s"></div>
</button>
React
import React from 'react';
import { motion } from 'framer-motion';

function CoffeeBrewingButton() {
  const [state, setState] = React.useState('idle');
  const handleClick = () => {
    if (state !== 'idle') return;
    setState('brewing');
    setTimeout(() => setState('ready'), 2500);
    setTimeout(() => setState('idle'), 6500);
  };
  const br = state === 'brewing';
  const rd = state === 'ready';
  return (
    <motion.button onClick={handleClick}
      style={{ width: 160, height: 50, borderRadius: 12, border: `2px solid ${rd ? '#d97706' : '#52525b'}`, cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', position: 'relative', fontSize: 16, fontWeight: 700, color: '#fff', background: '#27272a', boxShadow: rd ? '0 0 15px rgba(217,119,6,0.3)' : 'none', overflow: 'hidden', fontFamily: 'system-ui, sans-serif' }}
      whileTap={state === 'idle' ? { scale: 0.95 } : {}} disabled={state !== 'idle'}>
      <motion.div style={{ position: 'absolute', bottom: 0, left: 0, right: 0, height: '0%', background: '#78350f', zIndex: 1 }}
        animate={br ? { height: '100%', transition: { duration: 2.5, ease: 'easeInOut' } } : { height: '0%', transition: { duration: 0.5 } }} />
      <span style={{ position: 'relative', zIndex: 2 }}>{rd ? 'Ready!' : br ? 'Pouring...' : 'Brew Coffee'}</span>
      {br && [0,1].map(i => (
        <motion.div key={i} style={{ position: 'absolute', bottom: '100%', left: `${40+i*20}%`, width: 6, height: 20, background: 'rgba(255,255,255,0.4)', borderRadius: 10, filter: 'blur(2px)', zIndex: 3 }}
          animate={{ y: [-10, -40], x: i===0 ? [-2,4] : [2,-4], scaleX: [1,2], opacity: [0,0.6,0] }}
          transition={{ duration: 2, repeat: Infinity, ease: 'easeOut', delay: i*0.5 }} />
      ))}
    </motion.button>
  );
}
Vue
<template>
  <button class="btn-coffee" :class="{'is-brewing':state==='brewing','is-ready':state==='ready'}" @click="handleClick" :disabled="state!=='idle'">
    <div class="coffee-liquid"></div>
    <span class="text">{{ state==='ready' ? 'Ready!' : state==='brewing' ? 'Pouring...' : 'Brew Coffee' }}</span>
    <div class="steam" style="left:40%"></div>
    <div class="steam" style="left:60%;animation-delay:0.5s"></div>
  </button>
</template>
<script setup>
import { ref } from 'vue';
const state = ref('idle');
function handleClick() {
  if (state.value !== 'idle') return;
  state.value = 'brewing';
  setTimeout(() => state.value = 'ready', 2500);
  setTimeout(() => state.value = 'idle', 6500);
}
</script>
<style scoped>
.btn-coffee{width:160px;height:50px;border-radius:12px;border:2px solid #52525b;background:#27272a;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 cubic-bezier(.4,0,.2,1)}.btn-coffee .coffee-liquid{position:absolute;bottom:0;left:0;width:100%;height:0%;background:#78350f;transition:height 2.5s ease-in-out;z-index:1}.btn-coffee .text{z-index:2;transition:color .3s}.btn-coffee .steam{position:absolute;bottom:100%;width:6px;height:20px;background:rgba(255,255,255,.4);border-radius:10px;filter:blur(2px);opacity:0}.btn-coffee.is-brewing .coffee-liquid{height:100%}.btn-coffee.is-ready{border-color:#d97706;box-shadow:0 0 15px rgba(217,119,6,.3)}.btn-coffee.is-ready .steam{animation:rise-steam 2s infinite ease-out}@keyframes rise-steam{0%{transform:translateY(10px) scaleX(1);opacity:0}50%{opacity:.6}100%{transform:translateY(-30px) scaleX(2);opacity:0}}
</style>
Svelte
<script>
  let state = 'idle';
  function handleClick() {
    if (state !== 'idle') return;
    state = 'brewing';
    setTimeout(() => state = 'ready', 2500);
    setTimeout(() => state = 'idle', 6500);
  }
</script>
<button class="btn-coffee" class:is-brewing={state==='brewing'} class:is-ready={state==='ready'} on:click={handleClick} disabled={state!=='idle'}>
  <div class="coffee-liquid"></div>
  <span class="text">{state==='ready'?'Ready!':state==='brewing'?'Pouring...':'Brew Coffee'}</span>
  <div class="steam" style="left:40%"></div>
  <div class="steam" style="left:60%;animation-delay:0.5s"></div>
</button>
<style>
.btn-coffee{width:160px;height:50px;border-radius:12px;border:2px solid #52525b;background:#27272a;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 cubic-bezier(.4,0,.2,1)}.btn-coffee .coffee-liquid{position:absolute;bottom:0;left:0;width:100%;height:0%;background:#78350f;transition:height 2.5s ease-in-out;z-index:1}.btn-coffee .text{z-index:2;transition:color .3s}.btn-coffee .steam{position:absolute;bottom:100%;width:6px;height:20px;background:rgba(255,255,255,.4);border-radius:10px;filter:blur(2px);opacity:0}.btn-coffee.is-brewing .coffee-liquid{height:100%}.btn-coffee.is-ready{border-color:#d97706;box-shadow:0 0 15px rgba(217,119,6,.3)}.btn-coffee.is-ready .steam{animation:rise-steam 2s infinite ease-out}@keyframes rise-steam{0%{transform:translateY(10px) scaleX(1);opacity:0}50%{opacity:.6}100%{transform:translateY(-30px) scaleX(2);opacity:0}}
</style>
Angular
import { Component } from '@angular/core';
@Component({
  selector: 'app-coffee-brewing-button',
  template: `<button class="btn-coffee" [class.is-brewing]="state==='brewing'" [class.is-ready]="state==='ready'" (click)="handleClick()" [disabled]="state!=='idle'">
    <div class="coffee-liquid"></div>
    <span class="text">{{ state==='ready' ? 'Ready!' : state==='brewing' ? 'Pouring...' : 'Brew Coffee' }}</span>
    <div class="steam" style="left:40%"></div>
    <div class="steam" style="left:60%;animation-delay:0.5s"></div>
  </button>`,
  styles: [`.btn-coffee{width:160px;height:50px;border-radius:12px;border:2px solid #52525b;background:#27272a;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 cubic-bezier(.4,0,.2,1)}.btn-coffee .coffee-liquid{position:absolute;bottom:0;left:0;width:100%;height:0%;background:#78350f;transition:height 2.5s ease-in-out;z-index:1}.btn-coffee .text{z-index:2;transition:color .3s}.btn-coffee .steam{position:absolute;bottom:100%;width:6px;height:20px;background:rgba(255,255,255,.4);border-radius:10px;filter:blur(2px);opacity:0}.btn-coffee.is-brewing .coffee-liquid{height:100%}.btn-coffee.is-ready{border-color:#d97706;box-shadow:0 0 15px rgba(217,119,6,.3)}.btn-coffee.is-ready .steam{animation:rise-steam 2s infinite ease-out}@keyframes rise-steam{0%{transform:translateY(10px) scaleX(1);opacity:0}50%{opacity:.6}100%{transform:translateY(-30px) scaleX(2);opacity:0}}`]
})
export class CoffeeBrewingButtonComponent { state='idle';handleClick(){if(this.state!=='idle')return;this.state='brewing';setTimeout(()=>this.state='ready',2500);setTimeout(()=>this.state='idle',6500);}}
LWC — HTML template
<template><button class="btn-coffee" onclick={handleClick} disabled={disabled}>
  <div class="coffee-liquid"></div>
  <span class="text">{label}</span>
  <div class="steam" style="left:40%"></div>
  <div class="steam" style="left:60%;animation-delay:0.5s"></div>
</button></template>
LWC — JavaScript
import { LightningElement } from 'lwc';
export default class CoffeeBrewingButton extends LightningElement {
  state = 'idle';
  get disabled() { return this.state !== 'idle'; }
  get label() { return this.state==='ready'?'Ready!':this.state==='brewing'?'Pouring...':'Brew Coffee'; }
  handleClick() {
    if (this.state !== 'idle') return;
    this.state = 'brewing';
    const btn = this.template.querySelector('button');
    btn.classList.add('is-brewing');
    setTimeout(()=>{btn.classList.add('is-ready');this.state='ready';},2500);
    setTimeout(()=>{btn.classList.remove('is-brewing','is-ready');this.state='idle';},6500);
  }
}
LWC — CSS
.btn-coffee{width:160px;height:50px;border-radius:12px;border:2px solid #52525b;background:#27272a;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 cubic-bezier(.4,0,.2,1)}.btn-coffee .coffee-liquid{position:absolute;bottom:0;left:0;width:100%;height:0%;background:#78350f;transition:height 2.5s ease-in-out;z-index:1}.btn-coffee .text{z-index:2;transition:color .3s}.btn-coffee .steam{position:absolute;bottom:100%;width:6px;height:20px;background:rgba(255,255,255,.4);border-radius:10px;filter:blur(2px);opacity:0}.btn-coffee.is-brewing .coffee-liquid{height:100%}.btn-coffee.is-ready{border-color:#d97706;box-shadow:0 0 15px rgba(217,119,6,.3)}.btn-coffee.is-ready .steam{animation:rise-steam 2s infinite ease-out}@keyframes rise-steam{0%{transform:translateY(10px) scaleX(1);opacity:0}50%{opacity:.6}100%{transform:translateY(-30px) scaleX(2);opacity:0}}
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 Coffee Brewing fits

  • Brew
  • Loading
  • Progress
  • Warm Up
  • Prepare

Interaction states & animations

  • Liquid Fill
  • Steam Rise
  • Glow Warm
  • Progress Bar

Topics

  • #coffee
  • #brew
  • #liquid
  • #fill
  • #steam
  • #warm
  • #progress

Accessibility notes

Liquid fill and steam are decorative. Announce state changes via aria-live.

Browser support

  • All modern browsers