implementation of sleep animation