AI Brain Generator
Visualize AI thinking before producing an answer. The button opens like a futuristic capsule. A holographic brain appears. Neurons begin connecting while electrical pulses travel across synapses. Ideas form as glowing particles orbit the brain. When processing finishes the brain smiles, dissolves into particles and the generated content emerges from the button.
by FreeCsStyles Dev's
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/ai-brain-generator.
<iframe src="/embed/ai-brain-generator" sandbox="allow-scripts" loading="lazy" title="AI Brain Generator" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for AI Brain Generator, 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-brain">
<div class="brain-icon">🧠</div>
<div class="neural-nodes">
<span style="--n:0"></span>
<span style="--n:1"></span>
<span style="--n:2"></span>
<span style="--n:3"></span>
<span style="--n:4"></span>
<span style="--n:5"></span>
</div>
<div class="electric-pulses"></div>
<div class="orbit-particles">
<span style="--o:0"></span>
<span style="--o:1"></span>
<span style="--o:2"></span>
</div>
<div class="glow-icon">⚡</div>
<span class="btn-text">🧠 Generate</span>
</button>CSS
.btn-brain{width:200px;height:60px;border-radius:14px;border:none;background:linear-gradient(135deg,#0c0c20,#1a1a3e);color:#c7d2fe;font-size:15px;font-weight:700;cursor:pointer;position:relative;display:flex;align-items:center;justify-content:center;overflow:hidden;font-family:system-ui,-apple-system,sans-serif;box-shadow:0 4px 15px rgba(0,0,0,.3)}.btn-brain:hover{box-shadow:0 8px 30px rgba(99,102,241,.3);transform:scale(1.05)}.btn-brain:active{transform:scale(.95)}.btn-brain .brain-icon{position:absolute;z-index:2;font-size:18px;opacity:.7;animation:brain-pulse 3s ease-in-out infinite}.btn-brain .neural-nodes{position:absolute;inset:0;pointer-events:none;z-index:2}.btn-brain .neural-nodes span{position:absolute;width:6px;height:6px;background:#818cf8;border-radius:50%;animation:node-pulse 1.5s ease-in-out infinite;animation-delay:calc(var(--n) * .25s);left:calc(15% + var(--n) * 13%);top:calc(20% + (var(--n) - var(--n) / 3) * 25%)}.btn-brain .electric-pulses{position:absolute;inset:0;z-index:2;pointer-events:none;opacity:0;animation:electric-flash 1s infinite}.btn-brain .electric-pulses::before,.btn-brain .electric-pulses::after{content:'';position:absolute;background:rgba(129,140,248,.5);height:1px;border-radius:1px}.btn-brain .electric-pulses::before{top:33%;left:20%;width:40%;transform:rotate(15deg);animation:pulse-line .8s ease-in-out infinite}.btn-brain .electric-pulses::after{top:50%;left:40%;width:35%;transform:rotate(-10deg);animation:pulse-line .8s ease-in-out infinite .3s}.btn-brain .orbit-particles{position:absolute;inset:0;pointer-events:none;z-index:3}.btn-brain .orbit-particles span{position:absolute;width:4px;height:4px;background:#22d3ee;border-radius:50%;animation:orbit-spin 3s linear infinite;animation-delay:calc(var(--o) * 1s)}.btn-brain .orbit-particles span:nth-child(1){left:70%;top:30%}.btn-brain .orbit-particles span:nth-child(2){left:30%;top:70%}.btn-brain .orbit-particles span:nth-child(3){left:50%;top:20%}.btn-brain .glow-icon{position:absolute;right:12px;font-size:14px;z-index:3;animation:glow-pulse 2s ease-in-out infinite}.btn-brain .btn-text{z-index:5;position:relative}.btn-brain.is-generating{animation:brain-expand .5s ease-out}.btn-brain.is-thinking .brain-icon{animation:brain-glow .5s ease-in-out infinite}.btn-brain.is-thinking .neural-nodes span{animation:node-fire .3s ease-in-out infinite}.btn-brain.is-thinking .electric-pulses{opacity:.4}.btn-brain.is-done{background:linear-gradient(135deg,#1e1b4b,#312e81);box-shadow:0 4px 20px rgba(99,102,241,.2)}.btn-brain.is-done .btn-text{color:#22c55e}@keyframes brain-pulse{0%,100%{transform:scale(.9) rotate(0)}25%{transform:scale(1.1) rotate(5deg)}75%{transform:scale(.95) rotate(-5deg)}}@keyframes node-pulse{0%,100%{transform:scale(.5);opacity:.3}50%{transform:scale(1.5);opacity:1}}@keyframes electric-flash{0%,100%{opacity:0}50%{opacity:.4}}@keyframes pulse-line{0%,100%{opacity:0}50%{opacity:1}}@keyframes orbit-spin{0%{transform:rotate(0)}100%{transform:rotate(360deg)}}@keyframes glow-pulse{0%,100%{opacity:.5;transform:scale(.9)}50%{opacity:1;transform:scale(1.1)}}@keyframes brain-expand{0%{transform:scale(1)}50%{transform:scale(1.1)}100%{transform:scale(1)}}@keyframes brain-glow{0%,100%{filter:brightness(1)}50%{filter:brightness(1.5)}}@keyframes node-fire{0%,100%{transform:scale(1);opacity:1}50%{transform:scale(2);opacity:.5}}Tailwind CSS
<button class="w-[200px] h-[60px] rounded-[14px] border-none bg-gradient-to-br from-[#0c0c20] to-[#1a1a3e] text-[#c7d2fe] font-bold text-[15px] cursor-pointer relative flex items-center justify-center overflow-hidden font-sans shadow-lg hover:scale-105 active:scale-95 transition-all"><span class="relative z-10">🧠 Generate</span></button>React
import { useState } from 'react';
export function AIBrainGenerator() {
const [phase, setPhase] = useState('idle');
const handleClick = () => {
if (phase !== 'idle') return;
setPhase('generating');
setTimeout(() => setPhase('thinking'), 500);
setTimeout(() => setPhase('done'), 2500);
setTimeout(() => setPhase('idle'), 4000);
};
return (
<button onClick={handleClick} disabled={phase !== 'idle'}
style={{ width: 200, height: 60, borderRadius: 14, border: 'none', background: phase === 'done' ? 'linear-gradient(135deg, #1e1b4b, #312e81)' : 'linear-gradient(135deg, #0c0c20, #1a1a3e)', color: phase === 'done' ? '#22c55e' : '#c7d2fe', fontSize: 15, fontWeight: 'bold', cursor: 'pointer', position: 'relative', display: 'flex', alignItems: 'center', justifyContent: 'center', overflow: 'hidden', fontFamily: 'system-ui,sans-serif', transition: 'all 0.3s', boxShadow: '0 4px 15px rgba(0,0,0,0.3)' }}>
<span style={{ position: 'relative', zIndex: 5 }}>{phase === 'done' ? '✨ Generated!' : '🧠 Generate'}</span>
</button>
);
}Vue
<template>
<button class="btn-brain" :class="phase" @click="handleClick" :disabled="phase!=='idle'">
<div class="brain-icon">🧠</div>
<div class="neural-nodes"><span v-for="i in 6" :key="i" :style="{ '--n': i-1 }"></span></div>
<div class="electric-pulses"></div>
<div class="orbit-particles"><span v-for="i in 3" :key="i" :style="{ '--o': i-1 }"></span></div>
<div class="glow-icon">⚡</div>
<span class="btn-text">{{ label }}</span>
</button>
</template>
<script setup>
import { ref, computed } from 'vue';
const phase = ref('idle');
const label = computed(() => ({idle:'🧠 Generate',generating:'',thinking:'',done:'✨ Generated!'}[phase.value]));
function handleClick() {
if (phase.value !== 'idle') return;
phase.value = 'generating';
setTimeout(() => phase.value = 'thinking', 500);
setTimeout(() => phase.value = 'done', 2500);
setTimeout(() => phase.value = 'idle', 4000);
}
</script>Svelte
<script>
let phase = 'idle';
$: label = ({idle:'🧠 Generate',generating:'',thinking:'',done:'✨ Generated!'})[phase];
function handleClick() {
if (phase !== 'idle') return;
phase = 'generating';
setTimeout(() => phase = 'thinking', 500);
setTimeout(() => phase = 'done', 2500);
setTimeout(() => phase = 'idle', 4000);
}
</script>
<button class="btn-brain" class:is-generating={phase==='generating'} class:is-thinking={phase==='thinking'} class:is-done={phase==='done'} on:click={handleClick} disabled={phase!=='idle'}>
<span class="btn-text">{label}</span>
</button>Angular
import { Component } from '@angular/core';
@Component({
selector: 'app-ai-brain-generator',
template: `<button class="btn-brain" [class.is-generating]="phase==='generating'" [class.is-thinking]="phase==='thinking'" [class.is-done]="phase==='done'" (click)="handleClick()" [disabled]="phase!=='idle'"><span class="btn-text">{{ label }}</span></button>`,
styles: [`.btn-brain{width:200px;height:60px;border-radius:14px;border:none;background:linear-gradient(135deg,#0c0c20,#1a1a3e);color:#c7d2fe;font-size:15px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .3s}.btn-brain.is-done{background:linear-gradient(135deg,#1e1b4b,#312e81)}.btn-brain.is-done .btn-text{color:#22c55e}`]
})
export class AIBrainGeneratorComponent { phase='idle'; get label() { return {idle:'🧠 Generate',generating:'',thinking:'',done:'✨ Generated!'}[this.phase]; } handleClick() { if(this.phase!=='idle')return;this.phase='generating';setTimeout(()=>this.phase='thinking',500);setTimeout(()=>this.phase='done',2500);setTimeout(()=>this.phase='idle',4000); } }LWC — HTML template
<template><button class="btn-brain" onclick={handleClick} disabled={disabled}><span class="btn-text">{label}</span></button></template>LWC — JavaScript
import { LightningElement } from 'lwc';
export default class AIBrainGenerator extends LightningElement {
phase = 'idle';
get disabled() { return this.phase !== 'idle'; }
get label() { return {idle:'🧠 Generate',generating:'',thinking:'',done:'✨ Generated!'}[this.phase]; }
handleClick() { if(this.phase!=='idle')return;this.phase='generating';setTimeout(()=>this.phase='thinking',500);setTimeout(()=>this.phase='done',2500);setTimeout(()=>this.phase='idle',4000); }
}LWC — CSS
.btn-brain{width:200px;height:60px;border-radius:14px;border:none;background:linear-gradient(135deg,#0c0c20,#1a1a3e);color:#c7d2fe;font-size:15px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;overflow:hidden;transition:all .3s}.btn-brain.is-done{background:linear-gradient(135deg,#1e1b4b,#312e81)}.btn-brain.is-done .btn-text{color:#22c55e}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 AI Brain Generator fits
- Generate
- AI
- Create
- Think
- Process
Interaction states & animations
- Neural Glow
- Electric Pulses
- Particle Orbit
- Brain Grow
- Dissolve
Topics
- #ai
- #brain
- #neural
- #generate
- #hologram
- #synapse
- #particles
- #futuristic
- #science
Accessibility notes
Animation is decorative. Button text remains readable. Respect reduced-motion preference. Use aria-busy during processing.
Browser support
- All modern browsers