calc transition time if className changed