add requestanimationframe snippet