M: Improve color animations
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
Frontend CI / notify-failure (push) Blocked by required conditions

This commit is contained in:
Ivan 2025-04-07 22:26:36 +03:00
parent 675cff3191
commit fa83d0930c
7 changed files with 13 additions and 7 deletions

View File

@ -39,7 +39,7 @@ export function MiniButton({
tabIndex={tabIndex ?? -1} tabIndex={tabIndex ?? -1}
className={clsx( className={clsx(
'rounded-lg', 'rounded-lg',
'clr-text-controls cc-animate-color', 'clr-text-controls cc-animate-background',
'cursor-pointer disabled:cursor-auto', 'cursor-pointer disabled:cursor-auto',
noHover ? 'outline-hidden' : 'clr-hover', noHover ? 'outline-hidden' : 'clr-hover',
!noPadding && 'px-1 py-1', !noPadding && 'px-1 py-1',

View File

@ -25,7 +25,7 @@ export function SubmitButton({ text = 'ОК', icon, disabled, loading, className
'border', 'border',
'font-medium', 'font-medium',
'clr-btn-primary cc-animate-color', 'clr-btn-primary cc-animate-color',
'select-none disabled:cursor-auto', 'select-none cursor-pointer disabled:cursor-auto',
loading && 'cursor-progress', loading && 'cursor-progress',
className className
)} )}

View File

@ -75,7 +75,7 @@ export function TableBody<TData>({
key={row.id} key={row.id}
className={clsx( className={clsx(
'cc-scroll-row', 'cc-scroll-row',
'clr-hover cc-animate-color', 'clr-hover cc-animate-background duration-300',
!noHeader && 'scroll-mt-[calc(2px+2rem)]', !noHeader && 'scroll-mt-[calc(2px+2rem)]',
table.options.enableRowSelection && row.getIsSelected() table.options.enableRowSelection && row.getIsSelected()
? 'clr-selected' ? 'clr-selected'

View File

@ -37,7 +37,7 @@ export function DropdownButton({
'px-3 py-1 inline-flex items-center gap-2', 'px-3 py-1 inline-flex items-center gap-2',
'text-left text-sm text-ellipsis whitespace-nowrap', 'text-left text-sm text-ellipsis whitespace-nowrap',
'disabled:clr-text-controls', 'disabled:clr-text-controls',
'cc-animate-color', 'cc-animate-background',
!!onClick ? 'clr-hover cursor-pointer disabled:cursor-auto' : 'clr-btn-default', !!onClick ? 'clr-hover cursor-pointer disabled:cursor-auto' : 'clr-btn-default',
className className
)} )}

View File

@ -47,7 +47,7 @@ export function DlgShowAST() {
{!isDragging && hoverNodeDebounced ? ( {!isDragging && hoverNodeDebounced ? (
<div key={hoverNodeDebounced.uid}> <div key={hoverNodeDebounced.uid}>
<span>{expression.slice(0, hoverNodeDebounced.start)}</span> <span>{expression.slice(0, hoverNodeDebounced.start)}</span>
<span className='bg-sec-200 cc-animate-color starting:bg-prim-100 duration-500'> <span className='bg-sec-200 cc-animate-background starting:bg-prim-100 duration-500'>
{expression.slice(hoverNodeDebounced.start, hoverNodeDebounced.finish)} {expression.slice(hoverNodeDebounced.start, hoverNodeDebounced.finish)}
</span> </span>
<span>{expression.slice(hoverNodeDebounced.finish)}</span> <span>{expression.slice(hoverNodeDebounced.finish)}</span>

View File

@ -76,8 +76,8 @@
--clr-prim-999: oklch(095% 0 0deg); --clr-prim-999: oklch(095% 0 0deg);
--clr-sec-0: oklch(100% 0 0deg); --clr-sec-0: oklch(100% 0 0deg);
--clr-sec-100: oklch(025% 0.100 295deg); --clr-sec-100: oklch(025% 0.200 295deg);
--clr-sec-200: oklch(035% 0.100 295deg); --clr-sec-200: oklch(035% 0.150 295deg);
--clr-sec-300: oklch(045% 0.150 295deg); --clr-sec-300: oklch(045% 0.150 295deg);
--clr-sec-400: oklch(055% 0.200 295deg); --clr-sec-400: oklch(055% 0.200 295deg);
--clr-sec-600: oklch(065% 0.250 295deg); --clr-sec-600: oklch(065% 0.250 295deg);

View File

@ -195,6 +195,12 @@
transition-duration: var(--duration-select); transition-duration: var(--duration-select);
} }
@utility cc-animate-background {
transition-property: background-color;
transition-timing-function: var(--ease-bezier);
transition-duration: var(--duration-select);
}
@utility cc-mask-sides { @utility cc-mask-sides {
--mask-border-size: 2rem; --mask-border-size: 2rem;