From a5e1095e2c3aa39ae992cf74baf7137291508244 Mon Sep 17 00:00:00 2001 From: Roman Pyrih Date: Fri, 20 Dec 2024 15:48:16 +0100 Subject: [PATCH] Fox calc --- wp-content/themes/ostal_WP/custom.scss | 1130 +++++++++++----------- wp-content/themes/ostal_WP/js/main.js | 48 +- wp-content/themes/ostal_WP/page-2101.php | 38 +- 3 files changed, 620 insertions(+), 596 deletions(-) diff --git a/wp-content/themes/ostal_WP/custom.scss b/wp-content/themes/ostal_WP/custom.scss index 9ce624f..0406eee 100644 --- a/wp-content/themes/ostal_WP/custom.scss +++ b/wp-content/themes/ostal_WP/custom.scss @@ -1,576 +1,576 @@ #app { - .section-header { - text-align: center; - margin-bottom: 60px; - - .title { - margin-bottom: 0; - margin-top: 0; - padding-top: 0 !important; - padding-bottom: 0 !important; - } - } - - .section-realizacje { - .recent-realizations-item { - width: 25%; - - >p { - background: rgba(86, 165, 61, 0.8); - } - - @media (min-width: 1536px) { - padding-bottom: 20rem; - } - - @media (max-width: 1000px) { - width: 50%; - margin: 0; - } - - @media (max-width: 640px) { - padding-bottom: 10rem; - } - } - } - - .section-contact { - display: grid; - grid-template-columns: 2fr 1fr; - - @media (max-width: 1300px) { - grid-template-columns: 1fr; - row-gap: 30px; - } - - .section-contact-texts { - display: grid; - grid-template-columns: auto 1fr; - - @media (max-width: 900px) { - grid-template-columns: 1fr; - } - - .section-contact-texts-img { - img { - width: 100%; - max-width: fit-content; - - @media (max-width: 900px) { - margin-left: auto; - margin-right: auto; - } - } - } - - .section-contact-texts-txt { - padding: 25px; - color: #1d293f; - font-size: 15px; - font-style: normal; - font-weight: 400; - line-height: 32px; - - @media (max-width: 900px) { - padding-left: 0; - padding-right: 0; - } - } - } - - .section-contact-form { - width: 100%; - max-width: 400px; - - @media (max-width: 1300px) { - max-width: unset; - } - - .section-contact-form-wrapper { - padding: 10px; - - h3 { - font-size: 21px; - font-style: normal; - font-weight: 400; - line-height: normal; - - strong { - font-weight: 700; - } - - @media (max-width: 1300px) { - text-align: center; - } - } - - form { - .wpforms-field { - padding: 7px 0; - border-color: #bcbcbc; - outline: none !important; - - input { - border-radius: 0; - color: #000; - font-size: 11px; - font-style: normal; - font-weight: 400; - line-height: normal; - - &::placeholder { - color: #000; - } - } - } - - .required-alert { - p { - color: #cd1f27; - font-size: 12px; - font-style: normal; - font-weight: 400; - line-height: normal; - margin-bottom: 0; - } - } - - .marketing { - input[type="checkbox"] { - &::before { - border-radius: 0; - } - } - - label { - font-size: 10px; - font-style: normal; - font-weight: 400; - line-height: normal; - } - } - - .wpforms-submit { - display: block; - margin-left: auto; - border-radius: 0; - background-color: #88b14b; - height: 49px; - padding: 0 30px; - color: #fff; - text-align: center; - font-size: 14px; - font-style: normal; - font-weight: 400; - line-height: normal; - } - } - } - } - } - - #calc-container { - .calc-bar-fix { - overflow: hidden; - padding: 20px 0; - - #progress-bar { - max-width: 1000px; - margin: 50px auto 30px auto; - - .progress-bar { - background: #ddd; - - .progress-bar-line { - background: #88b14b; - display: block; - height: 10px; - width: 0; - transition: all 250ms ease-in-out; - } - } - } - - #calc-bar { - display: flex; - flex-direction: row; - // width: 250%; - width: 350%; - margin-left: 0%; - transition: all 500ms ease-in-out; - // margin-left: -25%; - margin-left: -55%; - - @media (max-width: 1000px) { - width: 400%; - margin-left: 0%; - } - - .calc-s { - width: 100%; - max-width: 70%; - padding: 0 20px; - opacity: 0.2; - transition: all 500ms ease-in-out; - pointer-events: none; - - @media (max-width: 1000px) { - max-width: 100%; - - &.calc-placeholder { - display: none; - } - } - - &.active { - opacity: 1; - // transform: scale(1); - pointer-events: initial; - } - - &#calc-ch-1 { - .slide-data { - display: flex; - flex-direction: row; - row-gap: 20px; - - img { - width: 100%; - max-width: 200px; - height: fit-content; - } - - .calc-texts { - width: 100%; - } - - @media (max-width: 767px) { - flex-direction: column; - align-items: center; - } - } - } - - .calc-box { - position: relative; - padding: 25px 70px 65px 70px; - box-sizing: border-box; - height: 100%; - position: relative; - border: 2px solid #88b14b; - background: #fff; - - @media (max-width: 640px) { - padding: 25px 20px 65px 20px; - } - - &::before { - content: ""; - position: absolute; - width: 100%; - height: 100%; - opacity: 100%; - display: block; - z-index: -1; - - background-color: #88b14b; - clip-path: polygon(0% 0%, 97% 0, 100% 4%, 100% 100%, 0% 100%); - top: -12px; - left: inherit; - right: -12px; - } - - &--data { - ul.calc-radio { - list-style: none; - margin: 0; - - li { - display: flex; - flex-direction: row; - align-items: center; - column-gap: 1rem; - margin: 0; - width: 100%; - padding: 12.5px 0; - transition: 0.3s; - box-shadow: 1px 1px 0px rgba(0, 0, 0, 0); - cursor: pointer; - - &:hover { - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); - background-color: #eee; - } - - &.selected { - .radio { - &::before { - content: ""; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 8px; - height: 8px; - border-radius: 100%; - background: #88b14b; - } - } - } - - .radio { - position: relative; - width: 20px; - height: 20px; - background-color: #ddd; - border-radius: 50%; - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); - margin-left: 20px; - flex-shrink: 0; - } - - .radio-text { - .radio-title { - font-weight: 600; - font-size: 16px; - } - } - } - } - - ul.calc-texts { - list-style: none; - margin: 0; - - li { - margin-right: 1.75rem; - - &:not(:last-child) { - margin-bottom: 10px; - } - - p { - font-weight: 600; - font-size: 16px; - margin-bottom: 0; - } - - input.input { - background-color: #f7f7f7; - padding: 4px 10px; - border: 1px solid #eee; - width: 100%; - - &:focus { - outline: none; - } - } - - /********** Range Input Styles **********/ - /*Range Reset*/ - input[type="range"] { - -webkit-appearance: none; - appearance: none; - background: transparent; - cursor: pointer; - width: 100%; - } - - /* Removes default focus */ - input[type="range"]:focus { - outline: none; - } - - /***** Chrome, Safari, Opera and Edge Chromium styles *****/ - /* slider track */ - input[type="range"]::-webkit-slider-runnable-track { - background-color: #ddd; - border-radius: 0.5rem; - height: 0.5rem; - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); - } - - /* slider thumb */ - input[type="range"]::-webkit-slider-thumb { - -webkit-appearance: none; - /* Override default look */ - appearance: none; - margin-top: -6px; - /* Centers thumb on the track */ - border-radius: 4px; - /*custom styles*/ - background-color: #121e23; - border: 1px solid #fff; - height: 20px; - width: 10px; - } - - /******** Firefox styles ********/ - /* slider track */ - input[type="range"]::-moz-range-track { - background-color: #ddd; - border-radius: 0.5rem; - height: 0.5rem; - box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); - border-radius: 4px; - } - - /* slider thumb */ - input[type="range"]::-moz-range-thumb { - border: none; - /*Removes extra border that FF applies*/ - border-radius: 0px; - /*Removes default border-radius that FF applies*/ - - /*custom styles*/ - background-color: #121e23; - border: 1px solid #fff; - height: 20px; - width: 10px; - } - } - } - - .btn_send { - // color: #fff; - // padding: 5px 15px; - // background: #56a53d; - // font-size: 14px; - // display: block; - max-width: fit-content; - margin: 30px auto 0; - // outline: none; - // transition: all 250ms ease-in-out; - - &:disabled { - cursor: progress; - background: #cdcdcd; - } - } - } - - &--title { - position: relative; - display: block; - width: 100%; - max-width: fit-content; - margin: 0 auto 30px auto; - text-align: center; - padding-bottom: 8px; - - // &::before { - // content: ''; - // position: absolute; - // bottom: 0; - // left: 50%; - // height: 2px; - // width: calc(100% + 60px); - // background: #132473; - // transform: translateX(-50%); - // } - - h2 { - margin: 0; - padding: 0; - } - } - - .prev, - .next { - background: #88b14b; - top: 50%; - margin: -15px; - position: absolute; - transition: 0.3s; - cursor: pointer; - border-radius: 100%; - - &.disabled { - background: #ddd; - cursor: default; - } - - .svg-arrow { - margin: 0; - width: 48px; - height: 48px; - display: block; - padding: 7px; - top: 0; - - path { - transition: 0.3s; - } - } - - @media (max-width: 640px) { - top: 40px; - } - } - - .prev { - left: 25px; - - .svg-arrow { - transform: rotate(180deg); - } - } - - .next { - right: 25px; - } - } - } - } - } - } + .section-header { + text-align: center; + margin-bottom: 60px; + + .title { + margin-bottom: 0; + margin-top: 0; + padding-top: 0 !important; + padding-bottom: 0 !important; + } + } + + .section-realizacje { + .recent-realizations-item { + width: 25%; + + > p { + background: rgba(86, 165, 61, 0.8); + } + + @media (min-width: 1536px) { + padding-bottom: 20rem; + } + + @media (max-width: 1000px) { + width: 50%; + margin: 0; + } + + @media (max-width: 640px) { + padding-bottom: 10rem; + } + } + } + + .section-contact { + display: grid; + grid-template-columns: 2fr 1fr; + + @media (max-width: 1300px) { + grid-template-columns: 1fr; + row-gap: 30px; + } + + .section-contact-texts { + display: grid; + grid-template-columns: auto 1fr; + + @media (max-width: 900px) { + grid-template-columns: 1fr; + } + + .section-contact-texts-img { + img { + width: 100%; + max-width: fit-content; + + @media (max-width: 900px) { + margin-left: auto; + margin-right: auto; + } + } + } + + .section-contact-texts-txt { + padding: 25px; + color: #1d293f; + font-size: 15px; + font-style: normal; + font-weight: 400; + line-height: 32px; + + @media (max-width: 900px) { + padding-left: 0; + padding-right: 0; + } + } + } + + .section-contact-form { + width: 100%; + max-width: 400px; + + @media (max-width: 1300px) { + max-width: unset; + } + + .section-contact-form-wrapper { + padding: 10px; + + h3 { + font-size: 21px; + font-style: normal; + font-weight: 400; + line-height: normal; + + strong { + font-weight: 700; + } + + @media (max-width: 1300px) { + text-align: center; + } + } + + form { + .wpforms-field { + padding: 7px 0; + border-color: #bcbcbc; + outline: none !important; + + input { + border-radius: 0; + color: #000; + font-size: 11px; + font-style: normal; + font-weight: 400; + line-height: normal; + + &::placeholder { + color: #000; + } + } + } + + .required-alert { + p { + color: #cd1f27; + font-size: 12px; + font-style: normal; + font-weight: 400; + line-height: normal; + margin-bottom: 0; + } + } + + .marketing { + input[type='checkbox'] { + &::before { + border-radius: 0; + } + } + + label { + font-size: 10px; + font-style: normal; + font-weight: 400; + line-height: normal; + } + } + + .wpforms-submit { + display: block; + margin-left: auto; + border-radius: 0; + background-color: #88b14b; + height: 49px; + padding: 0 30px; + color: #fff; + text-align: center; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; + } + } + } + } + } + + #calc-container { + .calc-bar-fix { + overflow: hidden; + padding: 20px 0; + + #progress-bar { + max-width: 1000px; + margin: 50px auto 30px auto; + + .progress-bar { + background: #ddd; + + .progress-bar-line { + background: #88b14b; + display: block; + height: 10px; + width: 0; + transition: all 250ms ease-in-out; + } + } + } + + #calc-bar { + display: flex; + flex-direction: row; + // width: 250%; + width: 350%; + margin-left: 0%; + transition: all 500ms ease-in-out; + // margin-left: -25%; + margin-left: -55%; + + @media (max-width: 1000px) { + width: 400%; + margin-left: 0%; + } + + .calc-s { + width: 100%; + max-width: 70%; + padding: 0 20px; + opacity: 0.2; + transition: all 500ms ease-in-out; + pointer-events: none; + + @media (max-width: 1000px) { + max-width: 100%; + + &.calc-placeholder { + display: none; + } + } + + &.active { + opacity: 1; + // transform: scale(1); + pointer-events: initial; + } + + &#calc-ch-1 { + .slide-data { + display: flex; + flex-direction: row; + row-gap: 20px; + + img { + width: 100%; + max-width: 200px; + height: fit-content; + } + + .calc-texts { + width: 100%; + } + + @media (max-width: 767px) { + flex-direction: column; + align-items: center; + } + } + } + + .calc-box { + position: relative; + padding: 25px 70px 65px 70px; + box-sizing: border-box; + height: 100%; + position: relative; + border: 2px solid #88b14b; + background: #fff; + + @media (max-width: 640px) { + padding: 25px 20px 65px 20px; + } + + &::before { + content: ''; + position: absolute; + width: 100%; + height: 100%; + opacity: 100%; + display: block; + z-index: -1; + + background-color: #88b14b; + clip-path: polygon(0% 0%, 97% 0, 100% 4%, 100% 100%, 0% 100%); + top: -12px; + left: inherit; + right: -12px; + } + + &--data { + ul.calc-radio { + list-style: none; + margin: 0; + + li { + display: flex; + flex-direction: row; + align-items: center; + column-gap: 1rem; + margin: 0; + width: 100%; + padding: 12.5px 0; + transition: 0.3s; + box-shadow: 1px 1px 0px rgba(0, 0, 0, 0); + cursor: pointer; + + &:hover { + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); + background-color: #eee; + } + + &.selected { + .radio { + &::before { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 8px; + height: 8px; + border-radius: 100%; + background: #88b14b; + } + } + } + + .radio { + position: relative; + width: 20px; + height: 20px; + background-color: #ddd; + border-radius: 50%; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); + margin-left: 20px; + flex-shrink: 0; + } + + .radio-text { + .radio-title { + font-weight: 600; + font-size: 16px; + } + } + } + } + + ul.calc-texts { + list-style: none; + margin: 0; + + li { + margin-right: 1.75rem; + + &:not(:last-child) { + margin-bottom: 10px; + } + + p { + font-weight: 600; + font-size: 16px; + margin-bottom: 0; + } + + input.input { + background-color: #f7f7f7; + padding: 4px 10px; + border: 1px solid #eee; + width: 100%; + + &:focus { + outline: none; + } + } + + /********** Range Input Styles **********/ + /*Range Reset*/ + input[type='range'] { + -webkit-appearance: none; + appearance: none; + background: transparent; + cursor: pointer; + width: 100%; + } + + /* Removes default focus */ + input[type='range']:focus { + outline: none; + } + + /***** Chrome, Safari, Opera and Edge Chromium styles *****/ + /* slider track */ + input[type='range']::-webkit-slider-runnable-track { + background-color: #ddd; + border-radius: 0.5rem; + height: 0.5rem; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); + } + + /* slider thumb */ + input[type='range']::-webkit-slider-thumb { + -webkit-appearance: none; + /* Override default look */ + appearance: none; + margin-top: -6px; + /* Centers thumb on the track */ + border-radius: 4px; + /*custom styles*/ + background-color: #121e23; + border: 1px solid #fff; + height: 20px; + width: 10px; + } + + /******** Firefox styles ********/ + /* slider track */ + input[type='range']::-moz-range-track { + background-color: #ddd; + border-radius: 0.5rem; + height: 0.5rem; + box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5); + border-radius: 4px; + } + + /* slider thumb */ + input[type='range']::-moz-range-thumb { + border: none; + /*Removes extra border that FF applies*/ + border-radius: 0px; + /*Removes default border-radius that FF applies*/ + + /*custom styles*/ + background-color: #121e23; + border: 1px solid #fff; + height: 20px; + width: 10px; + } + } + } + + .btn_send { + // color: #fff; + // padding: 5px 15px; + // background: #56a53d; + // font-size: 14px; + // display: block; + max-width: fit-content; + margin: 30px auto 0; + // outline: none; + // transition: all 250ms ease-in-out; + + &:disabled { + cursor: progress; + background: #cdcdcd; + } + } + } + + &--title { + position: relative; + display: block; + width: 100%; + max-width: fit-content; + margin: 0 auto 30px auto; + text-align: center; + padding-bottom: 8px; + + // &::before { + // content: ''; + // position: absolute; + // bottom: 0; + // left: 50%; + // height: 2px; + // width: calc(100% + 60px); + // background: #132473; + // transform: translateX(-50%); + // } + + h2 { + margin: 0; + padding: 0; + } + } + + .prev, + .next { + background: #88b14b; + top: 50%; + margin: -15px; + position: absolute; + transition: 0.3s; + cursor: pointer; + border-radius: 100%; + + &.disabled { + background: #ddd; + cursor: default; + } + + .svg-arrow { + margin: 0; + width: 48px; + height: 48px; + display: block; + padding: 7px; + top: 0; + + path { + transition: 0.3s; + } + } + + @media (max-width: 640px) { + top: 40px; + } + } + + .prev { + left: 25px; + + .svg-arrow { + transform: rotate(180deg); + } + } + + .next { + right: 25px; + } + } + } + } + } + } } #configurator_sended { - padding: 40px 70px; - box-sizing: border-box; - height: 100%; - position: relative; - border: 2px solid #88b14b; - width: 100%; - max-width: 700px; - margin: 50px auto; - background: #fff; + padding: 40px 70px; + box-sizing: border-box; + height: 100%; + position: relative; + border: 2px solid #88b14b; + width: 100%; + max-width: 700px; + margin: 50px auto; + background: #fff; - &::before { - content: ""; - position: absolute; - width: 100%; - height: 100%; - opacity: 100%; - display: block; - z-index: -1; + &::before { + content: ''; + position: absolute; + width: 100%; + height: 100%; + opacity: 100%; + display: block; + z-index: -1; - background-color: #88b14b; - clip-path: polygon(0% 0%, 98% 0, 100% 4%, 100% 100%, 0% 100%); - top: -12px; - left: inherit; - right: -12px; - } + background-color: #88b14b; + clip-path: polygon(0% 0%, 98% 0, 100% 4%, 100% 100%, 0% 100%); + top: -12px; + left: inherit; + right: -12px; + } - h2 { - position: relative; - display: block; - width: 100%; - max-width: fit-content; - margin: 0 auto 50px auto; - text-align: center; - padding-bottom: 8px; - } + h2 { + position: relative; + display: block; + width: 100%; + max-width: fit-content; + margin: 0 auto 50px auto; + text-align: center; + padding-bottom: 8px; + } - .configurator_sended_text { - text-align: center; - } + .configurator_sended_text { + text-align: center; + } } .step-info { - display: block; - font-size: 14px; - margin-left: 39px; - margin-top: 20px; -} \ No newline at end of file + display: block; + font-size: 14px; + margin-left: 39px; + margin-top: 20px; +} diff --git a/wp-content/themes/ostal_WP/js/main.js b/wp-content/themes/ostal_WP/js/main.js index bd37e97..1c8726b 100644 --- a/wp-content/themes/ostal_WP/js/main.js +++ b/wp-content/themes/ostal_WP/js/main.js @@ -20,34 +20,34 @@ function enableScroll() { //Gallery lightbox document.addEventListener("DOMContentLoaded", () => { // ===> DOM elements <=== // - const $imagesContainer = document.getElementById('gallery-lightbox'); const $lightbox = document.getElementById('lightbox'); - // ===> Event listeners and triggers <=== // + if ($imagesContainer && $lightbox) { + // ===> Event listeners and triggers <=== // - // Show lightbox - $imagesContainer.addEventListener('click', e => { - const imageWrapper = e.target.closest('.gallery-image'); - if (imageWrapper) { - const image = imageWrapper.querySelector('img'); - if (image) { - $lightbox.innerHTML = '
' + image.outerHTML; - $lightbox.classList.add('show'); + // Show lightbox + $imagesContainer.addEventListener('click', e => { + const imageWrapper = e.target.closest('.gallery-image'); + if (imageWrapper) { + const image = imageWrapper.querySelector('img'); + if (image) { + $lightbox.innerHTML = '
' + image.outerHTML; + $lightbox.classList.add('show'); + } } - } - }); + }); - // Hide Lightbox - $lightbox.addEventListener('click', (e) => { - if (!e.target.hasAttribute('src')) { - $lightbox.classList.remove('show'); - } - }); + // Hide Lightbox + $lightbox.addEventListener('click', (e) => { + if (!e.target.hasAttribute('src')) { + $lightbox.classList.remove('show'); + } + }); - // Loading... - setTimeout(() => - $imagesContainer.classList.remove('loading') - , 1500); - -}); \ No newline at end of file + // Loading... + setTimeout(() => { + $imagesContainer.classList.remove('loading'); + }, 1500); + } +}); diff --git a/wp-content/themes/ostal_WP/page-2101.php b/wp-content/themes/ostal_WP/page-2101.php index 29563e4..ca56c1e 100644 --- a/wp-content/themes/ostal_WP/page-2101.php +++ b/wp-content/themes/ostal_WP/page-2101.php @@ -130,7 +130,7 @@

Krok 3