Don't use `clientWidth`/`clientHeight` unless you absolutely have to. Could you use `window` or fetch these values just once?