I want to create a component called CarouselItem
which is functioning as an object within a carousel display, I want these items to have different opacities depending on how close to the middle of the carousel they are and fade to fully opaque when hovered over, to do this i need the CSS to be able to access a variable of the component state to see how opaque they should be before they are hovered. I read this other post on stackoverflow which talks about using an arrow function to create a style and use that in the react style but because i want to include keyframes I'm not sure how i would implement this. Any ideas on how to implment or other solutions that may work?
CSS used in fade in animation
.fade {
animation: fade-in-keyframes 2s;
}
@keyframes fade-in-keyframes {
from {opacity: 0}
to {opacity: 1}
}
(the from portion of the fade in keyframes section should use the variable from the react component instead of 0)