Skip to content

Commit 2806ecc

Browse files
authored
Merge pull request #4 from old-door/3-add-functional-canvas-test-example
3 add functional canvas test example
2 parents ab04bb7 + ad035dd commit 2806ecc

21 files changed

+1578
-86
lines changed

package-lock.json

Lines changed: 509 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"dayjs": "^1.11.13",
1515
"react": "^19.1.1",
1616
"react-dom": "^19.1.1",
17-
"react-router-dom": "^7.8.0"
17+
"react-router-dom": "^7.8.0",
18+
"sharp": "^0.34.3"
1819
},
1920
"devDependencies": {
2021
"@eslint/js": "^9.32.0",

playwright-report-example.zip

220 KB
Binary file not shown.

src/App.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ import TablePage from './pages/TablePage'
44
import Items from './pages/Items'
55
import './index.css'
66
import React from 'react'
7+
import ChartPage from './pages/ChartPage'
78

89
const navItems = [
910
{ to: '/', label: 'Home', testId: 'nav-home' },
1011
{ to: '/table', label: 'Table', testId: 'nav-table' },
1112
{ to: '/items', label: 'Items', testId: 'nav-items' },
13+
{ to: '/chart', label: 'Chart', testId: 'nav-paint' },
1214
]
1315

1416
export default function App() {
@@ -36,6 +38,7 @@ export default function App() {
3638
<Route path="/" element={<Home />} />
3739
<Route path="/table" element={<TablePage />} />
3840
<Route path="/items" element={<Items />} />
41+
<Route path="/chart" element={<ChartPage />} />
3942
</Routes>
4043
</main>
4144
</div>

src/index.css

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
text-rendering: optimizeLegibility;
1212
-webkit-font-smoothing: antialiased;
1313
-moz-osx-font-smoothing: grayscale;
14+
--axis-color: #e0e0e0;
15+
--text-color: #e0e0e0;
1416
}
1517

1618
a {
@@ -73,14 +75,51 @@ input[type="number"]:focus {
7375
box-shadow: 0 0 4px rgba(163, 191, 250, 0.5);
7476
}
7577

78+
.canvas-container,
7679
.container {
7780
border: 1px solid #333;
78-
padding: 1rem;
7981
border-radius: 8px;
8082
background-color: #222;
8183
color: #e0e0e0;
8284
}
8385

86+
.container {
87+
padding: 1rem;
88+
}
89+
90+
.tooltip {
91+
border: 1px solid #333;
92+
background-color: #222;
93+
color: #e0e0e0;
94+
padding: 4px 8px;
95+
border-radius: 4px;
96+
font-size: 12px;
97+
white-space: nowrap;
98+
}
99+
100+
.context-menu {
101+
border: 1px solid #333;
102+
background-color: #222;
103+
color: #e0e0e0;
104+
border-radius: 4px;
105+
font-size: 12px;
106+
}
107+
108+
.context-menu-option {
109+
border-radius: 4px;
110+
cursor: pointer;
111+
white-space: nowrap;
112+
padding: 4px;
113+
background-color: #222;
114+
color: #e0e0e0;
115+
}
116+
.context-menu-option:hover {
117+
background-color: #2e2e2e;
118+
}
119+
.context-menu-option:active {
120+
background-color: #444;
121+
}
122+
84123
.item-card {
85124
display: flex;
86125
flex-direction: column;
@@ -98,6 +137,8 @@ input[type="number"]:focus {
98137
:root {
99138
color: #213547;
100139
background-color: #ffffff;
140+
--axis-color: #213547;
141+
--text-color: #213547;
101142
}
102143
body {
103144
color: #213547;
@@ -127,7 +168,7 @@ input[type="number"]:focus {
127168
}
128169
button:active {
129170
outline: 4px auto -webkit-focus-ring-color;
130-
background-color: #eee;
171+
background-color: #ddd;
131172
}
132173

133174
input[type="checkbox"],
@@ -148,13 +189,28 @@ input[type="number"]:focus {
148189
box-shadow: 0 0 4px rgba(100, 108, 255, 0.5);
149190
}
150191

192+
.context-menu,
193+
.tooltip,
194+
.canvas-container,
151195
.container {
152-
border-color: #ccc;
196+
border: 1px solid #ccc;
153197
background-color: #f8f8f8;
154198
color: #213547;
155199
}
156-
.item-card:hover {
200+
201+
.context-menu-option {
202+
background-color: #f8f8f8;
203+
color: #213547;
204+
}
205+
206+
.context-menu-option:hover {
157207
background-color: #f0f0f0;
208+
}
209+
.context-menu-option:active {
210+
background-color: #ddd;
211+
}
212+
213+
.item-card:hover {
158214
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
159215
}
160216
}

0 commit comments

Comments
 (0)