JS: device resolution snippet