From a1438c170da1222786c7fe39e81bc48ddc1f19cd Mon Sep 17 00:00:00 2001 From: Krylov Sergey Date: Fri, 9 Apr 2021 21:35:22 +0500 Subject: [PATCH] refactor --- parts/about/about.php | 13 +- parts/certificates/items.php | 12 +- parts/certificates/text.php | 10 +- parts/contacts/contacts-header.php | 5 - parts/contacts/contacts-text.php | 2 +- parts/{home => }/discount.php | 17 +-- parts/form/form-content.php | 10 +- parts/gallery/gallery-content.php | 25 ---- parts/gallery/gallery-header.php | 4 - parts/holiday/description.php | 11 -- parts/holiday/packages.php | 5 +- parts/holiday/photos.php | 4 +- parts/home/entertaiment.php | 60 --------- parts/home/entertainment.php | 12 ++ parts/home/map-block.php | 19 --- parts/home/principals.php | 1 - parts/{home => }/order-modal.php | 0 parts/{home => }/order.php | 2 +- parts/{home => }/places.php | 2 +- parts/price/main.php | 23 +--- parts/quests/quests-list.php | 2 +- parts/quests/quests-slider.php | 49 ++++++++ parts/quests/single/slider.php | 5 +- php/wordpress/scripts.php | 4 +- src/js/pages/certificates.js | 16 ++- src/js/pages/gallery.js | 26 ++++ src/js/pages/price.js | 17 +++ src/js/pages/quests.js | 2 + src/sass/pages/about.scss | 6 +- src/sass/pages/contacts.scss | 14 +++ src/sass/pages/form.scss | 19 +++ src/sass/pages/holiday.scss | 2 +- src/sass/pages/home.scss | 2 +- src/sass/parts/discounts.scss | 1 + ...entertaiments.scss => entertainments.scss} | 0 src/sass/parts/map-block.scss | 119 ------------------ src/sass/parts/packages.scss | 4 +- src/sass/parts/places.scss | 1 + src/sass/parts/quests-slider.scss | 8 ++ templates/certificates.php | 16 ++- templates/contacts.php | 6 +- templates/form.php | 2 +- templates/gallery.php | 2 +- templates/graduation.php | 2 +- templates/holiday.php | 20 +-- templates/home.php | 8 +- templates/sales.php | 2 +- 47 files changed, 233 insertions(+), 359 deletions(-) delete mode 100644 parts/contacts/contacts-header.php rename parts/{home => }/discount.php (84%) delete mode 100644 parts/gallery/gallery-header.php delete mode 100644 parts/holiday/description.php delete mode 100644 parts/home/entertaiment.php create mode 100644 parts/home/entertainment.php delete mode 100644 parts/home/map-block.php rename parts/{home => }/order-modal.php (100%) rename parts/{home => }/order.php (95%) rename parts/{home => }/places.php (97%) create mode 100644 src/js/pages/gallery.js create mode 100644 src/js/pages/price.js rename src/sass/parts/{entertaiments.scss => entertainments.scss} (100%) delete mode 100644 src/sass/parts/map-block.scss diff --git a/parts/about/about.php b/parts/about/about.php index a022a01..df6db88 100644 --- a/parts/about/about.php +++ b/parts/about/about.php @@ -1,11 +1,11 @@ -
+

О нас

-
+

О нас

Отзывы

-
-
+
+
@@ -17,7 +17,7 @@
-
+
- +
diff --git a/parts/certificates/items.php b/parts/certificates/items.php index 4b004b1..abb100a 100644 --- a/parts/certificates/items.php +++ b/parts/certificates/items.php @@ -26,14 +26,4 @@ ?>
-
- - \ No newline at end of file +
\ No newline at end of file diff --git a/parts/certificates/text.php b/parts/certificates/text.php index c59ced8..a7c9458 100644 --- a/parts/certificates/text.php +++ b/parts/certificates/text.php @@ -10,12 +10,4 @@
- - - \ No newline at end of file + \ No newline at end of file diff --git a/parts/contacts/contacts-header.php b/parts/contacts/contacts-header.php deleted file mode 100644 index ffe3eb7..0000000 --- a/parts/contacts/contacts-header.php +++ /dev/null @@ -1,5 +0,0 @@ - \ No newline at end of file diff --git a/parts/contacts/contacts-text.php b/parts/contacts/contacts-text.php index b6af255..4dad8b7 100644 --- a/parts/contacts/contacts-text.php +++ b/parts/contacts/contacts-text.php @@ -7,7 +7,7 @@

