Skip to content

Commit 964dba3

Browse files
author
danil-nizamov
committed
small adjustments
1 parent 463bd5f commit 964dba3

3 files changed

Lines changed: 37 additions & 74 deletions

File tree

diagram.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ function renderTable(svg, table, schema, selectedTableId, selectedColId, onSelec
9999
title.textContent = table.name; g.appendChild(title);
100100

101101
// HEADER SEPARATOR
102-
g.appendChild(createSvg('line', { x1: x + 8, y1: y + DIAGRAM.HEADER_H, x2: x + width - 8, y2: y + DIAGRAM.HEADER_H, stroke: '#d1d5db', 'stroke-width': '0.5' }));
102+
g.appendChild(createSvg('line', { x1: x, y1: y + DIAGRAM.HEADER_H, x2: x + width, y2: y + DIAGRAM.HEADER_H, stroke: '#d1d5db', 'stroke-width': '0.5' }));
103103

104104
// DRAG BUTTON (the ONLY drag handle)
105105
const btnSize = 16;

solution.json

Lines changed: 27 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,105 +1,73 @@
11
{
2-
"version": "1.0",
3-
"name": "ShopDB",
2+
"name": "Untitled schema",
43
"tables": [
54
{
6-
"id": "tbl_users",
5+
"id": "tbl_users_5jfh90d",
76
"name": "users",
87
"columns": [
98
{
10-
"id": "u_id",
9+
"id": "col_id_tp7z9eh",
1110
"name": "id",
1211
"type": "int",
1312
"nullable": false,
1413
"default": null
15-
},
16-
{
17-
"id": "u_email",
18-
"name": "email",
19-
"type": "varchar(255)",
20-
"nullable": false,
21-
"default": null
22-
},
23-
{
24-
"id": "u_name",
25-
"name": "name",
26-
"type": "varchar(255)",
27-
"nullable": false,
28-
"default": null
2914
}
3015
],
3116
"primaryKey": [
32-
"u_id"
17+
"col_id_tp7z9eh"
3318
],
3419
"uniqueConstraints": [
3520
{
36-
"id": "uq_users_email",
21+
"id": "uq_obntuki",
3722
"columns": [
38-
"u_email"
23+
"col_id_tp7z9eh"
3924
]
4025
}
4126
],
4227
"indexes": [],
4328
"position": {
44-
"x": 603,
45-
"y": 125
46-
}
29+
"x": 656,
30+
"y": 133
31+
},
32+
"color": "white"
4733
},
4834
{
49-
"id": "tbl_orders",
50-
"name": "orders****",
35+
"id": "tbl_wow_ntv1bum",
36+
"name": "peep",
5137
"columns": [
5238
{
53-
"id": "o_id",
39+
"id": "col_id_w4l8ea5",
5440
"name": "id",
5541
"type": "int",
5642
"nullable": false,
5743
"default": null
5844
},
5945
{
60-
"id": "o_user_id",
46+
"id": "col_user_id_v0cqfey",
6147
"name": "user_id",
6248
"type": "int",
6349
"nullable": false,
6450
"default": null
65-
},
66-
{
67-
"id": "o_total",
68-
"name": "total",
69-
"type": "decimal(10,2)",
70-
"nullable": false,
71-
"default": "0.00"
7251
}
7352
],
7453
"primaryKey": [
75-
"o_id"
54+
"col_id_w4l8ea5"
55+
],
56+
"uniqueConstraints": [
57+
{
58+
"id": "uq_54xxf1u",
59+
"columns": [
60+
"col_id_w4l8ea5"
61+
]
62+
}
7663
],
77-
"uniqueConstraints": [],
7864
"indexes": [],
7965
"position": {
80-
"x": 85,
81-
"y": -102
66+
"x": 304,
67+
"y": 223
8268
},
83-
"color": "blue"
69+
"color": "red"
8470
}
8571
],
86-
"foreignKeys": [
87-
{
88-
"id": "fk_a1cw4cy",
89-
"from": {
90-
"table": "tbl_orders",
91-
"columns": [
92-
"o_user_id"
93-
]
94-
},
95-
"to": {
96-
"table": "tbl_users",
97-
"columns": [
98-
"u_id"
99-
]
100-
},
101-
"onDelete": "NO ACTION",
102-
"onUpdate": "NO ACTION"
103-
}
104-
]
72+
"foreignKeys": []
10573
}

