<meta name="viewport" content="width=device-width, initial-scale=1.0">
const urls = [
'/page/profile',
'/page/article/123123',
'/page/article/new',
'/page/article',
'/page/some/nested/structure/here',
'/page/module/article/new'
];
for (const url of urls ) {
const expression = /^\/page\/(.*)?(article)(.*)?$/g;
console.log(url, expression.test(url));
}
/*
'/page/profile' false
'/page/article/123123' true
'/page/article/new' true
'/page/article' true
'/page/some/nested/structure/here' false
'/page/module/article/new' true
*/
const accordions = document.querySelectorAll('.accordion__card');
for (const accordion of accordions) {
const title = accordion.querySelector('.accordion__card__title');
const text = accordion.querySelector('.accordion__card__text');
title.addEventListener('click', () => {
if (text.classList.contains('accordion__card__text--active')) {
text.classList.remove('accordion__card__text--active');
} else {
for (const accordion of accordions) {
const text = accordion.querySelector('.accordion__card__text');
text.classList.remove('accordion__card__text--active');
}
text.classList.add('accordion__card__text--active');
}
});
}
useObserver
- будет пересчитывать увеличение автоматически. (now / total) * 100
:function calculatePercent(value, max) {
return (value / max) * 100;
}
min-height: 100vh;
поможет.main
, зато есть section
(имеется ввиду, что надо было использовать main
);tabindex
).cursor: hand;
не существует;required
содержит значение required
;rel="noopener"
или rel="noreferrer"
;