Note: I used alot of GPT for this!
This project provides a simple and intuitive interface for creating draggable elements within a web page. Users can create new draggable elements by double-clicking anywhere on the page, and these elements can be nested within each other, allowing for a flexible and dynamic layout.
- Create Draggable Elements: Double-click anywhere on the page to create a new draggable element.
- Edit Text: Double-click on the text within a draggable element to edit it. The input box will seamlessly match the width of the draggable element.
- Drag and Drop: Click and hold on a draggable element to move it around the page. Release the mouse to drop it.
- Nest Elements: Draggable elements can be nested within each other, allowing for complex layouts.
- Auto-adjust Sizes: Parent and ancestor elements adjust their sizes automatically when new elements are added or text is edited.
open index.html
Double-click anywhere on the page to create a new draggable element at the mouse position. Each element is labeled with a unique identifier.
- Double-click on the text within a draggable element to start editing.
- An input box will appear, allowing you to modify the text.
- Press
Enter
or click outside the input box to finish editing and update the text.
- Click and hold on a draggable element to start dragging.
- Move the element to the desired position.
- Release the mouse button to drop the element.
- Drag a draggable element over another draggable element with a
.nest-area
class. - The dragged element will be nested within the target element.