mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 04:50:36 +03:00
F: Improve animation and styling
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run
This commit is contained in:
parent
1afc179d06
commit
3ebcf3562b
|
@ -27,7 +27,7 @@ export function ApplicationLayout() {
|
||||||
<NavigationState>
|
<NavigationState>
|
||||||
<div className='min-w-[20rem] antialiased h-full max-w-[120rem] mx-auto'>
|
<div className='min-w-[20rem] antialiased h-full max-w-[120rem] mx-auto'>
|
||||||
<ToasterThemed
|
<ToasterThemed
|
||||||
className='text-[14px] cc-animate-position'
|
className='text-[14px]'
|
||||||
style={{ marginTop: noNavigationAnimation ? '1.5rem' : '3.5rem' }}
|
style={{ marginTop: noNavigationAnimation ? '1.5rem' : '3.5rem' }}
|
||||||
autoClose={3000}
|
autoClose={3000}
|
||||||
draggable={false}
|
draggable={false}
|
||||||
|
|
|
@ -42,9 +42,10 @@ export function Navigation() {
|
||||||
'cc-shadow-border'
|
'cc-shadow-border'
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
transitionProperty: 'height, translate',
|
willChange: 'max-height, translate',
|
||||||
|
transitionProperty: 'max-height, translate',
|
||||||
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
||||||
height: noNavigationAnimation ? '0rem' : '3rem',
|
maxHeight: noNavigationAnimation ? '0rem' : '3rem',
|
||||||
translate: noNavigationAnimation ? '0 -1.5rem' : '0'
|
translate: noNavigationAnimation ? '0 -1.5rem' : '0'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -22,7 +22,8 @@ export function ToggleNavigation() {
|
||||||
!noNavigation && 'flex-col-reverse'
|
!noNavigation && 'flex-col-reverse'
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
transitionProperty: 'height, width, background-color',
|
willChange: 'height, width',
|
||||||
|
transitionProperty: 'height, width',
|
||||||
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
||||||
height: noNavigationAnimation ? '2rem' : '3rem',
|
height: noNavigationAnimation ? '2rem' : '3rem',
|
||||||
width: noNavigationAnimation ? '3rem' : '2rem'
|
width: noNavigationAnimation ? '3rem' : '2rem'
|
||||||
|
@ -32,7 +33,7 @@ export function ToggleNavigation() {
|
||||||
<button
|
<button
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
type='button'
|
type='button'
|
||||||
className='p-1'
|
className='p-1 cursor-pointer'
|
||||||
onClick={toggleDarkMode}
|
onClick={toggleDarkMode}
|
||||||
data-tooltip-id={globalIDs.tooltip}
|
data-tooltip-id={globalIDs.tooltip}
|
||||||
data-tooltip-content={darkMode ? 'Тема: Темная' : 'Тема: Светлая'}
|
data-tooltip-content={darkMode ? 'Тема: Темная' : 'Тема: Светлая'}
|
||||||
|
@ -44,7 +45,7 @@ export function ToggleNavigation() {
|
||||||
<button
|
<button
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
type='button'
|
type='button'
|
||||||
className='p-1'
|
className='p-1 cursor-pointer'
|
||||||
onClick={toggleNoNavigation}
|
onClick={toggleNoNavigation}
|
||||||
data-tooltip-id={globalIDs.tooltip}
|
data-tooltip-id={globalIDs.tooltip}
|
||||||
data-tooltip-content={noNavigationAnimation ? 'Показать навигацию' : 'Скрыть навигацию'}
|
data-tooltip-content={noNavigationAnimation ? 'Показать навигацию' : 'Скрыть навигацию'}
|
||||||
|
|
|
@ -46,6 +46,7 @@ export function Dropdown({
|
||||||
className
|
className
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
|
willChange: 'clip-path, transform',
|
||||||
transitionProperty: 'clip-path, transform',
|
transitionProperty: 'clip-path, transform',
|
||||||
transitionDuration: `${PARAMETER.dropdownDuration}ms`,
|
transitionDuration: `${PARAMETER.dropdownDuration}ms`,
|
||||||
transitionTimingFunction: 'ease-in-out',
|
transitionTimingFunction: 'ease-in-out',
|
||||||
|
|
|
@ -98,11 +98,12 @@ export function SelectTree<ItemType>({
|
||||||
onClick={event => handleSetValue(event, item)}
|
onClick={event => handleSetValue(event, item)}
|
||||||
style={{
|
style={{
|
||||||
borderBottomWidth: isActive ? '1px' : '0px',
|
borderBottomWidth: isActive ? '1px' : '0px',
|
||||||
transitionProperty: 'height, opacity, padding',
|
willChange: 'max-height, opacity, padding',
|
||||||
|
transitionProperty: 'max-height, opacity, padding',
|
||||||
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
||||||
paddingTop: isActive ? '0.25rem' : '0',
|
paddingTop: isActive ? '0.25rem' : '0',
|
||||||
paddingBottom: isActive ? '0.25rem' : '0',
|
paddingBottom: isActive ? '0.25rem' : '0',
|
||||||
height: isActive ? 'min-content' : '0',
|
maxHeight: isActive ? '1.75rem' : '0',
|
||||||
opacity: isActive ? '1' : '0'
|
opacity: isActive ? '1' : '0'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|
|
@ -66,6 +66,7 @@ export function TopicsDropdown({ activeTopic, onChangeTopic }: TopicsDropdownPro
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
maxHeight: treeHeight,
|
maxHeight: treeHeight,
|
||||||
|
willChange: 'clip-path',
|
||||||
transitionProperty: 'clip-path',
|
transitionProperty: 'clip-path',
|
||||||
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
||||||
clipPath: menu.isOpen ? 'inset(0% 0% 0% 0%)' : 'inset(0% 100% 0% 0%)'
|
clipPath: menu.isOpen ? 'inset(0% 0% 0% 0%)' : 'inset(0% 100% 0% 0%)'
|
||||||
|
|
|
@ -13,13 +13,13 @@ import { type ILibraryItemReference } from '../models/library';
|
||||||
|
|
||||||
interface MiniSelectorOSSProps extends Styling {
|
interface MiniSelectorOSSProps extends Styling {
|
||||||
items: ILibraryItemReference[];
|
items: ILibraryItemReference[];
|
||||||
onSelect: (event: React.MouseEvent<Element>, newValue: ILibraryItemReference) => void;
|
onSelect: (event: React.MouseEvent<HTMLElement>, newValue: ILibraryItemReference) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function MiniSelectorOSS({ items, onSelect, className, ...restProps }: MiniSelectorOSSProps) {
|
export function MiniSelectorOSS({ items, onSelect, className, ...restProps }: MiniSelectorOSSProps) {
|
||||||
const ossMenu = useDropdown();
|
const ossMenu = useDropdown();
|
||||||
|
|
||||||
function onToggle(event: React.MouseEvent<Element>) {
|
function onToggle(event: React.MouseEvent<HTMLElement>) {
|
||||||
if (items.length > 1) {
|
if (items.length > 1) {
|
||||||
ossMenu.toggle();
|
ossMenu.toggle();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -98,11 +98,12 @@ export function RSEditorControls({ isOpen, disabled, onEdit }: RSEditorControlsP
|
||||||
'select-none'
|
'select-none'
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
transitionProperty: 'clipPath, height',
|
|
||||||
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
|
||||||
clipPath: isOpen ? 'inset(0% 0% 0% 0%)' : 'inset(0% 0% 100% 0%)',
|
clipPath: isOpen ? 'inset(0% 0% 0% 0%)' : 'inset(0% 0% 100% 0%)',
|
||||||
marginTop: isOpen ? '0.25rem' : '0rem',
|
marginTop: isOpen ? '0.25rem' : '0rem',
|
||||||
height: isOpen ? 'max-content' : '0rem'
|
willChange: 'max-height',
|
||||||
|
transitionProperty: 'max-height',
|
||||||
|
transitionDuration: `${PARAMETER.moveDuration}ms`,
|
||||||
|
maxHeight: isOpen ? '4.5rem' : '0rem'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{MAIN_FIRST_ROW.map(token => (
|
{MAIN_FIRST_ROW.map(token => (
|
||||||
|
|
|
@ -62,11 +62,10 @@ export function ViewHidden({ items, selected, toggleSelection, setFocus, schema,
|
||||||
<div
|
<div
|
||||||
className='w-fit select-none'
|
className='w-fit select-none'
|
||||||
style={{
|
style={{
|
||||||
transitionProperty: 'margin, translate',
|
transitionProperty: 'translate',
|
||||||
transitionDuration: `${PARAMETER.fastAnimation}ms`,
|
transitionDuration: `${PARAMETER.fastAnimation}ms`,
|
||||||
transitionTimingFunction: 'ease-out',
|
transitionTimingFunction: 'ease-out',
|
||||||
marginLeft: isFolded ? '0.75rem' : '0',
|
translate: isFolded ? '0.75rem' : 'calc(6.5rem - 50%)'
|
||||||
translate: isFolded ? '0' : 'calc(6.5rem - 50%)'
|
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{`Скрытые [${localSelected.length} | ${items.length}]`}
|
{`Скрытые [${localSelected.length} | ${items.length}]`}
|
||||||
|
@ -84,6 +83,7 @@ export function ViewHidden({ items, selected, toggleSelection, setFocus, schema,
|
||||||
style={{
|
style={{
|
||||||
pointerEvents: isFolded ? 'none' : 'auto',
|
pointerEvents: isFolded ? 'none' : 'auto',
|
||||||
maxHeight: hiddenHeight,
|
maxHeight: hiddenHeight,
|
||||||
|
willChange: 'clip-path',
|
||||||
transitionProperty: 'clip-path',
|
transitionProperty: 'clip-path',
|
||||||
transitionDuration: `${PARAMETER.fastAnimation}ms`,
|
transitionDuration: `${PARAMETER.fastAnimation}ms`,
|
||||||
transitionTimingFunction: 'ease-out',
|
transitionTimingFunction: 'ease-out',
|
||||||
|
|
|
@ -41,11 +41,12 @@ export function ViewConstituents({ isBottom, isMounted }: ViewConstituentsProps)
|
||||||
}
|
}
|
||||||
)}
|
)}
|
||||||
style={{
|
style={{
|
||||||
transitionProperty: 'opacity, width',
|
willChange: 'opacity, max-width',
|
||||||
|
transitionProperty: 'opacity, max-width',
|
||||||
transitionDuration: `${2 * PARAMETER.moveDuration}ms`,
|
transitionDuration: `${2 * PARAMETER.moveDuration}ms`,
|
||||||
transitionTimingFunction: 'ease-in-out',
|
transitionTimingFunction: 'ease-in-out',
|
||||||
opacity: isMounted ? 1 : 0,
|
opacity: isMounted ? 1 : 0,
|
||||||
width: isMounted ? 'fit-content' : '0'
|
maxWidth: isMounted ? '100%' : '0'
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<ConstituentsSearch
|
<ConstituentsSearch
|
||||||
|
|
Loading…
Reference in New Issue
Block a user