Moving the html/css version sort of works; when it goes vertical, the rotation angle jumps from negative 90deg to positive 90deg, so I have to see if I can put a condition on that to stop it.