Skip to content

Instantly share code, notes, and snippets.

View newdecline's full-sized avatar
🏠
Working from home

Andrey Ivanov newdecline

🏠
Working from home
View GitHub Profile
<div class="tab-wrapper">
<div class="tabs-header">
<div class="tab-header tab-header_show">Header 1</div>
<!-- /.tab-header -->
<div class="tab-header">Header 2</div>
<!-- /.tab-header -->
<div class="tab-header">Header 3</div>
<!-- /.tab-header -->
</div>
<!-- /.tabs-header -->
export const fetchApi = async (url, init = {}) => {
const result = await fetch(`${baseUrl}${url}`,{...init});
if (!result.ok) {
throw new Error(`Ошибка при запросе ${url}, код ${result.status}`);
}
return await result.json();
};
if (process.browser && window.innerWidth >= 1366) {
_slidesToShow = 3;
} else if (process.browser && window.innerWidth >= 1024) {
_slidesToShow = 2;
} else if (process.browser && window.innerWidth >= 320) {
_slidesToShow = 1;
}
events.length !== 0 && <div
className={events.length <= _slidesToShow
@newdecline
newdecline / GallerySlider.js
Created November 28, 2019 06:25
Mediaquerys in JS
window.matchMedia( "(min-width: 1366px)" ).matches