JSFiddle - React, Tailwind, and code Playground
by HDL52
HTML
<div id="container">
<article class="item">
<img class="avatar" src="https://raw.githubusercontent.com/Hongda-OSU/PicGo-2.3.1/master/img735yqkuspzfqxatav0t55gipvv1zzh2.jpg" />
</article>
<article class="item">
<img class="avatar" src="https://raw.githubusercontent.com/Hongda-OSU/PicGo-2.3.1/master/img1l99wbel5ip2y1oivo40zrh051humxd.png" />
</article>
<article class="item">
<img class="avatar" src="https://raw.githubusercontent.com/Hongda-OSU/PicGo-2.3.1/master/img%E5%85%8B%E9%B2%81%E8%B5%9B%E5%BE%B7%E6%88%98%E8%AE%B03.jpg" />
</article>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Sortable/1.15.0/Sortable.min.js"></script>
SCSS
:root {
--background: #EDEEF7;
--gray: #EDEEF7;
--white: #ffffff;
--poppins: 'Poppins', sans-serif;
--shadow-opacity: 0.30;
--blur: 10px;
}
body {
font-family: var(--poppins), sans-serif;
font-size: 1rem;
// background: var(--background);
background-image: url('https://raw.githubusercontent.com/Hongda-OSU/PicGo-2.3.1/master/imgassadsd.avif');
background-position: center center;
background-size: cover;
display: flex;
width: 100vw;
height: 100vh;
}
*,
*:before,
*:after {
margin: 0;
padding: 0;
box-sizing: border-box;
outline: none;
}
#container {
display: flex;
flex-direction: column;
gap: 16px;
width: 100%;
max-width: 550px;
margin: auto;
padding: 50px;
background: rgba(255, 255, 255, 0.25);
// box-shadow: 0 8px 32px 0 rgba( 31, 38, 135, 0.37 );
backdrop-filter: blur(var(--blur));
border-radius: 10px;
border: 1px solid rgba(white, 0.08);
// filter: blur(var(--blur));
// border-radius: 32px;
filter: drop-shadow(0px 20px 10px rgba(0, 0, 0, var(--shadow-opacity)));
}
.item {
position: relative;
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 16px;
min-height: 60px;
padding: 16px;
background-color: var(--white);
border-radius: 24px;
// box-shadow: 0x 6px 24px 0px rgba(0, 0, 0, 0.5);
font-size: 16px;
z-index: 1;
&:hover {
cursor: grab;
}
&-chosen {
box-shadow: 8px 8px 32px rgba(black, 0.3);
}
&-drag {
opacity: 0;
}
}
.avatar{
width: 3.75rem;
height: 3.75rem;
object-fit: cover;
border-radius: 50%;
}
JavaScript
const dragAndDropItems = document.getElementById('container');
new Sortable(dragAndDropItems, {
animation: 350,
chosenClass: 'team-member-chosen',
dragClass: 'team-member-drag'
});