This seems to encourage the sort of thing CSS Media Queries are exactly made to prevent: trying to detect the device and make some special case code for that, instead of thinking about what is possible given the capabilities.
It's also broken.
The iPad queries should incorrectly trigger on some Android devices, the "SmartPhone" category will be outdated soon. And it fails to detect my desktop.