Compare commits
15 Commits
d7f32deadf
...
fitness
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
078f77b44b | ||
|
|
5bb2a18ae3 | ||
|
|
9ec0db852e | ||
|
|
86eb54bb5c | ||
|
|
5b0a62233e | ||
|
|
a68e12af2f | ||
|
|
d272e126ad | ||
|
|
d04ff5db02 | ||
|
|
9422a0c347 | ||
|
|
ae087de19f | ||
|
|
29021ee1e5 | ||
|
|
74fb21358e | ||
|
|
81faffc0a1 | ||
|
|
3df5fbf291 | ||
|
|
7983a28c7a |
@@ -114,6 +114,7 @@
|
|||||||
.header-menu__list li:first-child{
|
.header-menu__list li:first-child{
|
||||||
margin-left: 0;
|
margin-left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-menu__list a{
|
.header-menu__list a{
|
||||||
color: var(--text-white);
|
color: var(--text-white);
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
@@ -124,6 +125,72 @@
|
|||||||
background-image: url(/assets/img/icon/arrow-bottom.svg);
|
background-image: url(/assets/img/icon/arrow-bottom.svg);
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
background-position: center right;
|
background-position: center right;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub{
|
||||||
|
margin-top: 30px;
|
||||||
|
|
||||||
|
position: absolute;
|
||||||
|
|
||||||
|
width: 300px;
|
||||||
|
|
||||||
|
padding: 14px 0;
|
||||||
|
|
||||||
|
list-style-type: none;
|
||||||
|
background-color: var(--background-grey);
|
||||||
|
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
|
||||||
|
transition: all .3s;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub.open{
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub li{
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub li > a{
|
||||||
|
padding: 14px 24px;
|
||||||
|
|
||||||
|
transition: all .3s;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub > li:hover{
|
||||||
|
padding-right: 23px;
|
||||||
|
|
||||||
|
background-color: var(--background-grey-hover);
|
||||||
|
border-right: 1px solid var(--text-white);
|
||||||
|
}
|
||||||
|
.header-menu-list__sub > li > ul{
|
||||||
|
transition: all .3s;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub > li:hover > ul{
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub ul{
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 100%;
|
||||||
|
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
display: block;
|
||||||
|
|
||||||
|
background-color: var(--background-grey-hover);
|
||||||
|
list-style-type: none;
|
||||||
|
|
||||||
|
opacity: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
.header-menu-list__sub ul.open{
|
||||||
|
opacity: 1;
|
||||||
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
.header-menu__search{
|
.header-menu__search{
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -202,6 +269,11 @@
|
|||||||
|
|
||||||
background-color: var(--background-grey-hover);
|
background-color: var(--background-grey-hover);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
.header-menu-search__found.active{
|
||||||
|
display: block;
|
||||||
}
|
}
|
||||||
.header-menu-search__error{}
|
.header-menu-search__error{}
|
||||||
.header-menu-search__item{
|
.header-menu-search__item{
|
||||||
@@ -291,7 +363,12 @@
|
|||||||
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
.header-menu-list-next__content {
|
||||||
|
top: 72px;
|
||||||
|
}
|
||||||
|
.header-menu-search__block {
|
||||||
|
top: 78px;
|
||||||
|
}
|
||||||
/* header */
|
/* header */
|
||||||
.header__wrapper{
|
.header__wrapper{
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@@ -773,6 +850,26 @@
|
|||||||
|
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
.reviews-item__img-block{
|
||||||
|
margin-left: 164px;
|
||||||
|
|
||||||
|
width: 577px;
|
||||||
|
height: 600px;
|
||||||
|
border-radius: 4px;
|
||||||
|
|
||||||
|
object-fit: cover;
|
||||||
|
|
||||||
|
flex-shrink: 0;
|
||||||
|
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
.reviews .reviews-item__img-block .swiper-pagination{
|
||||||
|
bottom: 16px;
|
||||||
|
|
||||||
|
padding-right: 0px;
|
||||||
|
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.reviews .swiper-pagination{
|
.reviews .swiper-pagination{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 32px;
|
right: 32px;
|
||||||
|
|||||||
@@ -110,14 +110,14 @@
|
|||||||
height: 100vh;
|
height: 100vh;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.phone-menu__block-content{
|
/* .phone-menu__block-content{
|
||||||
height: 0;
|
height: 0;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
||||||
z-index: 10;
|
z-index: 10;
|
||||||
|
|
||||||
transition: all .5s;
|
transition: all .5s;
|
||||||
}
|
} */
|
||||||
.phone-menu__content{
|
.phone-menu__content{
|
||||||
padding: 104px 16px 40px 16px;
|
padding: 104px 16px 40px 16px;
|
||||||
|
|
||||||
@@ -127,20 +127,24 @@
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 100%;
|
left: 100%;
|
||||||
width: 100%;
|
|
||||||
transition: all .3s;
|
|
||||||
|
|
||||||
height: 100vh;
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
padding: 104px 16px 40px 16px;
|
||||||
|
|
||||||
background-color: var(--background-main);
|
background-color: var(--background-main);
|
||||||
}
|
|
||||||
.phone-menu__sub.active{
|
transition: all .5s;
|
||||||
left: 0;
|
|
||||||
|
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
.phone-menu__sub .title-1{
|
.phone-menu__sub.open{
|
||||||
margin-bottom: 32px;
|
left: 0;
|
||||||
|
}
|
||||||
|
.phone-menu__sub > li:nth-child(2) a{
|
||||||
|
font-weight: 700;
|
||||||
|
font-size: 32px;
|
||||||
}
|
}
|
||||||
.phone-menu-content__close{
|
.phone-menu-content__close{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@@ -213,9 +217,6 @@
|
|||||||
.phone-menu__text--no-line{
|
.phone-menu__text--no-line{
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
.phone-menu__sub .title-1{
|
|
||||||
text-transform: capitalize;
|
|
||||||
}
|
|
||||||
.phone-social{
|
.phone-social{
|
||||||
margin-top: 24px;
|
margin-top: 24px;
|
||||||
|
|
||||||
@@ -626,6 +627,9 @@ main{
|
|||||||
.form__checkbox-block{
|
.form__checkbox-block{
|
||||||
align-items: start;
|
align-items: start;
|
||||||
}
|
}
|
||||||
|
.free .title-1{
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* reviews */
|
/* reviews */
|
||||||
@@ -662,6 +666,26 @@ main{
|
|||||||
height: 300px;
|
height: 300px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
.reviews-item__img-block{
|
||||||
|
margin-top: 24px;
|
||||||
|
margin-left: 0;
|
||||||
|
|
||||||
|
height: 300px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.swiper-reviews-img{
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.reviews-item__img-block .swiper-slide{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
.reviews-item__img-block .swiper-slide img{
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
.reviews .swiper-pagination{
|
.reviews .swiper-pagination{
|
||||||
bottom: 87px;
|
bottom: 87px;
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ const gymSwiper = new Swiper('.gym-swiper', {
|
|||||||
|
|
||||||
const reviewsSwiper = new Swiper('.reviews-swiper', {
|
const reviewsSwiper = new Swiper('.reviews-swiper', {
|
||||||
spaceBetween: 24,
|
spaceBetween: 24,
|
||||||
|
allowTouchMove: false,
|
||||||
// If we need pagination
|
// If we need pagination
|
||||||
pagination: {
|
pagination: {
|
||||||
el: '.swiper-pagination',
|
el: '.swiper-pagination',
|
||||||
@@ -40,6 +41,25 @@ const reviewsSwiper = new Swiper('.reviews-swiper', {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
let swiperReviews = document.querySelectorAll('.swiper-reviews-img');
|
||||||
|
let reviewsSwiperImgs = {};
|
||||||
|
swiperReviews.forEach((review, index) => {
|
||||||
|
let newClass = `swiper-reviews-img-${index}`;
|
||||||
|
review.classList.add(newClass);
|
||||||
|
|
||||||
|
reviewsSwiperImgs[index] = new Swiper(`.${newClass}`, {
|
||||||
|
pagination: {
|
||||||
|
el: ".swiper-pagination",
|
||||||
|
clickable: true,
|
||||||
|
renderBullet: function (index, className) {
|
||||||
|
return '<span class="' + className + '">' + "</span>";
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const projectsSwiper = new Swiper('.projects-swiper', {
|
const projectsSwiper = new Swiper('.projects-swiper', {
|
||||||
direction: 'horizontal',
|
direction: 'horizontal',
|
||||||
breakpoints: {
|
breakpoints: {
|
||||||
@@ -48,7 +68,7 @@ const projectsSwiper = new Swiper('.projects-swiper', {
|
|||||||
spaceBetween: 24,
|
spaceBetween: 24,
|
||||||
},
|
},
|
||||||
996: {
|
996: {
|
||||||
slidesPerView: 1
|
slidesPerView: 10
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// Navigation arrows
|
// Navigation arrows
|
||||||
@@ -143,51 +163,58 @@ function howPhone() {
|
|||||||
// how end
|
// how end
|
||||||
|
|
||||||
// phone menu
|
// phone menu
|
||||||
|
addClosePhoneMenu('.phone-menu__content');
|
||||||
|
addClosePhoneMenu('.phone-menu__sub');
|
||||||
|
|
||||||
let btnOpenMenu = document.querySelector('.button-menu__open');
|
let btnOpenMenu = document.querySelector('.button-menu__open');
|
||||||
|
|
||||||
btnOpenMenu.onclick = function () {
|
btnOpenMenu.onclick = function () {
|
||||||
let phoneMenu = document.querySelector('.phone-menu'),
|
let block = document.querySelector('.phone-menu'),
|
||||||
block = document.querySelector('.phone-menu__block-content.main'),
|
content = document.querySelector('.phone-menu__content'),
|
||||||
content = document.querySelector('.phone-menu__content.main'),
|
contentHeight = content.offsetHeight + 'px';
|
||||||
newHeigh = content.offsetHeight + 'px';
|
|
||||||
|
|
||||||
phoneMenu.classList.add('active');
|
block.style.height = contentHeight;
|
||||||
// block.classList.add('active');
|
|
||||||
block.style.height = newHeigh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let closeMainMenu = document.querySelector('.phone-menu-content__close.main');
|
let closeMenu = document.querySelector('.phone-menu-content__close');
|
||||||
|
closeMenu.onclick = function () {
|
||||||
|
let block = document.querySelector('.phone-menu');
|
||||||
|
|
||||||
closeMainMenu.onclick = function () {
|
block.style.height = '0px';
|
||||||
let phoneMenu = document.querySelector('.phone-menu'),
|
|
||||||
block = document.querySelector('.phone-menu__block-content.main'),
|
|
||||||
content = document.querySelector('.phone-menu__content.main');
|
|
||||||
|
|
||||||
phoneMenu.classList.remove('active');
|
|
||||||
block.style.height = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let phoneList = document.querySelectorAll('.phone-menu__list');
|
||||||
|
phoneList.forEach(list => {
|
||||||
|
let elementList = list.querySelectorAll('li');
|
||||||
|
|
||||||
let nextPhoneMenu = document.querySelectorAll('.phone-menu--next');
|
elementList.forEach(element => {
|
||||||
|
let nextList = element.querySelector('.phone-menu__sub');
|
||||||
|
|
||||||
nextPhoneMenu.forEach(next => {
|
if (nextList) {
|
||||||
next.onclick = function () {
|
let button = element.querySelector('a');
|
||||||
let subName = next.dataset.menu,
|
|
||||||
blockSub = document.querySelector(`.phone-menu__sub.${subName}`);
|
button.onclick = function () {
|
||||||
|
nextList.classList.add('open')
|
||||||
|
}
|
||||||
|
|
||||||
|
nextList.querySelector('.phone-menu-content__close').onclick = function () {
|
||||||
|
nextList.classList.remove('open')
|
||||||
|
}
|
||||||
|
|
||||||
blockSub.classList.add('active');
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
let subPhone = document.querySelectorAll('.phone-menu__sub');
|
|
||||||
|
|
||||||
subPhone.forEach(menu => {
|
|
||||||
let close = menu.querySelector('.phone-menu-content__close');
|
|
||||||
|
|
||||||
close.onclick = function () {
|
|
||||||
menu.classList.remove('active');
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function addClosePhoneMenu(classAdd) {
|
||||||
|
document.querySelectorAll(classAdd).forEach(element => {
|
||||||
|
let button = document.createElement('button');
|
||||||
|
button.className = "phone-menu-content__close";
|
||||||
|
|
||||||
|
let referenceElement = element.firstElementChild;
|
||||||
|
|
||||||
|
element.insertBefore(button, referenceElement);
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
// phone menu end
|
// phone menu end
|
||||||
|
|
||||||
// search
|
// search
|
||||||
@@ -214,6 +241,92 @@ btnOpenSearchPhone.onclick = function () {
|
|||||||
searchPhone.classList.toggle('active');
|
searchPhone.classList.toggle('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// pc
|
||||||
|
let inputSearchPc = document.querySelector('.header-menu-search__input'),
|
||||||
|
btnSearchPc = document.querySelector('.header-menu-search__btn');
|
||||||
|
|
||||||
|
btnSearchPc.onclick = function () {
|
||||||
|
let value = inputSearchPc.value,
|
||||||
|
newPost = {
|
||||||
|
value: value,
|
||||||
|
};
|
||||||
|
|
||||||
|
postSearch(newPost, 'pc');
|
||||||
|
}
|
||||||
|
|
||||||
|
// phone
|
||||||
|
let inputSearchPhone = document.querySelector('.phone-search__input');
|
||||||
|
|
||||||
|
inputSearchPhone.addEventListener('input', function(event) {
|
||||||
|
let value = event.target.value,
|
||||||
|
newPost = {
|
||||||
|
value: value,
|
||||||
|
};
|
||||||
|
|
||||||
|
postSearch(newPost, 'phone');
|
||||||
|
});
|
||||||
|
|
||||||
|
function postSearch(newPost, device) {
|
||||||
|
let contentPc = document.querySelector('.header-menu-search__found'),
|
||||||
|
contentPhone = document.querySelector('.phone-search__found');
|
||||||
|
|
||||||
|
fetch('http://jsonplaceholder.typicode.com/posts', {
|
||||||
|
method: 'POST',
|
||||||
|
// body: JSON.stringify(newPost),
|
||||||
|
headers: {
|
||||||
|
'Content-type': 'application/json; charset=UTF-8',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.then((data) => {
|
||||||
|
if (device == 'pc') {
|
||||||
|
contentPc.innerHTML = '';
|
||||||
|
|
||||||
|
contentPc.innerHTML = `<div class="header-menu-search__item">
|
||||||
|
<img src="assets/img/photo/header-menu-search.png" alt="" class="header-menu-search-item__img">
|
||||||
|
|
||||||
|
<div class="header-menu-search-item__content">
|
||||||
|
<p class="text-2">Беговая дорожка механическая DRAXFIT+</p>
|
||||||
|
<p class="header-menu-search-item__art text-2">Артикул: STP1000C</p>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
contentPc.classList.add('active');
|
||||||
|
}else{
|
||||||
|
contentPhone.innerHTML = '';
|
||||||
|
|
||||||
|
contentPhone.innerHTML = `<div class="phone-search__item">
|
||||||
|
<img src="assets/img/photo/header-menu-search.png" alt="" class="phone-search-item__img">
|
||||||
|
|
||||||
|
<div class="phone-search-item__content">
|
||||||
|
<p class="text-2">Беговая дорожка механическая DRAXFIT+</p>
|
||||||
|
<p class="phone-search-item__art text-2">Артикул: STP1000C</p>
|
||||||
|
</div>
|
||||||
|
</div>`;
|
||||||
|
|
||||||
|
contentPhone.classList.add('active');
|
||||||
|
}
|
||||||
|
}).catch(
|
||||||
|
() => {
|
||||||
|
if (device == 'pc') {
|
||||||
|
postError(contentPc);
|
||||||
|
}else{
|
||||||
|
postError(contentPhone);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function postError(divContent) {
|
||||||
|
divContent.innerHTML = ''
|
||||||
|
|
||||||
|
let p = document.createElement("p");
|
||||||
|
p.textContent = "Произошла ошибка"
|
||||||
|
p.className = "header-menu-search__error text-2";
|
||||||
|
|
||||||
|
divContent.appendChild(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// search end
|
// search end
|
||||||
|
|
||||||
// open-modal
|
// open-modal
|
||||||
@@ -251,6 +364,79 @@ itemModels.forEach(item => {
|
|||||||
})
|
})
|
||||||
// open-modal end
|
// open-modal end
|
||||||
|
|
||||||
|
// masks
|
||||||
|
|
||||||
|
let phoneInputs = document.querySelectorAll('.input__field[type=phone]');
|
||||||
|
|
||||||
|
phoneInputs.forEach(phoneInput => {
|
||||||
|
phoneInput.onfocus = function (event) {
|
||||||
|
let value = phoneInput.value;
|
||||||
|
|
||||||
|
if (value.length == 0) {
|
||||||
|
phoneInput.value = '+7 '
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
phoneInput.addEventListener('input', function(event) {
|
||||||
|
let value = phoneInput.value,
|
||||||
|
data = event.data,
|
||||||
|
length = value.length;
|
||||||
|
|
||||||
|
if (value.charAt(0) == '+' && length == 1) return;
|
||||||
|
|
||||||
|
if (isNaN(data)) {
|
||||||
|
phoneInput.value = value.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof data != 'object') {
|
||||||
|
if (length == 2 || length == 6 || length == 10) {
|
||||||
|
phoneInput.value = value + ' ';
|
||||||
|
}
|
||||||
|
if (length == 3 || length == 7 || length == 11) {
|
||||||
|
if (data != ' ') {
|
||||||
|
phoneInput.value = value.slice(0, -1) + ' ' + data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (length <= 3) {
|
||||||
|
phoneInput.value = '+7 '
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
// masks end
|
||||||
|
|
||||||
|
// pc menu
|
||||||
|
|
||||||
|
let listMenu = document.querySelectorAll('.header-menu__list > li');
|
||||||
|
|
||||||
|
listMenu.forEach(li => {
|
||||||
|
if (li.querySelector('.header-menu-list__next')) {
|
||||||
|
let nextButton = li.querySelector('.header-menu-list__next'),
|
||||||
|
sub = li.querySelector('.header-menu-list__sub');
|
||||||
|
|
||||||
|
nextButton.addEventListener('mouseover', function (event) {
|
||||||
|
let openSubMenu = document.querySelector('.header-menu-list__sub.open');
|
||||||
|
|
||||||
|
if (openSubMenu) {
|
||||||
|
openSubMenu.classList.remove('open');
|
||||||
|
}
|
||||||
|
|
||||||
|
sub.classList.add('open');
|
||||||
|
})
|
||||||
|
|
||||||
|
sub.addEventListener('mouseout', function (event) {
|
||||||
|
if (event.relatedTarget.offsetParent.tagName != 'UL') {
|
||||||
|
sub.classList.remove('open');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
|
})
|
||||||
|
|
||||||
|
// pc menu end
|
||||||
|
|
||||||
// resize
|
// resize
|
||||||
window.addEventListener('resize', () => {
|
window.addEventListener('resize', () => {
|
||||||
let screenWidth = window.screen.width;
|
let screenWidth = window.screen.width;
|
||||||
|
|||||||
681
index.html
681
index.html
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user