- Added a new CSS animation for edge insertion to improve visual feedback during node creation. - Updated the edge insertion reflow duration from 997ms to 1297ms for smoother transitions. - Refactored related components to support the new animation and ensure consistent behavior across the canvas. - Enhanced tests to validate the new edge insertion features and animations.
294 lines
8.8 KiB
CSS
294 lines
8.8 KiB
CSS
@import "tailwindcss";
|
|
@import "tw-animate-css";
|
|
@import "shadcn/tailwind.css";
|
|
|
|
@custom-variant dark (&:is(.dark *));
|
|
|
|
@theme inline {
|
|
--color-background: var(--background);
|
|
--color-foreground: var(--foreground);
|
|
--font-sans: var(--font-sans);
|
|
--font-mono: var(--font-geist-mono);
|
|
--font-heading: var(--font-sans);
|
|
--color-sidebar-ring: var(--sidebar-ring);
|
|
--color-sidebar-border: var(--sidebar-border);
|
|
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
|
|
--color-sidebar-accent: var(--sidebar-accent);
|
|
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
|
|
--color-sidebar-primary: var(--sidebar-primary);
|
|
--color-sidebar-foreground: var(--sidebar-foreground);
|
|
--color-sidebar: var(--sidebar);
|
|
--color-chart-5: var(--chart-5);
|
|
--color-chart-4: var(--chart-4);
|
|
--color-chart-3: var(--chart-3);
|
|
--color-chart-2: var(--chart-2);
|
|
--color-chart-1: var(--chart-1);
|
|
--color-ring: var(--ring);
|
|
--color-input: var(--input);
|
|
--color-border: var(--border);
|
|
--color-destructive: var(--destructive);
|
|
--color-accent-foreground: var(--accent-foreground);
|
|
--color-accent: var(--accent);
|
|
--color-muted-foreground: var(--muted-foreground);
|
|
--color-muted: var(--muted);
|
|
--color-secondary-foreground: var(--secondary-foreground);
|
|
--color-secondary: var(--secondary);
|
|
--color-primary-foreground: var(--primary-foreground);
|
|
--color-primary: var(--primary);
|
|
--color-popover-foreground: var(--popover-foreground);
|
|
--color-popover: var(--popover);
|
|
--color-card-foreground: var(--card-foreground);
|
|
--color-card: var(--card);
|
|
--radius-sm: calc(var(--radius) * 0.6);
|
|
--radius-md: calc(var(--radius) * 0.8);
|
|
--radius-lg: var(--radius);
|
|
--radius-xl: calc(var(--radius) * 1.4);
|
|
--radius-2xl: calc(var(--radius) * 1.8);
|
|
--radius-3xl: calc(var(--radius) * 2.2);
|
|
--radius-4xl: calc(var(--radius) * 2.6);
|
|
}
|
|
|
|
:root {
|
|
--background: oklch(0.985 0.005 80);
|
|
--foreground: oklch(0.18 0.012 60);
|
|
--card: oklch(0.993 0.003 80);
|
|
--card-foreground: oklch(0.18 0.012 60);
|
|
--popover: oklch(0.993 0.003 80);
|
|
--popover-foreground: oklch(0.18 0.012 60);
|
|
--primary: oklch(0.52 0.09 178);
|
|
--primary-foreground: oklch(0.985 0.01 178);
|
|
--secondary: oklch(0.955 0.01 82);
|
|
--secondary-foreground: oklch(0.25 0.012 60);
|
|
--muted: oklch(0.96 0.008 80);
|
|
--muted-foreground: oklch(0.52 0.015 60);
|
|
--accent: oklch(0.92 0.1 95);
|
|
--accent-foreground: oklch(0.3 0.04 80);
|
|
--destructive: oklch(0.577 0.245 27.325);
|
|
--border: oklch(0.91 0.01 75);
|
|
--input: oklch(0.91 0.01 75);
|
|
--ring: oklch(0.52 0.09 178);
|
|
--chart-1: oklch(0.845 0.143 164.978);
|
|
--chart-2: oklch(0.696 0.17 162.48);
|
|
--chart-3: oklch(0.596 0.145 163.225);
|
|
--chart-4: oklch(0.508 0.118 165.612);
|
|
--chart-5: oklch(0.432 0.095 166.913);
|
|
--radius: 0.75rem;
|
|
--sidebar: oklch(0.975 0.006 80);
|
|
--sidebar-foreground: oklch(0.18 0.012 60);
|
|
--sidebar-primary: oklch(0.52 0.09 178);
|
|
--sidebar-primary-foreground: oklch(0.985 0.01 178);
|
|
--sidebar-accent: oklch(0.96 0.008 80);
|
|
--sidebar-accent-foreground: oklch(0.25 0.012 60);
|
|
--sidebar-border: oklch(0.91 0.01 75);
|
|
--sidebar-ring: oklch(0.52 0.09 178);
|
|
}
|
|
|
|
.dark {
|
|
--background: oklch(0.16 0.01 65);
|
|
--foreground: oklch(0.93 0.008 80);
|
|
--card: oklch(0.21 0.012 65);
|
|
--card-foreground: oklch(0.93 0.008 80);
|
|
--popover: oklch(0.21 0.012 65);
|
|
--popover-foreground: oklch(0.93 0.008 80);
|
|
--primary: oklch(0.62 0.1 178);
|
|
--primary-foreground: oklch(0.15 0.03 178);
|
|
--secondary: oklch(0.26 0.01 65);
|
|
--secondary-foreground: oklch(0.92 0.006 80);
|
|
--muted: oklch(0.24 0.01 65);
|
|
--muted-foreground: oklch(0.65 0.012 70);
|
|
--accent: oklch(0.35 0.06 90);
|
|
--accent-foreground: oklch(0.93 0.008 80);
|
|
--destructive: oklch(0.704 0.191 22.216);
|
|
--border: oklch(1 0 0 / 8%);
|
|
--input: oklch(1 0 0 / 12%);
|
|
--ring: oklch(0.62 0.1 178);
|
|
--chart-1: oklch(0.845 0.143 164.978);
|
|
--chart-2: oklch(0.696 0.17 162.48);
|
|
--chart-3: oklch(0.596 0.145 163.225);
|
|
--chart-4: oklch(0.508 0.118 165.612);
|
|
--chart-5: oklch(0.432 0.095 166.913);
|
|
--sidebar: oklch(0.19 0.01 65);
|
|
--sidebar-foreground: oklch(0.93 0.008 80);
|
|
--sidebar-primary: oklch(0.62 0.1 178);
|
|
--sidebar-primary-foreground: oklch(0.15 0.03 178);
|
|
--sidebar-accent: oklch(0.24 0.01 65);
|
|
--sidebar-accent-foreground: oklch(0.93 0.008 80);
|
|
--sidebar-border: oklch(1 0 0 / 8%);
|
|
--sidebar-ring: oklch(0.62 0.1 178);
|
|
}
|
|
|
|
@layer base {
|
|
* {
|
|
@apply border-border outline-ring/50;
|
|
}
|
|
body {
|
|
@apply bg-background text-foreground;
|
|
}
|
|
html {
|
|
@apply font-sans;
|
|
}
|
|
}
|
|
|
|
@keyframes shimmer {
|
|
0% {
|
|
transform: translateX(-100%);
|
|
}
|
|
100% {
|
|
transform: translateX(100%);
|
|
}
|
|
}
|
|
|
|
/* Temporäre XYFlow-Verbindungslinie (custom connectionLineComponent) */
|
|
@keyframes ls-connection-dash-offset {
|
|
to {
|
|
stroke-dashoffset: -18;
|
|
}
|
|
}
|
|
|
|
@keyframes ls-edge-insert-enter {
|
|
0% {
|
|
opacity: 0;
|
|
scale: 0.82;
|
|
}
|
|
100% {
|
|
opacity: 1;
|
|
scale: 1;
|
|
}
|
|
}
|
|
|
|
.ls-connection-line-marching {
|
|
animation: ls-connection-dash-offset 0.4s linear infinite;
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.ls-connection-line-marching {
|
|
animation: none;
|
|
}
|
|
}
|
|
|
|
@layer utilities {
|
|
.animate-shimmer {
|
|
animation: shimmer 1.5s ease-in-out infinite;
|
|
}
|
|
}
|
|
|
|
@layer components {
|
|
/* Kanten: doppelte Standard-Dicke, feste Kontrastfarben je Light/Dark (gleiches Schema wie colorMode) */
|
|
.react-flow {
|
|
--xy-edge-stroke: rgba(44, 62, 80, 1);
|
|
--xy-edge-stroke-width: 2;
|
|
--xy-edge-stroke-selected: rgba(44, 62, 80, 1);
|
|
--xy-connectionline-stroke: rgba(44, 62, 80, 1);
|
|
--xy-connectionline-stroke-width: 1;
|
|
}
|
|
|
|
.react-flow.dark {
|
|
--xy-edge-stroke: rgba(189, 195, 199, 1);
|
|
--xy-edge-stroke-width: 2;
|
|
--xy-edge-stroke-selected: rgba(189, 195, 199, 1);
|
|
--xy-connectionline-stroke: rgba(189, 195, 199, 1);
|
|
--xy-connectionline-stroke-width: 1;
|
|
}
|
|
|
|
/* Verbindungs-Punkte über Node-Inhalt (XYFlow setzt kein z-index) */
|
|
.react-flow__handle {
|
|
z-index: 50;
|
|
}
|
|
|
|
/* Proximity-Vorschaukante (temp) */
|
|
.react-flow__edge.temp {
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.react-flow__edge.temp .react-flow__edge-path {
|
|
stroke-width: 5;
|
|
stroke-dasharray: 8 6;
|
|
stroke-linecap: round;
|
|
}
|
|
|
|
.react-flow:not(.dark) .react-flow__edge.temp .react-flow__edge-path {
|
|
stroke: rgba(44, 62, 80, 0.35);
|
|
}
|
|
|
|
.react-flow.dark .react-flow__edge.temp .react-flow__edge-path {
|
|
stroke: rgba(189, 195, 199, 0.35);
|
|
}
|
|
|
|
/*
|
|
* Scherenmodus: Lucide „scissors-line-dashed“, 90° gegen Uhrzeigersinn (in SVG).
|
|
* Dunkles Flow: helle Outline + heller Glow · helles Flow: dunkle Outline + dunkler Glow.
|
|
*/
|
|
.react-flow.dark.canvas-scissors-mode .react-flow__pane,
|
|
.react-flow.dark.canvas-scissors-mode .react-flow__edge-interaction {
|
|
cursor: url("/cursors/scissors-cursor-dark-canvas.svg") 12 12, crosshair;
|
|
}
|
|
|
|
.react-flow:not(.dark).canvas-scissors-mode .react-flow__pane,
|
|
.react-flow:not(.dark).canvas-scissors-mode .react-flow__edge-interaction {
|
|
cursor: url("/cursors/scissors-cursor-light-canvas.svg") 12 12, crosshair;
|
|
}
|
|
|
|
/* Scherenmodus: Hover auf Verbindung = Aufleuchten (Farben wie Scheren-Cursor) */
|
|
.react-flow.dark.canvas-scissors-mode .react-flow__edge:not(.temp) .react-flow__edge-path {
|
|
transition:
|
|
stroke 0.12s ease,
|
|
filter 0.12s ease;
|
|
}
|
|
|
|
.react-flow.dark.canvas-scissors-mode
|
|
.react-flow__edge:not(.temp):hover
|
|
.react-flow__edge-path {
|
|
stroke: #ffffff !important;
|
|
filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.9))
|
|
drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
|
|
}
|
|
|
|
.react-flow:not(.dark).canvas-scissors-mode
|
|
.react-flow__edge:not(.temp)
|
|
.react-flow__edge-path {
|
|
transition:
|
|
stroke 0.12s ease,
|
|
filter 0.12s ease;
|
|
}
|
|
|
|
.react-flow:not(.dark).canvas-scissors-mode
|
|
.react-flow__edge:not(.temp):hover
|
|
.react-flow__edge-path {
|
|
stroke: #27272a !important;
|
|
filter: drop-shadow(0 0 2px rgba(39, 39, 42, 0.75))
|
|
drop-shadow(0 0 9px rgba(39, 39, 42, 0.4));
|
|
}
|
|
|
|
.react-flow.canvas-edge-insert-reflowing .react-flow__node {
|
|
transition-property: transform;
|
|
transition-duration: var(--ls-edge-insert-reflow-duration, 1297ms);
|
|
transition-timing-function: cubic-bezier(0.68, -0.6, 0.32, 1.6);
|
|
will-change: transform;
|
|
}
|
|
|
|
.react-flow__node.canvas-edge-insert-enter,
|
|
.react-flow__node .canvas-edge-insert-enter {
|
|
animation: ls-edge-insert-enter 300ms cubic-bezier(0.68, -0.6, 0.32, 1.6) both;
|
|
transform-origin: center center;
|
|
will-change: scale, opacity;
|
|
}
|
|
|
|
@media (prefers-reduced-motion: reduce) {
|
|
.react-flow.canvas-scissors-mode .react-flow__edge:not(.temp) .react-flow__edge-path {
|
|
transition: none;
|
|
}
|
|
|
|
.react-flow.canvas-edge-insert-reflowing .react-flow__node {
|
|
transition: none;
|
|
}
|
|
|
|
.react-flow__node.canvas-edge-insert-enter,
|
|
.react-flow__node .canvas-edge-insert-enter {
|
|
animation: none;
|
|
opacity: 1;
|
|
scale: 1;
|
|
will-change: auto;
|
|
}
|
|
}
|
|
}
|