From 1b758307c8359ba5600a55be0d044627f3ebc917 Mon Sep 17 00:00:00 2001 From: Diogo Ferreira Date: Wed, 19 Feb 2025 11:41:34 +0000 Subject: [PATCH] add a glow effect to the border to wizard button (#170) * add a highlight glow border to wizard button * improve glowing effect * improve styles, fix mobile button position * prevent click outside close chat * make button smaller --- app/components/AiChatBase.tsx | 39 +++++++++++++++++++++++------------ tailwind.config.ts | 12 +++++++++++ 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/app/components/AiChatBase.tsx b/app/components/AiChatBase.tsx index 340bf7e..9686109 100644 --- a/app/components/AiChatBase.tsx +++ b/app/components/AiChatBase.tsx @@ -34,11 +34,14 @@ export const AiChatBase = ({ }, [messages, isOpen, scrollAreaElement]); return ( - setOpen(isOpen)} open={isOpen}> -
+ setOpen(isOpen)} open={isOpen} modal> +
- + event.preventDefault()} + > @@ -95,18 +98,28 @@ export const AiChatBase = ({ onClick={() => { trackOnClickEvents.map(event => trackEvent(event)); }} - className={twMerge( - 'flex size-12 items-center justify-center rounded-100 bg-transparent shadow-1 outline-outline-primary-low-em backdrop-blur-sm transition-colors duration-700 hover:bg-outline-primary-base-em focus:bg-outline-primary-base-em md:size-16', - 'data-[state=open]:bg-outline-primary-base-em data-[state=open]:shadow-2' - )} + className="group relative flex size-12 items-center justify-center rounded-100 p-0.5 shadow-1 outline-outline-primary-med-em duration-500 hover:scale-105 md:size-14" > - ai wizard +
+ ai wizard +
diff --git a/tailwind.config.ts b/tailwind.config.ts index 5e63969..fa99dc0 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -10,6 +10,12 @@ const config: Config = { ], theme: { extend: { + backgroundImage: { + 'gradient-border': `linear-gradient(90deg, + #4c21b612 56%, + var(--outline-warning-med-em) 63%, + #5a27da30 100%)`, + }, keyframes: { grow: { '0%': { transform: 'scale(0.5)', opacity: '0' }, @@ -23,11 +29,17 @@ const config: Config = { '0%, 100%': { opacity: '0.2' }, '20%': { opacity: '1' }, }, + 'border-rotate': { + '0%': { transform: 'rotate(0deg)' }, + '100%': { transform: 'rotate(360deg)' }, + }, }, animation: { 'loading-dot': 'loading-dot 1.4s infinite ease-in-out', 'city-flip': 'cityFlip 200ms ease-in-out', grow: 'grow 0.2s ease-out', + 'border-rotate-fast': 'border-rotate 0.7s linear infinite', + 'border-rotate': 'border-rotate 5s linear infinite', }, }, },