How can I render different ejs pages according to screen width like we do in html using vanilla js with window.location method?