From facda469de0a90daaa8fa6cca17e46bdfee7b45f Mon Sep 17 00:00:00 2001 From: BFlat Date: Fri, 29 Nov 2024 22:24:21 +0700 Subject: [PATCH] ai stylize glow (#70) --- src/app/global.css | 34 +++++++++++++++++++ src/components/features/ToolbarButton.tsx | 3 ++ .../features/ToolbarMain/ToolbarMain.tsx | 11 +++--- src/components/styles.ts | 2 +- 4 files changed, 45 insertions(+), 5 deletions(-) diff --git a/src/app/global.css b/src/app/global.css index a058e09ef..cec0b21a9 100644 --- a/src/app/global.css +++ b/src/app/global.css @@ -72,6 +72,31 @@ ); background-size: 300% auto; } + + .highlight-button { + @apply relative; + background: linear-gradient( + 120deg, + theme("colors.primary.50/10") 0%, + theme("colors.primary.50/10") 40%, + theme("colors.primary.100/50") 45%, + theme("colors.primary.50/10") 50%, + theme("colors.primary.50/10") 100% + ); + background-size: 200% 100%; + background-position: 100% 0; + animation: highlight-sweep 3s infinite linear; + } +} + +@keyframes glow { + 0%, + 100% { + box-shadow: 0 0 8px 2px rgba(var(--color-primary-500-rgb), 0.5); + } + 50% { + box-shadow: 0 0 12px 4px rgba(var(--color-primary-500-rgb), 0.7); + } } /* Custom animations */ @@ -130,3 +155,12 @@ animation: gradient 4s linear infinite; background-size: 300% auto; } + +@keyframes highlight-sweep { + 0% { + background-position: 200% 0; + } + 100% { + background-position: -200% 0; + } +} diff --git a/src/components/features/ToolbarButton.tsx b/src/components/features/ToolbarButton.tsx index 474475e49..e8a37e01a 100644 --- a/src/components/features/ToolbarButton.tsx +++ b/src/components/features/ToolbarButton.tsx @@ -12,6 +12,7 @@ export interface ToolbarButtonProps extends ButtonHTMLAttributes { active?: boolean; hidden?: boolean; + prominent?: boolean; } export const ToolbarButton = ({ @@ -47,6 +48,8 @@ export const ToolbarButton = ({ children ? "w-fit flex items-center gap-2 text-nowrap" : "size-10", active && "pointer-events-none text-primary ", disabled && "pointer-events-none text-secondary-300", + buttonProps.prominent && + "highlight-button border border-primary-400/30 text-primary-500 hover:bg-primary-100/40 hover:border-primary-400/60", customButtonClassNames, ); diff --git a/src/components/features/ToolbarMain/ToolbarMain.tsx b/src/components/features/ToolbarMain/ToolbarMain.tsx index 154e36275..ad69ac5ae 100644 --- a/src/components/features/ToolbarMain/ToolbarMain.tsx +++ b/src/components/features/ToolbarMain/ToolbarMain.tsx @@ -8,9 +8,9 @@ import { faFilePlus, faFilm, faFloppyDisk, - faHatWizard, faImage, faLocationArrow, + faMagicWandSparkles, faText, } from "@fortawesome/pro-solid-svg-icons"; @@ -61,7 +61,7 @@ export const ToolbarMain = ({