F: Add masking blur effects for edges of graphs
This commit is contained in:
parent
ab551a3ece
commit
342c315c45
1
.vscode/settings.json
vendored
1
.vscode/settings.json
vendored
|
@ -114,6 +114,7 @@
|
||||||
"lezer",
|
"lezer",
|
||||||
"Litr",
|
"Litr",
|
||||||
"loct",
|
"loct",
|
||||||
|
"mgraph",
|
||||||
"moprho",
|
"moprho",
|
||||||
"multiword",
|
"multiword",
|
||||||
"mypy",
|
"mypy",
|
||||||
|
|
|
@ -14,7 +14,10 @@ import { IconClose } from '../icons';
|
||||||
import { ModalBackdrop } from './modal-backdrop';
|
import { ModalBackdrop } from './modal-backdrop';
|
||||||
import { type ModalProps } from './modal-form';
|
import { type ModalProps } from './modal-form';
|
||||||
|
|
||||||
interface ModalViewProps extends ModalProps {}
|
interface ModalViewProps extends ModalProps {
|
||||||
|
/** Float all UI elements on top of contents. */
|
||||||
|
fullScreen?: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a customizable modal window with submit form.
|
* Displays a customizable modal window with submit form.
|
||||||
|
@ -26,6 +29,7 @@ export function ModalView({
|
||||||
overflowVisible,
|
overflowVisible,
|
||||||
helpTopic,
|
helpTopic,
|
||||||
hideHelpWhen,
|
hideHelpWhen,
|
||||||
|
fullScreen,
|
||||||
...restProps
|
...restProps
|
||||||
}: React.PropsWithChildren<ModalViewProps>) {
|
}: React.PropsWithChildren<ModalViewProps>) {
|
||||||
const hideDialog = useDialogsStore(state => state.hideDialog);
|
const hideDialog = useDialogsStore(state => state.hideDialog);
|
||||||
|
@ -53,7 +57,16 @@ export function ModalView({
|
||||||
onClick={hideDialog}
|
onClick={hideDialog}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
{header ? <h1 className='px-12 py-2 select-none'>{header}</h1> : null}
|
{header ? (
|
||||||
|
<h1
|
||||||
|
className={clsx(
|
||||||
|
'px-12 py-2 select-none',
|
||||||
|
fullScreen && 'z-pop absolute top-0 right-1/2 translate-x-1/2 cc-blur bg-prim-100/90 rounded-2xl'
|
||||||
|
)}
|
||||||
|
>
|
||||||
|
{header}
|
||||||
|
</h1>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
|
@ -71,12 +84,22 @@ export function ModalView({
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{!fullScreen ? (
|
||||||
<Button
|
<Button
|
||||||
text='Закрыть'
|
text='Закрыть'
|
||||||
aria-label='Закрыть'
|
aria-label='Закрыть'
|
||||||
className='z-pop my-2 mx-auto text-sm min-w-28'
|
className={clsx(
|
||||||
|
'my-2 mx-auto text-sm min-w-28',
|
||||||
|
fullScreen && 'z-pop absolute bottom-0 right-1/2 translate-x-1/2 cc-blur'
|
||||||
|
)}
|
||||||
onClick={hideDialog}
|
onClick={hideDialog}
|
||||||
/>
|
/>
|
||||||
|
) : (
|
||||||
|
<div className='z-pop absolute bottom-0 right-1/2 translate-x-1/2 bg-prim-100/90 cc-blur p-3 rounded-xl'>
|
||||||
|
{' '}
|
||||||
|
<Button text='Закрыть' aria-label='Закрыть' className='text-sm min-w-28' onClick={hideDialog} />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|
|
@ -199,7 +199,7 @@ export function OssFlow() {
|
||||||
|
|
||||||
<NodeContextMenu isOpen={isContextMenuOpen} onHide={() => setIsContextMenuOpen(false)} {...menuProps} />
|
<NodeContextMenu isOpen={isContextMenuOpen} onHide={() => setIsContextMenuOpen(false)} {...menuProps} />
|
||||||
|
|
||||||
<div className='cc-fade-in relative w-[100vw]' style={{ height: mainHeight, fontFamily: 'Rubik' }}>
|
<div className='cc-fade-in relative w-[100vw] cc-mask-sides' style={{ height: mainHeight, fontFamily: 'Rubik' }}>
|
||||||
<ReactFlow
|
<ReactFlow
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
edges={edges}
|
edges={edges}
|
||||||
|
|
|
@ -26,12 +26,16 @@ export function DlgShowAST() {
|
||||||
const [isDragging, setIsDragging] = useState(false);
|
const [isDragging, setIsDragging] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ModalView className='relative w-[calc(100dvw-3rem)] h-[calc(100dvh-6rem)]' helpTopic={HelpTopic.UI_FORMULA_TREE}>
|
<ModalView
|
||||||
|
className='relative w-[calc(100dvw-3rem)] h-[calc(100dvh-6rem)] cc-mask-sides'
|
||||||
|
helpTopic={HelpTopic.UI_FORMULA_TREE}
|
||||||
|
fullScreen
|
||||||
|
>
|
||||||
<div
|
<div
|
||||||
className={clsx(
|
className={clsx(
|
||||||
'absolute z-pop top-2 right-1/2 translate-x-1/2 max-w-[60ch]',
|
'absolute z-pop top-2 right-1/2 translate-x-1/2 max-w-[60ch]',
|
||||||
'px-2 rounded-2xl',
|
'px-2 rounded-2xl',
|
||||||
'cc-blur bg-prim-100',
|
'cc-blur bg-prim-100/90',
|
||||||
'text-lg text-center'
|
'text-lg text-center'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
|
|
|
@ -36,7 +36,8 @@ export function DlgShowTypeGraph() {
|
||||||
return (
|
return (
|
||||||
<ModalView
|
<ModalView
|
||||||
header='Граф ступеней'
|
header='Граф ступеней'
|
||||||
className='flex flex-col justify-stretch w-[calc(100dvw-3rem)] h-[calc(100dvh-6rem)]'
|
className='cc-mask-sides flex flex-col justify-stretch w-[calc(100dvw-3rem)] h-[calc(100dvh-6rem)]'
|
||||||
|
fullScreen
|
||||||
helpTopic={HelpTopic.UI_TYPE_GRAPH}
|
helpTopic={HelpTopic.UI_TYPE_GRAPH}
|
||||||
>
|
>
|
||||||
<ReactFlowProvider>
|
<ReactFlowProvider>
|
||||||
|
|
|
@ -188,7 +188,7 @@ export function TGFlow() {
|
||||||
<ViewHidden items={hidden} />
|
<ViewHidden items={hidden} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='relative outline-hidden w-[100dvw]' style={{ height: mainHeight }}>
|
<div className='relative outline-hidden w-[100dvw] cc-mask-sides' style={{ height: mainHeight }}>
|
||||||
<ReactFlow
|
<ReactFlow
|
||||||
nodes={nodes}
|
nodes={nodes}
|
||||||
onNodesChange={onNodesChange}
|
onNodesChange={onNodesChange}
|
||||||
|
|
|
@ -62,8 +62,7 @@
|
||||||
.react-flow__attribution {
|
.react-flow__attribution {
|
||||||
font-size: var(--font-size-sm);
|
font-size: var(--font-size-sm);
|
||||||
font-family: var(--font-ui);
|
font-family: var(--font-ui);
|
||||||
margin-left: 3px;
|
margin: 1rem;
|
||||||
margin-right: 3px;
|
|
||||||
|
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
color: var(--clr-prim-600);
|
color: var(--clr-prim-600);
|
||||||
|
|
|
@ -264,3 +264,20 @@
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@utility cc-mask-sides {
|
||||||
|
--mask-border-size: 2rem;
|
||||||
|
|
||||||
|
mask-image: linear-gradient(to top, transparent, black calc(var(--mask-border-size))),
|
||||||
|
linear-gradient(to bottom, transparent, black calc(var(--mask-border-size))),
|
||||||
|
linear-gradient(to left, transparent, black calc(var(--mask-border-size))),
|
||||||
|
linear-gradient(to right, transparent, black calc(var(--mask-border-size)));
|
||||||
|
|
||||||
|
-webkit-mask-image: linear-gradient(to top, transparent, black calc(var(--mask-border-size))),
|
||||||
|
linear-gradient(to bottom, transparent, black calc(var(--mask-border-size))),
|
||||||
|
linear-gradient(to left, transparent, black calc(var(--mask-border-size))),
|
||||||
|
linear-gradient(to right, transparent, black calc(var(--mask-border-size)));
|
||||||
|
|
||||||
|
mask-composite: intersect;
|
||||||
|
-webkit-mask-composite: destination-in;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user