An Animated Block
by in CodeSOD on 2022-05-16"There are a few more functions like this in the same file," writes Jenny, about today's submission. This is one which largely does speak for itself.
const gright = () => {
setIscountright(isCountright + 1);
if(isCountright === 0) {
setIsleft(!isLeft);
setIsfirstdot(!isFirstdot);
setIssecdot(!isSecdot);
setInfof('Once activated buttons on the right panel will appear');
setIssquareleft(!isSquareleft);
setIsanimBottRightIn(!isAnimBottRightIn);
}
if(isCountright === 1) {
setIssecdot(!isSecdot);
setIsthirddot(!isThirdtdot);
setInfof('Tap on them to change content of the projection on the wall');
setIselmscale(!isElmscale);
setIssquareleft(!isSquareleft);
setIsmap(!isMap);
setIsmapdot(!isMapdot);
setIsborderwhite(!isBorderwhite);
}
if(isCountright === 2) {
setIsright(!isRight);
setIsthirddot(!isThirdtdot);
setIsfourthdot(!isForthdot);
setInfof('Use the menu bar in top left corner to switch between pages');
setIssquareleft(isSquareleft);
setIsanimBottRightIn(!isAnimBottRightIn);
setIselmscale(!isElmscale);
setIsmap(!isMap);
setIsmapdot(!isMapdot);
setIsborderwhite(!isBorderwhite);
setIsindicator(!isIndicator);
setTimeout(():void => {
setAnimain(false);
setMainsec(true);
setIsindicator(false);
setIsindicator2(true);
}, 1000);
setTimeout(():void => {
setMainsec(false);
setMainth(true);
setIsindicator2(false);
setIsindicator3(true);
setShowdone(true);
}, 2200);
}
}