Import detection and animation code.