implement the cursor animation