Skip to main content

Drag and Drop

Big O

HTML + React JS / TS​

body {
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-color: #f0f0f0;
font-family: Arial, sans-serif;
}

.container {
display: flex;
gap: 50px;
}

.dropzone {
width: 150px;
height: 150px;
border: 2px dashed #aaa;
display: flex;
justify-content: center;
align-items: center;
background-color: #fff;
border-radius: 8px;
transition: background-color 0.3s;
}

.dropzone:hover {
background-color: #eaeaea;
}

.draggable {
width: 100px;
height: 100px;
background-color: #007bff;
color: white;
display: flex;
justify-content: center;
align-items: center;
border-radius: 8px;
cursor: pointer;
user-select: none;
transition: background-color 0.3s;
}

.draggable:active {
background-color: #0056b3;
}