Repository navigation
Expand file tree
/
Copy pathdes19 (4).py
More file actions
567 lines (501 loc) · 9.59 KB
/
Copy pathdes19 (4).py
File metadata and controls
567 lines (501 loc) · 9.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
# This file was generated by the Tkinter Designer by Parth Jadhav
# https://github.com/ParthJadhav/Tkinter-Designer
from pathlib import Path
# from tkinter import *
# Explicit imports to satisfy Flake8
from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage
import tkinter.font as tkFont
OUTPUT_PATH = Path(__file__).parent
ASSETS_PATH = OUTPUT_PATH / Path(r"E:\H\RehabVeda\predictbuild\assets\frame0")
def relative_to_assets(path: str) -> Path:
return ASSETS_PATH / Path(path)
window = Tk()
window.geometry("1026x600")
window.configure(bg = "#000000")
def create_rounded_rectangle(canvas, x1, y1, x2, y2, r=5, **kwargs):
points = [
x1+r, y1,
x2-r, y1,
x2, y1,
x2, y1+r,
x2, y2-r,
x2, y2,
x2-r, y2,
x1+r, y2,
x1, y2,
x1, y2-r,
x1, y1+r,
x1, y1
]
return canvas.create_polygon(points, smooth=True, **kwargs)
#section except sidebar and left content
canvas = Canvas(
window,
bg = "#000000",
height = 600,
width = 1026,
bd = 0,
highlightthickness = 0,
relief = "ridge"
)
# Place canvas on the window — ADD THIS LINE:
canvas.place(x=0, y=0)
#header section
canvas.create_rectangle(
107.0,
0.0,
1026.0,
56.0,
fill="#111827",
outline="#6B7280",
)
canvas.create_text(
131.0,
16.0,
anchor="nw",
text="Predict",
fill="#FFFFFF",
font=("Inter Bold", 20 * -1)
)
#power icon
power_icon_1 = PhotoImage(
file=relative_to_assets("Power.png"))
power_1 = Button(
image=power_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg="#111827"
)
power_1.place(
x=974.0,
y=16.0,
# width=24.0,
# height=24.0
)
#rectangle for dark/light theme
create_rounded_rectangle(
canvas,
874.0,
8.0,
954.0,
48.0,
r=10,
fill="#FFFFFF",
outline="#F3F4F6")
#dark icon
dark_icon_1 = PhotoImage(
file=relative_to_assets("dark_mode.png"))
dark_1 = Button(
image=dark_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = "#FFFFFF"
)
dark_1.place(
x=880.0,
y=12.0,
# width=24.0,
# height=24.0
)
#rectangle light section
create_rounded_rectangle(
canvas,
915.0,
9.0,
953.0,
47.0,
r=10,
fill="#E5E7EB",
outline="")
#light icon
light_icon_1 = PhotoImage(
file=relative_to_assets("light_mode.png"))
light_1 = Button(
image=light_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg="#E5E7EB"
)
light_1.place(
x=922,
y=15,
# width=24.0,
# height=24.0
)
#sidebar rectangle section
canvas.create_rectangle(
0.0,
0.0,
107.0,
600.0,
fill="#1F2937",
outline="#6B7280")
#rehabveda icon
RVEllipse_icon_1 = PhotoImage(
file=relative_to_assets("RVEllipse.png"))
RVEllipse_1 = Button(
image=RVEllipse_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = '#1F2937'
)
RVEllipse_1.place(
x=64.262,
y=12.0,
)
RVBody_icon_1 = PhotoImage(
file=relative_to_assets("RVBody.png"))
RVBody_1 = Button(
image=RVBody_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = '#1F2937'
)
RVBody_1.place(
x=41.0,
y=21.55,
)
RVLeg_icon_1 = PhotoImage(
file=relative_to_assets("RVLeg.png"))
RVLeg_1 = Button(
image=RVLeg_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = '#1F2937'
)
RVLeg_1.place(
x=60.148,
y=33.3,
)
#underline after Rehabveda
canvas.create_rectangle(
16.0,
56.0,
97.0,
56.0,
fill="#6B7280",
outline="")
#vertical line for sidebar icons
canvas.create_rectangle(
57.0,
56.0,
57.0,
594.0,
fill="",
outline="#6B7280")
#user icon ellipse
canvas.create_oval(
38.0,
82.0,
74.0,
118.0,
fill="#1F2937",
outline="#6B7280",
width=2 # Optional: makes the border visibly thicker
)
#user icon
user_icon_1 = PhotoImage(
file=relative_to_assets("user_icon.png"))
user_1 = Button(
image=user_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = "#1F2937"
)
user_1.place(
x=46.0,
y=90.0
)
#collect icon ellipse
canvas.create_oval(
38.0, # x0 (left)
140.0, # y0 (top)
74.0, # x1 (right)
176.0, # y1 (bottom)
fill="#1F2937",
outline="#6B7280",
width=2
)
#collect icon
collect_icon_1 = PhotoImage(
file=relative_to_assets("collect_icon.png"))
collect_1 = Button(
image=collect_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = "#1F2937"
)
collect_1.place(
x=47.5,
y=148.0,
)
#predict icon ellipse
canvas.create_oval(
38.0,
200.0,
74.0,
236.0,
fill="#1F2937",
outline="#6B7280",
width=2 # Optional: makes the border visibly thicker
)
#predict icon
predict_icon_1 = PhotoImage(
file=relative_to_assets("online_prediction.png"))
predict_1 = Button(
image=predict_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = "#1F2937"
)
predict_1.place(
x=45.0,
y=206.0,
)
#analytics icon ellipse
canvas.create_oval(
38.0,
260.0,
74.0,
296.0,
fill="#1F2937",
outline="#6B7280",
width=2 # Optional: makes the border visibly thicker
)
#analytics icon
analytics_icon_1 = PhotoImage(
file=relative_to_assets("analytics_icon.png"))
analytics_1 = Button(
image=analytics_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = "#1F2937"
)
analytics_1.place(
x=45.0,
y=272.0,
)
#arrow icon ellipse
canvas.create_oval(
88.0, # x0 (left)
36.0, # y0 (top)
125.0, # x1 (right)
73.0, # y1 (bottom)
fill="#FFFFFF",
outline="#6B7280",
width=4
)
arrow_image_1 = PhotoImage(
file=relative_to_assets("arrow_icon.png"))
arrow_1 = Button(
image=arrow_image_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg = "#FFFFFF"
)
arrow_1.place(
x=103.61,
y=48.71875,
# width=5.78,
# height=11.56
)
#start your session container
create_rounded_rectangle(
canvas,
131,
80,
1002,
266,
r=10,
fill="#374151",
outline="#374151"
)
canvas.create_text(
155.0,
104,
anchor="nw",
text="Your session has started",
fill="#3BC6B5",
font=("Inter Bold", 24 * -1)
)
canvas.create_text(
155.0,
149,
anchor="nw",
text="Task :",
fill="#FFFFFF",
font=("Inter Bold", 18 * -1)
)
canvas.create_text(
210.0,
149,
anchor="nw",
text="Open your hand",
fill="#FFA955",
font=("Inter Bold", 18 * -1)
)
canvas.create_text(
157.0,
175,
anchor="nw",
text="Focus on fully opening your hand",
fill="#FFFFFF",
font=("Inter Bold", 14 * -1)
)
#loading rectangle full
create_rounded_rectangle(
canvas,
155,
216,
549,
240,
r=20,
fill="#E5E7EB"
)
#loading rectangle left
create_rounded_rectangle(
canvas,
155,
216,
549,
240,
r=20,
fill="#EF4444"
)
canvas.create_text(
561,
219,
anchor="nw",
text="10 seconds left",
fill="#FFFFFF",
font=("Inter Bold", 16 * -1)
)
create_rounded_rectangle(
canvas,
795,
96,
978,
250,
r=10,
fill="#273443",
outline="#FFA955"
)
#close hand 1
open_hand_1_icon = PhotoImage(
file=relative_to_assets("a left hand fist 3d hand design illustration.png"))
open_hand_1 = Button(
image=open_hand_1_icon,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg="#273443"
)
open_hand_1.place(
x=834.00,
y=107.0
)
canvas.create_text(
160.0,
510.5,
anchor="nw",
text="5:00 minutes",
fill="#3BC6B5",
font=("Inter Bold", 24 * -1)
)
canvas.create_text(
156.0,
540.5,
anchor="nw",
text="Training Time",
fill="#FFFFFF",
font=("Inter Bold", 24 * -1)
)
#vertical line between durations
canvas.create_rectangle(
330.0,
505.5,
330.0,
575.5,
fill="",
outline="#FFFFFF")
canvas.create_text(
365,
510.5,
anchor="nw",
text="5:00 minutes",
fill="#3BC6B5",
font=("Inter Bold", 24 * -1)
)
canvas.create_text(
385.0,
540.5,
anchor="nw",
text="Time left",
fill="#FFFFFF",
font=("Inter Bold", 24 * -1)
)
#vertical line between durations
canvas.create_rectangle(
535.0,
505.5,
535.0,
575.5,
fill="",
outline="#E5E7EB")
#start session button rectangle
create_rounded_rectangle(
canvas,
570,
505.5,
973,
575.6,
r=10,
fill="#EF4444"
)
start_session_icon_1 = PhotoImage(
file=relative_to_assets("stop_session.png"))
start_session_1 = Button(
image=start_session_icon_1,
borderwidth=0,
highlightthickness=0,
# command=lambda: print("button_1 clicked"),
relief="flat",
bg="#EF4444"
)
start_session_1.place(
x=685.1,
y=525.5
)
canvas.create_text(
725.0,
525.5,
anchor="nw",
text="Stop Session",
fill="#FFFFFF",
font=("Inter Bold", 24 * -1)
)
window.resizable(False, False)
window.mainloop()