Extract fold button animation code