Телефон:

-
+ diff --git a/parts/home/discount.php b/parts/discount.php similarity index 84% rename from parts/home/discount.php rename to parts/discount.php index 186481e..ccadc9b 100644 --- a/parts/home/discount.php +++ b/parts/discount.php @@ -1,7 +1,7 @@

Скидки и акции

@@ -40,6 +38,7 @@
+
@@ -47,7 +46,7 @@
\ No newline at end of file diff --git a/parts/form/form-content.php b/parts/form/form-content.php index 85fcb5e..0a2c6b8 100644 --- a/parts/form/form-content.php +++ b/parts/form/form-content.php @@ -87,13 +87,13 @@
- +
Квест - название

-
- +
+
Комната название
Описание комнаты
@@ -244,10 +244,10 @@

Химическое шоу - 3000 р.

-
+

ИТОГО 8280 р.

-
+

Организуем незабываемый праздник вместе !

diff --git a/parts/gallery/gallery-content.php b/parts/gallery/gallery-content.php index c66c2dd..aabbeda 100644 --- a/parts/gallery/gallery-content.php +++ b/parts/gallery/gallery-content.php @@ -18,30 +18,5 @@
\ No newline at end of file diff --git a/parts/gallery/gallery-header.php b/parts/gallery/gallery-header.php deleted file mode 100644 index e2e6a2d..0000000 --- a/parts/gallery/gallery-header.php +++ /dev/null @@ -1,4 +0,0 @@ - \ No newline at end of file diff --git a/parts/holiday/description.php b/parts/holiday/description.php deleted file mode 100644 index a89bbf9..0000000 --- a/parts/holiday/description.php +++ /dev/null @@ -1,11 +0,0 @@ -
-

Детские праздники в игровом центре Armanty

-
- post_content; - echo $content; - ?> -
- Читать далее -
diff --git a/parts/holiday/packages.php b/parts/holiday/packages.php index c3f9325..76a5d94 100644 --- a/parts/holiday/packages.php +++ b/parts/holiday/packages.php @@ -23,7 +23,10 @@

-

+

+ + +

предложение рассчитано до человек

diff --git a/parts/holiday/photos.php b/parts/holiday/photos.php index 3620b01..cbf7c95 100644 --- a/parts/holiday/photos.php +++ b/parts/holiday/photos.php @@ -1,8 +1,6 @@ \ No newline at end of file diff --git a/parts/home/entertaiment.php b/parts/home/entertaiment.php deleted file mode 100644 index 5dfb71a..0000000 --- a/parts/home/entertaiment.php +++ /dev/null @@ -1,60 +0,0 @@ -
-
-

Все развлечения

- -
-
diff --git a/parts/home/entertainment.php b/parts/home/entertainment.php new file mode 100644 index 0000000..6127a39 --- /dev/null +++ b/parts/home/entertainment.php @@ -0,0 +1,12 @@ +
+
+

Все развлечения

+ +
+
diff --git a/parts/home/map-block.php b/parts/home/map-block.php deleted file mode 100644 index 673d3a4..0000000 --- a/parts/home/map-block.php +++ /dev/null @@ -1,19 +0,0 @@ -
-
-

Как нас найти

-
-
-
-
    -
  • +7 (925) 720-56-54
  • -
  • г. Подольск, ул. Кл. Готвальда, 6В
  • -
  • Время работы игрового центра: Круглосуточно
  • -
