Conditional Format to highlight every other row on a sheet that adapts when filtered

Use SUBTOTAL to count the number of visible rows on a variable range:

=AND(ISEVEN(SUBTOTAL(3,$A$1:$A1)),$A1<>"")

enter image description here

enter image description here