Skip to content

Commit 7a20c0d

Browse files
committed
feat: Introduce glowing AI chat assistant UI with a performant WebGL shader background.
1 parent 552ef49 commit 7a20c0d

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

components/ui/glowing-ai-chat-assistant.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -474,11 +474,11 @@ const FloatingAiAssistant: React.FC = () => {
474474
}
475475

476476
return (
477-
<div className="fixed inset-x-4 bottom-4 z-50 flex justify-end sm:inset-x-auto sm:right-6 sm:bottom-6">
478-
<div className="relative w-full max-w-[420px]">
477+
<div className="fixed right-4 bottom-4 sm:right-6 sm:bottom-6 z-50">
478+
<div className="relative">
479479
{/* Floating AI button */}
480480
<button
481-
className={`floating-ai-button relative ml-auto flex h-14 w-14 items-center justify-center rounded-full border border-white/40 bg-[var(--brand-pink)] shadow-lg shadow-[#e45a92]/40 transition-all duration-300 hover:scale-110 hover:shadow-xl ${isChatOpen ? "rotate-90" : "rotate-0"
481+
className={`floating-ai-button relative ml-auto flex h-11 w-11 sm:h-14 sm:w-14 items-center justify-center rounded-full border border-white/40 bg-[var(--brand-pink)] shadow-lg shadow-[#e45a92]/40 transition-all duration-300 hover:scale-110 hover:shadow-xl ${isChatOpen ? "rotate-90" : "rotate-0"
482482
}`}
483483
onClick={handleToggle}
484484
aria-label={isChatOpen ? "Close Bits&Bytes assistant" : "Open Bits&Bytes assistant"}
@@ -488,7 +488,7 @@ const FloatingAiAssistant: React.FC = () => {
488488

489489
{/* Icon */}
490490
<div className="relative z-10 flex items-center justify-center">
491-
{isChatOpen ? <X className="h-6 w-6 text-white" /> : <Bot className="h-6 w-6 text-white" />}
491+
{isChatOpen ? <X className="h-5 w-5 sm:h-6 sm:w-6 text-white" /> : <Bot className="h-5 w-5 sm:h-6 sm:w-6 text-white" />}
492492
</div>
493493

494494
{/* Subtle glow */}
@@ -500,9 +500,9 @@ const FloatingAiAssistant: React.FC = () => {
500500
{isChatOpen && (
501501
<div
502502
ref={chatRef}
503-
className="absolute bottom-16 right-0 w-full max-w-full origin-bottom-right animate-slide-in-up sm:w-[380px] sm:max-w-[420px]"
503+
className="fixed inset-x-3 bottom-[4.5rem] sm:absolute sm:inset-x-auto sm:bottom-16 sm:right-0 w-auto sm:w-[380px] origin-bottom-right animate-slide-in-up"
504504
>
505-
<div className="relative flex max-h-[70vh] flex-col overflow-hidden rounded-3xl border border-zinc-700/60 bg-zinc-950/95 shadow-2xl backdrop-blur-2xl sm:max-h-[520px]">
505+
<div className="relative flex max-h-[70vh] sm:max-h-[520px] flex-col overflow-hidden rounded-2xl sm:rounded-3xl border border-zinc-700/60 bg-zinc-950/95 shadow-2xl backdrop-blur-2xl">
506506
{/* Header */}
507507
<div className="flex flex-wrap items-center justify-between gap-3 px-4 pt-3 pb-2">
508508
<div className="flex items-center gap-2">
@@ -667,8 +667,8 @@ const FloatingAiAssistant: React.FC = () => {
667667
return (
668668
<code
669669
className={`${isInline
670-
? "rounded bg-zinc-800 px-1 py-0.5 text-[0.7rem]"
671-
: "block rounded-xl bg-zinc-950 p-3 text-[0.75rem] overflow-x-auto border border-zinc-800/80 text-zinc-300 mt-2 mb-2"
670+
? "rounded bg-zinc-800 px-1 py-0.5 text-[0.7rem]"
671+
: "block rounded-xl bg-zinc-950 p-3 text-[0.75rem] overflow-x-auto border border-zinc-800/80 text-zinc-300 mt-2 mb-2"
672672
} ${className || ""}`}
673673
{...props}
674674
>

components/ui/web-gl-shader.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ export function WebGLShader() {
482482
/>
483483

484484
{/* Stats for nerds toggle & panel */}
485-
<div className="fixed bottom-20 sm:bottom-4 left-4 right-4 sm:right-auto z-50 flex flex-col items-start gap-2 pointer-events-none">
485+
<div className="fixed bottom-4 left-4 right-4 sm:right-auto z-50 flex flex-col items-start gap-2 pointer-events-none">
486486
{showStats && (
487487
<div
488488
className="pointer-events-auto w-full sm:w-80 max-h-[70vh] overflow-y-auto rounded-2xl border border-white/10 dark:border-white/[0.06] shadow-2xl"
@@ -637,15 +637,16 @@ export function WebGLShader() {
637637

638638
<button
639639
onClick={() => setShowStats(!showStats)}
640-
className="pointer-events-auto p-2.5 rounded-full border border-white/10 hover:border-[#E45A92]/40 transition-all text-white/25 hover:text-[#FFACAC] z-50"
640+
className="pointer-events-auto p-2 sm:p-2.5 rounded-full border border-white/[0.08] hover:border-[#E45A92]/30 transition-all text-white/20 hover:text-[#FFACAC] z-50"
641641
style={{
642-
background: "linear-gradient(135deg, rgba(15, 5, 28, 0.6) 0%, rgba(62, 30, 104, 0.4) 100%)",
642+
background: "linear-gradient(135deg, rgba(15, 5, 28, 0.5) 0%, rgba(62, 30, 104, 0.3) 100%)",
643643
backdropFilter: "blur(12px)",
644644
WebkitBackdropFilter: "blur(12px)",
645645
}}
646646
title="Stats for nerds"
647+
aria-label="Toggle performance stats"
647648
>
648-
<Terminal className="w-5 h-5 sm:w-4 sm:h-4" />
649+
<Terminal className="w-4 h-4 sm:w-[18px] sm:h-[18px]" />
649650
</button>
650651
</div>
651652
</>

0 commit comments

Comments
 (0)