Spaces:
Running
Running
fixing the bugs
Browse files- app/editor/page.tsx +11 -1
- app/globals.css +43 -0
app/editor/page.tsx
CHANGED
|
@@ -1338,6 +1338,11 @@ export default function EditorPage() {
|
|
| 1338 |
<div
|
| 1339 |
ref={containerRef}
|
| 1340 |
className="relative w-full h-[calc(100svh-56px)] overflow-hidden nb-canvas"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1341 |
onContextMenu={onContextMenu}
|
| 1342 |
onPointerDown={onBackgroundPointerDown}
|
| 1343 |
onPointerMove={(e) => {
|
|
@@ -1356,7 +1361,12 @@ export default function EditorPage() {
|
|
| 1356 |
>
|
| 1357 |
<div
|
| 1358 |
className="absolute left-0 top-0 will-change-transform"
|
| 1359 |
-
style={{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1360 |
>
|
| 1361 |
<svg className="absolute inset-0 pointer-events-none z-0" width="4800" height="3200">
|
| 1362 |
<defs>
|
|
|
|
| 1338 |
<div
|
| 1339 |
ref={containerRef}
|
| 1340 |
className="relative w-full h-[calc(100svh-56px)] overflow-hidden nb-canvas"
|
| 1341 |
+
style={{
|
| 1342 |
+
imageRendering: "auto",
|
| 1343 |
+
transform: "translateZ(0)",
|
| 1344 |
+
willChange: "contents"
|
| 1345 |
+
}}
|
| 1346 |
onContextMenu={onContextMenu}
|
| 1347 |
onPointerDown={onBackgroundPointerDown}
|
| 1348 |
onPointerMove={(e) => {
|
|
|
|
| 1361 |
>
|
| 1362 |
<div
|
| 1363 |
className="absolute left-0 top-0 will-change-transform"
|
| 1364 |
+
style={{
|
| 1365 |
+
transform: `translate3d(${tx}px, ${ty}px, 0) scale(${scale})`,
|
| 1366 |
+
transformOrigin: "0 0",
|
| 1367 |
+
transformStyle: "preserve-3d",
|
| 1368 |
+
backfaceVisibility: "hidden"
|
| 1369 |
+
}}
|
| 1370 |
>
|
| 1371 |
<svg className="absolute inset-0 pointer-events-none z-0" width="4800" height="3200">
|
| 1372 |
<defs>
|
app/globals.css
CHANGED
|
@@ -32,6 +32,15 @@ body {
|
|
| 32 |
box-shadow: 0 10px 30px rgba(0,0,0,0.35);
|
| 33 |
border-radius: 14px;
|
| 34 |
backdrop-filter: blur(6px);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
}
|
| 36 |
.nb-node .nb-header {
|
| 37 |
background: linear-gradient(to bottom, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
|
|
@@ -80,3 +89,37 @@ body {
|
|
| 80 |
radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
|
| 81 |
background-size: 20px 20px, 100px 100px;
|
| 82 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
box-shadow: 0 10px 30px rgba(0,0,0,0.35);
|
| 33 |
border-radius: 14px;
|
| 34 |
backdrop-filter: blur(6px);
|
| 35 |
+
/* Prevent blurring on zoom */
|
| 36 |
+
image-rendering: -webkit-optimize-contrast;
|
| 37 |
+
image-rendering: crisp-edges;
|
| 38 |
+
transform: translateZ(0);
|
| 39 |
+
will-change: transform;
|
| 40 |
+
-webkit-font-smoothing: antialiased;
|
| 41 |
+
-moz-osx-font-smoothing: grayscale;
|
| 42 |
+
backface-visibility: hidden;
|
| 43 |
+
perspective: 1000px;
|
| 44 |
}
|
| 45 |
.nb-node .nb-header {
|
| 46 |
background: linear-gradient(to bottom, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
|
|
|
|
| 89 |
radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
|
| 90 |
background-size: 20px 20px, 100px 100px;
|
| 91 |
}
|
| 92 |
+
|
| 93 |
+
/* Ensure crisp text and images at all zoom levels */
|
| 94 |
+
.nb-node * {
|
| 95 |
+
text-rendering: optimizeLegibility;
|
| 96 |
+
shape-rendering: crispEdges;
|
| 97 |
+
}
|
| 98 |
+
|
| 99 |
+
.nb-node img {
|
| 100 |
+
image-rendering: auto; /* Keep images smooth */
|
| 101 |
+
image-rendering: -webkit-optimize-contrast;
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
.nb-node input,
|
| 105 |
+
.nb-node select,
|
| 106 |
+
.nb-node textarea,
|
| 107 |
+
.nb-node button {
|
| 108 |
+
transform: translateZ(0);
|
| 109 |
+
-webkit-font-smoothing: subpixel-antialiased;
|
| 110 |
+
font-smoothing: subpixel-antialiased;
|
| 111 |
+
}
|
| 112 |
+
|
| 113 |
+
/* Force GPU acceleration for transforms */
|
| 114 |
+
.nb-canvas > div {
|
| 115 |
+
transform-style: preserve-3d;
|
| 116 |
+
-webkit-transform-style: preserve-3d;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
/* Prevent blur on scaled elements */
|
| 120 |
+
@media screen and (-webkit-min-device-pixel-ratio: 0) {
|
| 121 |
+
.nb-node {
|
| 122 |
+
-webkit-backface-visibility: hidden;
|
| 123 |
+
-webkit-transform: translateZ(0) scale(1.0, 1.0);
|
| 124 |
+
}
|
| 125 |
+
}
|