Tiny Factory
A conveyor belt starts moving, robotic arms assemble an object, a QC stamp appears, and the product is shipped
Tiny Factory
by FreeCsStyles Dev's
AnimatedStorybook
🌐HTML/CSS🎨Tailwind⚛️React💚Vue🅰️Angular🔥Svelte☁️LWC
#factory#conveyor#robot#build#assembly#manufacture
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/tiny-factory.
<iframe src="/embed/tiny-factory" sandbox="allow-scripts" loading="lazy" title="Tiny Factory" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Tiny Factory, 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-factory"><span class="conveyor">⚙️</span><span class="text">Build</span></button>CSS
.btn-factory{width:150px;height:50px;border-radius:12px;border:none;background:#4338ca;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}.btn-factory .conveyor{position:absolute;font-size:14px;left:-25px;transition:all 1s linear;z-index:2}.btn-factory .robot{position:absolute;font-size:16px;right:-25px;opacity:0}.btn-factory .text{z-index:1;transition:.3s}.btn-factory.is-building .conveyor{animation:conveyor-move .6s linear infinite}.btn-factory.is-building .text{opacity:0}.btn-factory.is-building .robot{opacity:1;animation:robot-pulse .4s ease-in-out 3}.btn-factory.is-built{background:#3730a3;border:1px solid #a5b4fc}@keyframes conveyor-move{0%{transform:translateX(0)}100%{transform:translateX(150px)}}@keyframes robot-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.3)}}Tailwind CSS
<button class="w-[150px] h-[50px] rounded-xl border-none bg-indigo-700 text-white font-bold cursor-pointer relative flex items-center justify-center overflow-hidden transition-all duration-[400ms] font-sans"><span class="relative z-10">⚙️ Build</span></button>React
import { useState } from 'react';
export function TinyFactory() {
const [phase, setPhase] = useState('idle');
const handleClick = () => {
if (phase !== 'idle') return;
setPhase('building');
setTimeout(() => setPhase('built'), 1500);
setTimeout(() => setPhase('idle'), 4000);
};
return (
<button onClick={handleClick} disabled={phase !== 'idle'}
style={{ width: 150, height: 50, borderRadius: 12, border: phase === 'built' ? '1px solid #a5b4fc' : 'none', background: phase === 'built' ? '#3730a3' : '#4338ca', 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' }}>
<span>{phase === 'idle' ? '⚙️ Build' : phase === 'built' ? '✓ Built' : ''}</span>
</button>
);
}Vue
<template>
<button class="btn-factory" :class="phase" @click="handleClick" :disabled="phase!=='idle'">
<span class="conveyor">⚙️</span>
<span class="robot">🦾</span>
<span class="text">{{ phase==='idle' ? 'Build' : phase==='built' ? 'Built' : '' }}</span>
</button>
</template>
<script setup>
import { ref } from 'vue';
const phase = ref('idle');
function handleClick() {
if (phase.value !== 'idle') return;
phase.value = 'building';
setTimeout(() => phase.value = 'built', 1500);
setTimeout(() => phase.value = 'idle', 4000);
}
</script>Svelte
<script>
let phase = 'idle';
function handleClick() { if (phase !== 'idle') return; phase = 'building'; setTimeout(() => phase = 'built', 1500); setTimeout(() => phase = 'idle', 4000); }
</script>
<button class="btn-factory" class:is-built={phase==='built'} on:click={handleClick} disabled={phase!=='idle'}>
<span class="conveyor">⚙️</span>
<span>{phase==='idle' ? '⚙️ Build' : phase==='built' ? '✓ Built' : ''}</span>
</button>Angular
import { Component } from '@angular/core';
@Component({
selector: 'app-tiny-factory',
template: `<button class="btn-factory" [class.is-building]="phase==='building'" [class.is-built]="phase==='built'" (click)="handleClick()" [disabled]="phase!=='idle'"><span>{{ phase==='idle' ? '⚙️ Build' : phase==='built' ? '✓ Built' : '' }}</span></button>`,
styles: [`.btn-factory{width:150px;height:50px;border-radius:12px;border:none;background:#4338ca;color:#fff;font-size:16px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden}.btn-factory.is-built{background:#3730a3;border:1px solid #a5b4fc}`]
})
export class TinyFactoryComponent { phase='idle';handleClick(){if(this.phase!=='idle')return;this.phase='building';setTimeout(()=>this.phase='built',1500);setTimeout(()=>this.phase='idle',4000);}}LWC — HTML template
<template><button class="btn-factory" onclick={handleClick} disabled={disabled}><span>{label}</span></button></template>LWC — JavaScript
import { LightningElement } from 'lwc';
export default class TinyFactory extends LightningElement {
phase = 'idle';
get disabled() { return this.phase !== 'idle'; }
get label() { return this.phase==='idle'?'⚙️ Build':this.phase==='built'?'✓ Built':''; }
handleClick() { if(this.phase!=='idle')return;this.phase='building';setTimeout(()=>this.phase='built',1500);setTimeout(()=>this.phase='idle',4000); }
}LWC — CSS
.btn-factory{width:150px;height:50px;border-radius:12px;border:none;background:#4338ca;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}.btn-factory.is-built{background:#3730a3;border:1px solid #a5b4fc}LWC — Configuration
<?xml version="1.0" encoding="VOID"?>
<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 Tiny Factory fits
- Build Actions
- Generate
- Create
- Manufacture
Interaction states & animations
- Conveyor Belt
- Robot Arm
- Assembly
Topics
- #factory
- #conveyor
- #robot
- #build
- #assembly
- #manufacture
Accessibility notes
Animation is decorative. Button text remains readable. Respect reduced-motion preference.
Browser support
- All modern browsers