Skip to content

Commit 57267a8

Browse files
committed
first commit
0 parents  commit 57267a8

34 files changed

Lines changed: 11744 additions & 0 deletions

.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
3+
}

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
.yarn/install-state.gz
8+
9+
# testing
10+
/coverage
11+
12+
# next.js
13+
/.next/
14+
/out/
15+
16+
# production
17+
/build
18+
19+
# misc
20+
.DS_Store
21+
*.pem
22+
23+
# debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
.next
34+
35+
# environment variables
36+
.env
37+
38+
# typescript
39+
*.tsbuildinfo
40+
next-env.d.ts

Job-Assesment-Task.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Task Overview
2+
3+
Build an interactive Plate & Socket Generator interface that visually displays plates and socket groups on the left side of the screen (referred to as the canvas). The app must maintain realistic proportions between plates and sockets, support user input, and be responsive across different screen sizes including mobile.
4+
5+
Initial Plate Generation
6+
On load, generate a default plate with predefined dimensions.
7+
The plate must scale to fit the canvas while maintaining aspect ratio.
8+
If multiple plates exist, all must be scaled proportionally to each other.
9+
Use any visible color for plates that contrasts with the canvas background.
10+
11+
Dimension Representation and Scaling
12+
All sizes are defined in centimeters (cm).
13+
1 cm = 1 unit internally.
14+
The visual rendering is scaled proportionally to fit the canvas area.
15+
Example: A 20x20 cm plate and a 40x40 cm plate are rendered at 1:2 ratio.
16+
If one plate exists, it grows to fit. If many exist, all are scaled down to fit horizontally (based on size).
17+
18+
Canvas Behavior
19+
Plates are shown side by side horizontally in the canvas.
20+
The canvas resizes dynamically with the browser window.
21+
On resize, all plates and sockets are recalculated and re-rendered.
22+
The canvas is mobile-friendly and supports touch interaction.
23+
24+
Plate Management
25+
Users can input custom plate dimensions:
26+
Width: 20 to 300 cm
27+
Height: 30 to 128 cm
28+
Input is clamped to valid limits.
29+
When dimensions are updated, the plate is redrawn.
30+
Any sockets on the plate are removed on resize.
31+
Users can:
32+
Add new plates (no limit)
33+
Delete plates (minimum 1 plate must remain)
34+
35+
Socket Management
36+
A socket section can be toggled ON or OFF.
37+
When OFF, all socket groups are deleted.
38+
When ON, one default socket group is added to the first eligible plate.
39+
40+
Socket rules:
41+
Plates must be at least 40x40 cm to accept sockets.
42+
If plate is resized then its accompanying sockets are removed.
43+
Socket groups cannot be added to plates that don’t meet size requirements.
44+
45+
Socket Group Configuration
46+
47+
Each socket group includes:
48+
Plate selector: Changes the plate it is attached to (only if the plate is valid).
49+
Number selector: Choose 1 to 5 sockets in the group.
50+
Direction selector: Horizontal or Vertical.
51+
Position inputs: Distance from left and bottom (in cm).
52+
The anchor point is the bottom-left center of the first socket.
53+
54+
Socket Group Dimensions and Constraints
55+
Each socket is 7x7 cm.
56+
Gap between sockets is 0.2 cm.
57+
A horizontal group of 3 sockets = 21.4 cm wide.
58+
59+
Socket groups must be at least:
60+
3 cm from plate edges
61+
4 cm from other socket groups (refer to image on right for visual representation)
62+
Sockets cannot overlap or go outside the plate area.
63+
Socket groups cannot be dragged across plates (only one plate is shown in the canvas side when sockets are being edited, refer to design).
64+
65+
Socket Dragging and Feedback
66+
Sockets can be moved using drag or manual input.
67+
During dragging, show two guideline lines:
68+
From left edge to anchor point
69+
From bottom edge to anchor point
70+
Each line displays live cm values next to it (e.g. “23.4 cm”).
71+
During dragging, if the socket group is dragged to an invalid position then the drag event is blocked, the visual representation stays in the last valid position. As the system needs to communicate visually when a drag to position is invalid.
72+
After dragging:
73+
If the position is valid, keep the new position.
74+
If invalid, snap the socket back to its original position and show an error message.
75+
76+
Validation and Blocking Behavior
77+
If the user tries to move a socket group to an invalid plate, block the action and show a clear message.
78+
If the user enters an invalid position or overlaps another socket, block the action.
79+
If no valid plates exist to add a socket group, show an error and do not proceed.
80+
All blocked actions must provide clear visual feedback explaining the reason.
81+
82+
Summary of Constraints
83+
Plate width: 20–300 cm
Plate height: 30–128 cm
Min size for sockets: 40x40 cm
Socket size: 7x7 cm
Socket count per group: 1–5
Gap between sockets: 0.2 cm
Min distance from plate edge: 3 cm
Min distance from other socket groups: 4 cm
Plates must scale to fit canvas
Canvas is responsive and mobile-friendly
Socket positioning supports both drag and input
Guidelines show live distance from left and bottom edges during drag
All sockets and plates are validated before any change is applied
84+
85+
Socket image url:
86+
<https://cdn.shopify.com/s/files/1/0514/2511/6352/files/steckdose_1.png?v=1738943041>

0 commit comments

Comments
 (0)