write an html code to let the user import an image (packaging design of a box with 6 faces)
the user will select the 6 faces (rectangles) manually from the design image that just imported
the UI:
A canvas to show and handle the image that take the full page size
A button to import an image
Use middle mouse button for dragging. Use the mouse wheel to zoom in/out, focusing on the cursor position
let the user select multiple parts from the image (show the selection as rectangles)
make the selection rectangle stick in the image (zoom and move with the image).
label the rectangles by showing face_name on the centre of each rectangle.
The selections will stick to the image when zooming or moving.
a list of elements:
--- every element contain aliened sub-elements like so [{mark_thet_this_face_is_added} : {face_name} : [botton_add_face] [button_delet_face] [button_edit_face(this botton show the handels for modification)]]
--- the 6 faces is front, back, right, left, top and bottom.
--- this list let the user add and delete or edit (move or resize) the selection rectangles.
after clicking on edit face button show/hide 4 handles in the corners of the rectangle an 4 in the edge of the rectangle that was created for selection to let the user modify the size and emplacements the selection rectangle.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Sure! Below is an HTML code that fulfills your requirements. We've used the Fabric.js library to handle the canvas interactions, such as zooming, panning, and object manipulation.