Adding transition to the h1 and span elements