added js media queries for conditional event handling