Note: I used alot of GPT for this!
![Screenshot 2024-06-24 at 6 15 10 PM](https://private-user-images.githubusercontent.com/96081835/342509576-bbf82170-636c-4c47-9d9d-d0e9ad169e34.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODAxMDksIm5iZiI6MTczOTE3OTgwOSwicGF0aCI6Ii85NjA4MTgzNS8zNDI1MDk1NzYtYmJmODIxNzAtNjM2Yy00YzQ3LTlkOWQtZDBlOWFkMTY5ZTM0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDA5MzAwOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWM0MThlOWRiZWM2NmRjZDg0YmZmMmE4YTEzZjFkOTE1ODNlN2IyZTA4NmE3NTJlYTk5NjU3OWQ2YjllZTA4NWYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.fyl2RvEKbpefy5EnLILhvctpXS6ITay2Z_qG-PaTdsM)
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.