Skip to content

armgit / kwant

Public Imported from GitHub
0

Your own team of AI bots in one self-hosted binary: spaces, every account you have, handoffs, approvals and routines. Open-source, self-hosted alternative to Grok Bot, Claude Duet and OpenAI dots. Rust + React.

feat: restore crisp pixel art avatars with modern dark theme styling

Oleksandr Ivanchenko26163d26ec42
diff --git a/frontend/src/components/ModernAvatar.tsx b/frontend/src/components/ModernAvatar.tsx
index 560fac2b..3b00ec00 100644
--- a/frontend/src/components/ModernAvatar.tsx
+++ b/frontend/src/components/ModernAvatar.tsx
@@ -1,11 +1,11 @@
import React from 'react';
-import { Layers, Code2, Terminal, Shield, Zap, User, Bot } from 'lucide-react';
interface ModernAvatarProps {
role?: string;
name?: string;
size?: number; // pixel diameter
isOnline?: boolean;
+ className?: string;
}
export const ModernAvatar: React.FC<ModernAvatarProps> = ({
@@ -13,40 +13,237 @@ export const ModernAvatar: React.FC<ModernAvatarProps> = ({
name = '',
size = 36,
isOnline,
+ className = '',
}) => {
const norm = (role + ' ' + name).toLowerCase();
- let gradient = 'from-zinc-700 to-zinc-900 text-zinc-300';
- let Icon = Bot;
+ // Determine avatar type and theme border/bg
+ let type: 'user' | 'architect' | 'techlead' | 'devops' | 'security' | 'fast' | 'bot' = 'bot';
+ let borderClass = 'border-zinc-700/60';
- if (norm.includes('user') || norm.includes('player')) {
- gradient = 'from-blue-600 to-indigo-700 text-white';
- Icon = User;
+ if (norm.includes('user') || norm.includes('player') || norm.includes('hero')) {
+ type = 'user';
+ borderClass = 'border-indigo-500/40 shadow-indigo-500/10';
} else if (norm.includes('architect') || norm.includes('cyber_mage') || norm.includes('mage')) {
- gradient = 'from-violet-600 to-purple-800 text-violet-100';
- Icon = Layers;
+ type = 'architect';
+ borderClass = 'border-violet-500/40 shadow-violet-500/10';
} else if (norm.includes('tech') || norm.includes('ninja') || norm.includes('pixel') || norm.includes('lead')) {
- gradient = 'from-sky-500 to-blue-700 text-sky-100';
- Icon = Code2;
- } else if (norm.includes('devops') || norm.includes('terminal') || norm.includes('knight') || norm.includes('shell')) {
- gradient = 'from-emerald-500 to-teal-700 text-emerald-100';
- Icon = Terminal;
- } else if (norm.includes('security') || norm.includes('shield')) {
- gradient = 'from-amber-500 to-orange-700 text-amber-100';
- Icon = Shield;
- } else if (norm.includes('fast') || norm.includes('grok')) {
- gradient = 'from-rose-500 to-pink-700 text-rose-100';
- Icon = Zap;
+ type = 'techlead';
+ borderClass = 'border-sky-500/40 shadow-sky-500/10';
+ } else if (norm.includes('devops') || norm.includes('terminal') || norm.includes('knight') || norm.includes('shell') || norm.includes('infra')) {
+ type = 'devops';
+ borderClass = 'border-emerald-500/40 shadow-emerald-500/10';
+ } else if (norm.includes('security') || norm.includes('shield') || norm.includes('guard')) {
+ type = 'security';
+ borderClass = 'border-amber-500/40 shadow-amber-500/10';
+ } else if (norm.includes('fast') || norm.includes('grok') || norm.includes('zap') || norm.includes('speed')) {
+ type = 'fast';
+ borderClass = 'border-rose-500/40 shadow-rose-500/10';
}
- const iconSize = Math.max(14, Math.round(size * 0.48));
+ // 16x16 Pixel Art SVG Sprite Renderer
+ const renderPixelSprite = () => {
+ switch (type) {
+ case 'architect':
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#1b102e" />
+ {/* Sorcerer Hat & Crest */}
+ <rect x="6" y="1" width="4" height="2" fill="#7b2cbf" />
+ <rect x="5" y="3" width="6" height="2" fill="#9d4edd" />
+ <rect x="3" y="5" width="10" height="1" fill="#f72585" />
+ <rect x="7" y="2" width="2" height="1" fill="#e0aaff" />
+ {/* Face & Glowing Visor */}
+ <rect x="5" y="6" width="6" height="4" fill="#ffd166" />
+ <rect x="6" y="7" width="2" height="1" fill="#00f5d4" />
+ <rect x="9" y="7" width="2" height="1" fill="#00f5d4" />
+ <rect x="7" y="8" width="2" height="1" fill="#c77dff" />
+ {/* Robe */}
+ <rect x="4" y="10" width="8" height="5" fill="#3c096c" />
+ <rect x="6" y="10" width="4" height="5" fill="#5a189a" />
+ {/* Staff with Energy Orb */}
+ <rect x="13" y="3" width="1" height="12" fill="#b5179e" />
+ <rect x="12" y="2" width="3" height="2" fill="#00f5d4" />
+ <rect x="13" y="2" width="1" height="1" fill="#ffffff" />
+ </svg>
+ );
+
+ case 'techlead':
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#0e1726" />
+ {/* Cyber Ninja Hood */}
+ <rect x="4" y="2" width="8" height="5" fill="#1f2937" />
+ <rect x="5" y="1" width="6" height="1" fill="#374151" />
+ {/* Mask & Eyes */}
+ <rect x="4" y="5" width="8" height="3" fill="#111827" />
+ <rect x="5" y="5" width="6" height="2" fill="#ffd166" />
+ <rect x="6" y="5" width="2" height="1" fill="#ef233c" />
+ <rect x="9" y="5" width="2" height="1" fill="#ef233c" />
+ {/* Torso & Tech Armor */}
+ <rect x="4" y="8" width="8" height="7" fill="#1f2937" />
+ <rect x="6" y="8" width="4" height="3" fill="#0284c7" />
+ <rect x="7" y="11" width="2" height="4" fill="#38bdf8" />
+ {/* Cyber Katana on back */}
+ <rect x="2" y="2" width="1" height="12" fill="#e2e8f0" />
+ <rect x="1" y="11" width="3" height="2" fill="#f59e0b" />
+ </svg>
+ );
+
+ case 'devops':
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#061e17" />
+ {/* CRT Terminal Helmet */}
+ <rect x="3" y="2" width="10" height="7" fill="#334155" />
+ <rect x="4" y="3" width="8" height="5" fill="#022c22" />
+ {/* Phosphor Green Console Screen (>_) */}
+ <rect x="5" y="4" width="1" height="1" fill="#10b981" />
+ <rect x="6" y="5" width="1" height="1" fill="#10b981" />
+ <rect x="5" y="6" width="1" height="1" fill="#10b981" />
+ <rect x="8" y="6" width="3" height="1" fill="#34d399" />
+ {/* Armored Chassis */}
+ <rect x="4" y="9" width="8" height="6" fill="#475569" />
+ <rect x="6" y="10" width="4" height="4" fill="#f59e0b" />
+ <rect x="7" y="11" width="2" height="2" fill="#fbbf24" />
+ {/* Server Shield with Status LED */}
+ <rect x="1" y="6" width="2" height="8" fill="#64748b" />
+ <rect x="1" y="7" width="1" height="1" fill="#34d399" />
+ <rect x="1" y="9" width="1" height="1" fill="#f59e0b" />
+ </svg>
+ );
+
+ case 'security':
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#201505" />
+ {/* Sentinel Helm */}
+ <rect x="4" y="2" width="8" height="6" fill="#d97706" />
+ <rect x="6" y="1" width="4" height="2" fill="#fbbf24" />
+ {/* Visor & Optic Sensor */}
+ <rect x="5" y="4" width="6" height="2" fill="#451a03" />
+ <rect x="7" y="4" width="2" height="2" fill="#38bdf8" />
+ <rect x="8" y="4" width="1" height="1" fill="#ffffff" />
+ {/* Golden Aegis Armor */}
+ <rect x="4" y="8" width="8" height="7" fill="#b45309" />
+ <rect x="6" y="9" width="4" height="5" fill="#f59e0b" />
+ {/* Firewall Cross on Chest */}
+ <rect x="7" y="10" width="2" height="3" fill="#ef4444" />
+ <rect x="6" y="11" width="4" height="1" fill="#ef4444" />
+ </svg>
+ );
+
+ case 'fast':
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#240716" />
+ {/* Spiked Neon Hair */}
+ <rect x="4" y="1" width="2" height="3" fill="#f43f5e" />
+ <rect x="7" y="1" width="2" height="4" fill="#fb7185" />
+ <rect x="10" y="2" width="2" height="3" fill="#f43f5e" />
+ {/* Headset & Visor */}
+ <rect x="3" y="4" width="1" height="4" fill="#38bdf8" />
+ <rect x="12" y="4" width="1" height="4" fill="#38bdf8" />
+ <rect x="4" y="4" width="8" height="4" fill="#ffd166" />
+ <rect x="5" y="5" width="6" height="2" fill="#06b6d4" />
+ <rect x="6" y="5" width="4" height="1" fill="#ffffff" />
+ {/* Cyber Jacket with Lightning Bolt */}
+ <rect x="4" y="8" width="8" height="7" fill="#be123c" />
+ <rect x="7" y="9" width="2" height="2" fill="#facc15" />
+ <rect x="6" y="11" width="2" height="2" fill="#facc15" />
+ <rect x="7" y="12" width="2" height="2" fill="#facc15" />
+ </svg>
+ );
+
+ case 'user':
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#111827" />
+ {/* Hair */}
+ <rect x="4" y="2" width="8" height="3" fill="#854d0e" />
+ {/* Neon Headband */}
+ <rect x="4" y="5" width="8" height="1" fill="#ec4899" />
+ <rect x="12" y="6" width="2" height="2" fill="#ec4899" />
+ {/* Face & Eyes */}
+ <rect x="4" y="6" width="8" height="4" fill="#fde047" />
+ <rect x="6" y="7" width="1" height="1" fill="#0f172a" />
+ <rect x="9" y="7" width="1" height="1" fill="#0f172a" />
+ {/* Cyber Bomber Jacket */}
+ <rect x="4" y="10" width="8" height="5" fill="#3b82f6" />
+ <rect x="6" y="10" width="4" height="5" fill="#ffffff" />
+ <rect x="7" y="11" width="2" height="4" fill="#f59e0b" />
+ </svg>
+ );
+
+ default:
+ // Autonomous Droid / Bot
+ return (
+ <svg
+ viewBox="0 0 16 16"
+ className="w-full h-full"
+ style={{ imageRendering: 'pixelated', shapeRendering: 'crispEdges' }}
+ >
+ {/* Background */}
+ <rect width="16" height="16" fill="#18181b" />
+ {/* Antenna */}
+ <rect x="7" y="1" width="2" height="2" fill="#71717a" />
+ <rect x="7" y="1" width="2" height="1" fill="#ef4444" />
+ {/* Head Chassis */}
+ <rect x="4" y="3" width="8" height="7" fill="#3f3f46" />
+ {/* Square Glowing Eyes */}
+ <rect x="5" y="5" width="2" height="2" fill="#38bdf8" />
+ <rect x="9" y="5" width="2" height="2" fill="#38bdf8" />
+ {/* Speaker Mouth */}
+ <rect x="6" y="8" width="4" height="1" fill="#18181b" />
+ {/* Body Chassis with Dual Status LEDs */}
+ <rect x="4" y="10" width="8" height="5" fill="#27272a" />
+ <rect x="6" y="11" width="1" height="1" fill="#10b981" />
+ <rect x="9" y="11" width="1" height="1" fill="#f59e0b" />
+ <rect x="6" y="13" width="4" height="1" fill="#3b82f6" />
+ </svg>
+ );
+ }
+ };
return (
- <div className="relative inline-flex flex-shrink-0" style={{ width: size, height: size }}>
+ <div
+ className={`relative inline-flex flex-shrink-0 select-none ${className}`}
+ style={{ width: size, height: size }}
+ >
<div
- className={`w-full h-full rounded-xl bg-gradient-to-br ${gradient} flex items-center justify-center shadow-sm border border-white/10`}
+ className={`w-full h-full rounded-xl overflow-hidden shadow-sm border ${borderClass} flex items-center justify-center`}
>
- <Icon size={iconSize} strokeWidth={2.2} />
+ {renderPixelSprite()}
</div>
{isOnline !== undefined && (
<span
diff --git a/frontend/src/components/NewAgentModal.tsx b/frontend/src/components/NewAgentModal.tsx
index fcc346e5..dce9ecb1 100644
--- a/frontend/src/components/NewAgentModal.tsx
+++ b/frontend/src/components/NewAgentModal.tsx
@@ -1,5 +1,6 @@
import React, { useState } from 'react';
-import { X, Sparkles, Layers, Code2, Terminal, Shield } from 'lucide-react';
+import { X, Sparkles } from 'lucide-react';
+import { ModernAvatar } from './ModernAvatar';
import { playSfx } from '../audio/chiptune';
interface NewAgentModalProps {
@@ -93,29 +94,30 @@ export const NewAgentModal: React.FC<NewAgentModalProps> = ({
</div>
<div>
- <label className="block text-xs font-medium text-zinc-400 mb-1">Role Specialty</label>
+ <label className="block text-xs font-medium text-zinc-400 mb-1">Avatar & Role Specialty</label>
<div className="grid grid-cols-2 gap-2">
{[
- { id: 'architect', label: 'Architecture', icon: Layers },
- { id: 'tech_lead', label: 'Coding & Prototyping', icon: Code2 },
- { id: 'devops', label: 'DevOps & Shell', icon: Terminal },
- { id: 'security', label: 'Security & Audit', icon: Shield },
+ { id: 'architect', label: 'Architecture' },
+ { id: 'tech_lead', label: 'Tech Lead / Code' },
+ { id: 'devops', label: 'DevOps & Shell' },
+ { id: 'security', label: 'Security & Audit' },
+ { id: 'fast', label: 'Speed & Logic' },
+ { id: 'default', label: 'General / Droid' },
].map((item) => {
- const Icon = item.icon;
const active = roleStyle === item.id;
return (
<button
key={item.id}
type="button"
onClick={() => setRoleStyle(item.id)}
- className={`flex items-center gap-2 p-2 rounded-lg border text-left text-xs transition-all ${
+ className={`flex items-center gap-2.5 p-2 rounded-xl border text-left text-xs transition-all ${
active
- ? 'border-sky-500/50 bg-sky-500/10 text-sky-300'
- : 'border-zinc-800 bg-zinc-950/60 text-zinc-400 hover:border-zinc-700'
+ ? 'border-sky-500/60 bg-sky-500/10 text-sky-200 shadow-sm'
+ : 'border-zinc-800 bg-zinc-950/60 text-zinc-400 hover:border-zinc-700 hover:text-zinc-200'
}`}
>
- <Icon size={14} className={active ? 'text-sky-400' : 'text-zinc-500'} />
- <span className="truncate">{item.label}</span>
+ <ModernAvatar role={item.id} size={24} />
+ <span className="truncate font-medium">{item.label}</span>
</button>
);
})}