Opacityproperty, and when the value changes, apply a smooth transition from the old value to the new value over 2 seconds.
Transitionsas the target property and encapsulating them in a
Transitionsobject, like so:
Durationand an optional
Propertyrefers to a transition's target for listening and animating values upon.
Delayrefers to the amount of time before the transition is applied to the target.
Durationrefers to the amount of time that the transition plays.