try window and requestAnimation for server-side