-
-
-
-
\ No newline at end of file diff --git a/parts/home/principals.php b/parts/home/principals.php index 295e41d..dcada05 100644 --- a/parts/home/principals.php +++ b/parts/home/principals.php @@ -21,7 +21,6 @@ setup_postdata($post); ?> <?php the_title() ?> - diff --git a/parts/home/order-modal.php b/parts/order-modal.php similarity index 100% rename from parts/home/order-modal.php rename to parts/order-modal.php diff --git a/parts/home/order.php b/parts/order.php similarity index 95% rename from parts/home/order.php rename to parts/order.php index 66f2240..7d85532 100644 --- a/parts/home/order.php +++ b/parts/order.php @@ -16,4 +16,4 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/parts/home/places.php b/parts/places.php similarity index 97% rename from parts/home/places.php rename to parts/places.php index b80c152..1006cd1 100644 --- a/parts/home/places.php +++ b/parts/places.php @@ -24,7 +24,7 @@ foreach( $posts as $post ){ setup_postdata($post);?> -
+

diff --git a/parts/price/main.php b/parts/price/main.php index ecdd62a..8a01d9f 100644 --- a/parts/price/main.php +++ b/parts/price/main.php @@ -122,25 +122,4 @@
-
- - \ No newline at end of file +
\ No newline at end of file diff --git a/parts/quests/quests-list.php b/parts/quests/quests-list.php index 3c2b384..306b612 100644 --- a/parts/quests/quests-list.php +++ b/parts/quests/quests-list.php @@ -19,7 +19,7 @@ setup_postdata($post); ?> - - \ No newline at end of file +
\ No newline at end of file diff --git a/php/wordpress/scripts.php b/php/wordpress/scripts.php index cdcbd5e..457be1f 100644 --- a/php/wordpress/scripts.php +++ b/php/wordpress/scripts.php @@ -28,10 +28,12 @@ // Pages scripts if (is_page_template('templates/certificates.php')) wp_enqueue_style('armanty_certificates', $js . '/pages/certificates.js', ['jquery'], $version, true); if (is_page_template('templates/graduation.php')) wp_enqueue_script( 'aramnty_graduation', $js . '/pages/graduation.js', ['jquery'], $version, true); + if (is_page_template('templates/gallery.php')) wp_enqueue_script( 'aramnty_gallery', $js . '/pages/gallery.js', ['jquery'], $version, true); if (is_page_template('templates/form.php')) wp_enqueue_style('armanty_form', $js . '/pages/form.js', ['jquery'], $version, true); if (is_page_template('templates/holiday.php')) wp_enqueue_style('armanty_holiday', $js . '/pages/holiday.js', ['jquery'], $version, true); if (is_page_template('templates/quests.php')) wp_enqueue_style('armanty_quests', $js . '/pages/quests.js', ['jquery'], $version, true); if (is_page_template('templates/sales.php')) wp_enqueue_style('armanty_sales', $js . '/pages/sales.js', ['jquery'], $version, true); - + if (is_page_template('templates/price.php')) wp_enqueue_style('armanty_price', $js . '/pages/price.js', ['jquery'], $version, true); + }; ?> \ No newline at end of file diff --git a/src/js/pages/certificates.js b/src/js/pages/certificates.js index a3c374e..b5c8927 100644 --- a/src/js/pages/certificates.js +++ b/src/js/pages/certificates.js @@ -1,3 +1,17 @@ const holidayDescrBtn = document.querySelector('.holiday-descr a'); -holidayDescrBtn.innerHTML = ''; \ No newline at end of file +holidayDescrBtn.innerHTML = ''; + +const btns = document.querySelectorAll('.cert-items .btn') + +btns.forEach(btn => { + btn.addEventListener('click', () => { + document.querySelector('.callback-modal').style.display = 'block' + }) +}) + +const btn = document.querySelector('.cert-text__block .btn') + +btn.addEventListener('click', () => { + document.querySelector('.callback-modal').style.display = 'block' +}) \ No newline at end of file diff --git a/src/js/pages/gallery.js b/src/js/pages/gallery.js new file mode 100644 index 0000000..7ea3198 --- /dev/null +++ b/src/js/pages/gallery.js @@ -0,0 +1,26 @@ +const btns = document.querySelectorAll('.gallery-headers button'); +const galleryBlocks = document.querySelectorAll('.gallery-photos'); +btns[0].classList.add('active'); + +btns.forEach((btn, index) => { + btn.addEventListener('click', (e) => { + btns.forEach((btn, index) => { + btn.classList.remove('active') + }) + e.target.closest('button').classList.add('active'); + checkGal(index) + }) + + + }); +checkGal = index => { + galleryBlocks.forEach(currentItem => { + currentItem.style.display = 'none' + }); + if(btns[index].classList.contains('active')){ + galleryBlocks[index].style.display = 'flex'; + }else{ + galleryBlocks[index].style.display = 'none'; + } + } +checkGal(0) \ No newline at end of file diff --git a/src/js/pages/price.js b/src/js/pages/price.js new file mode 100644 index 0000000..72546cc --- /dev/null +++ b/src/js/pages/price.js @@ -0,0 +1,17 @@ + +const titles = document.querySelector('.prices_sections__titles') +const content = document.querySelectorAll('.prices_sections__content') +content[0].style.display = 'block'; +titles.querySelector('.prices_sections__title').classList.add('active'); +const clickHandler = (e) => { + const focusSection = e.target.closest('.prices_sections__title') + document.querySelectorAll('.prices_sections__title').forEach(title => title.classList.remove('active')); + content.forEach(section => { + section.dataset.priceSection == focusSection.dataset.priceSection + ? section.style.display = 'block' + : section.style.display = 'none' + }) + focusSection.classList.add('active') +} + +titles.addEventListener('click', clickHandler) \ No newline at end of file diff --git a/src/js/pages/quests.js b/src/js/pages/quests.js index dc3e630..2c62d78 100644 --- a/src/js/pages/quests.js +++ b/src/js/pages/quests.js @@ -27,3 +27,5 @@ if (compoundTurn) { } }) } + +document.querySelector('.carousel-item').classList.add('active'); diff --git a/src/sass/pages/about.scss b/src/sass/pages/about.scss index 29710ce..6460b23 100644 --- a/src/sass/pages/about.scss +++ b/src/sass/pages/about.scss @@ -11,7 +11,7 @@ letter-spacing: 0.5px; } - &-joki { + &-us { padding-top: 30px; font-family: 'PT Sans', sans-serif; @@ -152,7 +152,7 @@ @media screen and (max-width: 768px) { .about { - &-joki { + &-us { &__body-descr { p { max-width: 100% !important; @@ -164,7 +164,7 @@ @media screen and (max-width: 576px) { .about { - &-joki { + &-us { &__header { padding: 0 20px !important; } diff --git a/src/sass/pages/contacts.scss b/src/sass/pages/contacts.scss index b78a01d..0feddd2 100644 --- a/src/sass/pages/contacts.scss +++ b/src/sass/pages/contacts.scss @@ -88,6 +88,20 @@ .armanty_map_mobile { display: none; + width: 100%; + max-width: 1360px; + margin: 0 auto; +} + +.armanty_map_desktop { + width: 100%; + max-width: 1360px; + margin: 0 auto; +} + +.contacts_phones { + display: flex; + flex-direction: column; } @media screen and (max-width: 1200px) { diff --git a/src/sass/pages/form.scss b/src/sass/pages/form.scss index e2066a9..16e7ce2 100644 --- a/src/sass/pages/form.scss +++ b/src/sass/pages/form.scss @@ -182,6 +182,25 @@ } } +.guest-img { + img { + height: 250px; + } +} + +.room-img { + img { + height: 250px; + } +} + +.cheque-sum { + padding:5px 10px; +} +.cheque-info { + padding:5px 10px; +} + @media screen and (max-width: 1200px) { .guest-img { div { diff --git a/src/sass/pages/holiday.scss b/src/sass/pages/holiday.scss index f26edcb..776af5b 100644 --- a/src/sass/pages/holiday.scss +++ b/src/sass/pages/holiday.scss @@ -1,5 +1,5 @@ @import '../parts/adding-service'; -@import '../parts/entertaiments'; +@import '../parts/entertainments'; @import '../parts/places'; @import '../parts/order'; @import '../pages/gallery'; diff --git a/src/sass/pages/home.scss b/src/sass/pages/home.scss index 5c18586..e6deb2b 100644 --- a/src/sass/pages/home.scss +++ b/src/sass/pages/home.scss @@ -1,4 +1,4 @@ -@import '../parts/entertaiments'; +@import '../parts/entertainments'; @import '../parts/discounts'; @import '../parts/present'; @import '../parts/principals'; diff --git a/src/sass/parts/discounts.scss b/src/sass/parts/discounts.scss index 8e2ddde..ba3f19a 100644 --- a/src/sass/parts/discounts.scss +++ b/src/sass/parts/discounts.scss @@ -229,6 +229,7 @@ img { width: auto !important; max-width: 100%; + border-radius: 30px; } &-badge { diff --git a/src/sass/parts/entertaiments.scss b/src/sass/parts/entertainments.scss similarity index 100% rename from src/sass/parts/entertaiments.scss rename to src/sass/parts/entertainments.scss diff --git a/src/sass/parts/map-block.scss b/src/sass/parts/map-block.scss deleted file mode 100644 index 53bf270..0000000 --- a/src/sass/parts/map-block.scss +++ /dev/null @@ -1,119 +0,0 @@ -@import '../constansts'; - -.map-block { - padding-bottom: 20px; - font-family: 'PT Sans', sans-serif; - - &__home { - padding-bottom: 0; - } - - h2 { - color: #1e212b; - font-weight: 600; - font-size: 40px; - line-height: normal; - letter-spacing: 0.5px; - text-align: center; - } - - &-container { - display: flex; - flex-wrap: wrap; - align-items: flex-start; - justify-content: center; - max-width: 1440px !important; - margin-top: 50px; - } - - &__text { - ul { - list-style: none; - - li { - margin-bottom: 40px; - color: #363943; - font-weight: 600; - font-size: 24px; - letter-spacing: 0.3px; - - i { - margin-right: 25px; - color: $main-color; - font-size: 27px; - } - - a { - color: inherit; - text-decoration: none; - } - - span { - display: block; - color: $main-color; - text-transform: uppercase; - transform: translateX(100px); - } - } - } - } -} - - -@media screen and (max-width: 770px) { - .map-block { - &__yandex { - > ymaps { - max-height: 600px !important; - } - } - - &__text { - width: 100%; - - li { - font-size: 18px !important; - - i { - font-size: 18px !important; - } - } - } - } -} - -@media screen and (max-width: 480px) { - .map-block { - &__yandex { - > ymaps { - width: 100%; - max-width: 375px !important; - height: 400px !important; - } - } - - &__text { - padding-top: 20px; - - ul { - padding-inline-start: 0; - - li { - margin-bottom: 15px; - font-weight: 400; - font-size: 18px; - } - } - } - - &__layout { - padding-top: 25px; - } - } -} - -.map-block-in-home { - &::after { - background-color: #f2f2f2 !important; - } -} diff --git a/src/sass/parts/packages.scss b/src/sass/parts/packages.scss index 6e76b53..d088140 100644 --- a/src/sass/parts/packages.scss +++ b/src/sass/parts/packages.scss @@ -1,4 +1,6 @@ - +.package-currency { + font-size: 16px !important +} @media screen and (max-width: 576px) { diff --git a/src/sass/parts/places.scss b/src/sass/parts/places.scss index 76fa3c3..4343272 100644 --- a/src/sass/parts/places.scss +++ b/src/sass/parts/places.scss @@ -55,6 +55,7 @@ margin-right: auto; margin-left: auto; border-radius: 20px; + background-size: cover; &__layout { position: absolute; diff --git a/src/sass/parts/quests-slider.scss b/src/sass/parts/quests-slider.scss index 065e563..a869dcd 100644 --- a/src/sass/parts/quests-slider.scss +++ b/src/sass/parts/quests-slider.scss @@ -109,3 +109,11 @@ } } } + +.quests-content__item { + background-size: cover; +} + +quests-container__quest { + background-size: cover; +} \ No newline at end of file diff --git a/templates/certificates.php b/templates/certificates.php index 7e80e31..af355d4 100644 --- a/templates/certificates.php +++ b/templates/certificates.php @@ -6,7 +6,7 @@ @@ -14,20 +14,18 @@
- + -
+
+ diff --git a/templates/contacts.php b/templates/contacts.php index e06ea90..c73afae 100644 --- a/templates/contacts.php +++ b/templates/contacts.php @@ -7,14 +7,14 @@
-
+
-
+
diff --git a/templates/form.php b/templates/form.php index cb69c46..7413fd6 100644 --- a/templates/form.php +++ b/templates/form.php @@ -7,6 +7,6 @@ diff --git a/templates/gallery.php b/templates/gallery.php index a87d004..f6bf59d 100644 --- a/templates/gallery.php +++ b/templates/gallery.php @@ -6,7 +6,7 @@ \ No newline at end of file diff --git a/templates/graduation.php b/templates/graduation.php index 5194441..3d8e666 100644 --- a/templates/graduation.php +++ b/templates/graduation.php @@ -12,6 +12,6 @@ get_template_part('parts/landings/graduation/offers'); get_template_part('parts/landings/graduation/why'); get_template_part('parts/landings/graduation/callback'); - get_template_part('parts/home/order-modal'); + get_template_part('parts/order-modal'); get_template_part('parts/landings/graduation/footer'); ?> \ No newline at end of file diff --git a/templates/holiday.php b/templates/holiday.php index 7593218..51c23fc 100644 --- a/templates/holiday.php +++ b/templates/holiday.php @@ -7,18 +7,18 @@
- - +
diff --git a/templates/home.php b/templates/home.php index 06e23b0..f527cce 100644 --- a/templates/home.php +++ b/templates/home.php @@ -7,10 +7,10 @@