fix(animate): handle empty durations
feat(): add custom  function