Let me explain you the scenario,
I am trying to add animations to DIVS,
All the 3 DIVs has to be centered,
Kindly help me with this, struggling with this for so many days. Thanks in Advance. Refer this image for better understanding!
you can try something like this: https://codepen.io/MSanbira/pen/wvmKqNe
CSS section:
.div-section {
position: relative;
--total: 3;
}
.div-section > div {
--size: 200px;
--gap: 24px;
position: absolute;
top: 0;
left: calc(
50% - var(--size) / 2 -
(var(--num-selected) - var(--place) * 2 + 1) * (var(--size) / 2 + var(--gap) / 2)
);
height: var(--size);
width: var(--size);
background: pink;
display: flex;
align-items: center;
justify-content: center;
transition: 1s;
}
.div-section > div:not([data-selected="true"]) {
top: 250px;
left: calc(
50% - var(--size) / 2 -
(var(--total) - var(--place) * 2 + 1) * var(--size) / 4
);
opacity: 0;
}
I have been using WOW js with HTML but haven't explored it on React
Try wow js https://www.npmjs.com/package/react-wow