const paragraphs = document.querySelectorAll('.advantages_grid p');
const addNotActiveClass = () => {
paragraphs.forEach(x => x.classList.add('not-active'))
}
const removeNotActiveClass = () => {
paragraphs.forEach(x => x.classList.remove('not-active'))
}
const calcWindow = () => {
if (window.innerWidth < 600) {
addNotActiveClass()
} else {
removeNotActiveClass()
}
}
document.addEventListener('DOMContentLoaded', () => {
calcWindow()
});
window.addEventListener("resize", (e) => {
calcWindow()
});
https://codepen.io/romkhram/pen/wvYWNwL