A variation from W3 Schools demo: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_matchmedia
This code sets a global variable that can be used in a simple if statement
This carousel/slider is accessible following WCAG guidelines (https://www.w3.org/WAI/tutorials/carousels/structure/). The slider works with mobile device swipe events, and is built with plain JavaScript.