{fillArray(mockList, 10).map((el, index) => {
return (
<div className={`${css.eachBoard}`} key={index}>
<div
className={classNames({
['tsc_dash_eachOne']: true,
[css[pinStyleMap[index]]]: !!el,
[css.pinCenter]: !!el && !pinStyleMap[index],
})}
>
{el && renderBoardContent(el, index)}
</div>
</div>
);
})}
const elms = document.getElementsByClassName('tsc_dash_eachOne');
useEffect(() => {
for (let i = 0; i <= elms.length; i++) {
elms[i] &&
(elms[i].addEventListener('animationend', function (e) {
elms[i].classList.remove('rotateAnimate');
}),
elms[i].addEventListener('mouseover', function (e) {
elms[i].classList.add('rotateAnimate');
}));
}
}, [elms]);
.pinLeft {
width: 100%;
height: 100%;
background-image: url(../../assets/boardLeft.png);
background-size: 100% 100%;
transform-origin: calc(50% - 11px) 11px;
.list,
.title {
left: 30px;
}
}
.pinCenter {
width: 100%;
height: 100%;
background-image: url(../../assets/boardCenter.png);
background-size: 100% 100%;
transform-origin: calc(50%) 13px;
.list {
width: 65%;
}
}
.pinRight {
width: 100%;
height: 100%;
background-image: url(../../assets/boardRight.png);
background-size: 100% 100%;
transform-origin: calc(50% - -10px) 15px;
}
:global(.rotateAnimate) {
animation: myRotate 2s ease-in-out;
}
.rotateAnimate :global {
animation: myRotate 2s ease-in-out;
}
@keyframes myRotate {
0% {
transform: rotate(0deg);
}
20% {
transform: rotate(-20deg);
}
40% {
transform: rotate(15deg);
}
60% {
transform: rotate(-10deg);
}
80% {
transform: rotate(5deg);
}
100% {
transform: rotate(0);
}
}