style.css

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@
7171
}
7272

7373
header{
74-
display:flex;align-items:center;gap:1rem;padding:.5rem 1rem; /* Reduced from .75rem to .5rem */
74+
display:flex;align-items:center;gap:1rem;padding:.45rem 1rem; /* Reduced from .75rem to .5rem */
7575
border-bottom:1px solid var(--stroke);
7676
background:var(--box)
7777
}
7878

7979
/* Light theme navigation bar background */
8080
@media (prefers-color-scheme: light) {
8181
header {
82-
background: #ffffff; /* Changed to white */
82+
background: #ffffff;
8383
}
8484
}
8585
header h1{font-size:1.1rem;margin:0}
@@ -142,24 +142,24 @@
142142

143143
/* Input field specific styles (exclude checkboxes) */
144144
input:not([type="checkbox"]) {
145-
min-height: 3rem; /* Reduced from 3.75rem (20% reduction) */
145+
min-height: 3rem;
146146
max-height: 8.737499999999999rem;
147147
padding-left: 1rem;
148148
padding-right: 2.75rem;
149-
padding-top: 0.75rem; /* Reduced from 0.94975rem */
150-
padding-bottom: 0.75rem; /* Reduced from 0.94975rem */
149+
padding-top: 0.75rem;
150+
padding-bottom: 0.75rem;
151151
}
152152

153153
/* Select field specific styles to match inputs */
154154
select {
155155
-webkit-appearance: none;
156156
-moz-appearance: none;
157-
min-height: 3rem; /* Reduced from 3.75rem (20% reduction) */
157+
min-height: 3rem;
158158
max-height: 8.737499999999999rem;
159159
padding-left: 1rem;
160-
padding-right: 3rem; /* Increased from 2.75rem to give arrow more space */
161-
padding-top: 0.75rem; /* Reduced from 0.94975rem */
162-
padding-bottom: 0.75rem; /* Reduced from 0.94975rem */
160+
padding-right: 3rem;
161+
padding-top: 0.75rem;
162+
padding-bottom: 0.75rem;
163163
appearance: none; /* Remove default arrow */
164164
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
165165
background-repeat: no-repeat;
@@ -198,10 +198,8 @@
198198

199199
/* Dark-mode specifics */
200200
@media (prefers-color-scheme: dark) {
201-
/* 1) Sidebar "menus" (cards) should have no border in dark */
202201
.card { border: none; }
203202

204-
/* 2) Buttons should be dark with light-grey border */
205203
button {
206204
background: rgb(45 56 85 / 0.25);
207205
border-color: rgb(57 69 99);
@@ -213,7 +211,6 @@
213211
color: rgb(215 218 230);
214212
}
215213

216-
/* Update delete buttons to transparent red in dark mode */
217214
button.danger {
218215
background: rgba(239, 68, 68, 0.05);
219216
border-color: rgba(239, 68, 68, 0.6);
@@ -232,14 +229,12 @@
232229
color: rgb(215 218 230);
233230
}
234231

235-
/* 3) Inputs and selects dark with grey default (placeholder) text */
236232
input:not([type="checkbox"]), select {
237233
background: rgb(23 32 55);
238234
color: #c1c7d7;
239235
border-color: transparent;
240236
}
241237

242-
/* Dark mode dropdown arrow */
243238
select {
244239
background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c1c7d7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
245240
background-repeat: no-repeat;

0 commit comments

Comments
 (0)