From c024b74f5bb4c25c47e4f277996c2dd60fedda3b Mon Sep 17 00:00:00 2001 From: ArtemB Date: Sun, 1 Oct 2023 13:36:35 +0300 Subject: [PATCH] 0.0.160 upd tab on main page --- static/css/styles.css | 73 ++++++++++++++++++++++++------------- static/js/user_profile.js | 30 +++++++++++++++ templates/pages/p_main.html | 39 +++++++++++++++++--- 3 files changed, 111 insertions(+), 31 deletions(-) diff --git a/static/css/styles.css b/static/css/styles.css index 5fd5a36..19afeec 100644 --- a/static/css/styles.css +++ b/static/css/styles.css @@ -439,7 +439,7 @@ footer>div { display: block; border-radius: 10px; background: #FF613A; - padding: 10px 20px; + padding: 10px 0px; color: #FFF; /* Body text 1 */ font-family: Inter; @@ -2087,15 +2087,9 @@ button#send_feedback_form{ text-align: center; } - .tabs>input[type="radio"] { - display: none; - } - - /*.tabs>div {*/ - /* !* скрыть контент по умолчанию *!*/ + /*.tabs>input[type="radio"] {*/ /* display: none;*/ - /* font-size: 16px;*/ - /*} */ + /*}*/ #content-1,#content-2 { @@ -2103,15 +2097,23 @@ button#send_feedback_form{ display: none; font-size: 16px; } - - /* отобразить контент, связанный с вабранной радиокнопкой (input type="radio") */ - #tab-btn-1:checked~#content-1, - #tab-btn-2:checked~#content-2 - { + #content-1.show,#content-2.show + { + /* скрыть контент по умолчанию */ display: block; } - .tabs>label { + + + /*!* отобразить контент, связанный с вабранной радиокнопкой (input type="radio") *!*/ + /*#tab-btn-1:checked~#content-1,*/ + /*#tab-btn-2:checked~#content-2*/ + /*{*/ + /* display: block;*/ + /*}*/ + + .tab-btn-1, + .tab-btn-2 { display: inline-block; text-align: center; vertical-align: middle; @@ -2125,7 +2127,26 @@ button#send_feedback_form{ top: 1px; padding: 10px; border-radius: 10px; - margin-bottom: 30px; + margin: 5px; + } + + .wrapper_tab_button { + background: white; + border-radius: 14px; + width: 27%; + margin: auto; +} + + .tab-btn-active{ + border-radius: 10px; + background: #FF613A; + color: white; + font-size: 16px; + font-style: normal; + font-weight: 500; + line-height: 22px; + padding: 10px; + } .tabs>div>#title_static{ font-size: 24px; @@ -2138,18 +2159,18 @@ button#send_feedback_form{ border-left: none; } - .tabs>input[type="radio"]:checked+label { + /*.tabs>input[type="radio"]:checked+label {*/ - border-radius: 10px; - background: #FF613A; - color: white; - font-size: 16px; - font-style: normal; - font-weight: 500; - line-height: 22px; - padding: 10px; + /* border-radius: 10px;*/ + /* background: #FF613A;*/ + /* color: white;*/ + /* font-size: 16px;*/ + /* font-style: normal;*/ + /* font-weight: 500;*/ + /* line-height: 22px;*/ + /* padding: 10px;*/ - } + /*}*/ /*tabs_on_main_page*/ diff --git a/static/js/user_profile.js b/static/js/user_profile.js index 3a53dc0..cc9e883 100644 --- a/static/js/user_profile.js +++ b/static/js/user_profile.js @@ -790,6 +790,36 @@ function counterText(evt) { } +function showTabBtn(el) { + + let mover_info = document.getElementById('content-1') + let customer_info = document.getElementById('content-2') + let tab_btn_1 = document.querySelector('.tab-btn-1') + let tab_btn_2 = document.querySelector('.tab-btn-2') + + if (el.classList.contains('tab-btn-1')){ + mover_info.classList.add('show') + customer_info.classList.remove('show') + + tab_btn_1.classList.add('tab-btn-active') + tab_btn_2.classList.remove('tab-btn-active') + + + } else if(el.classList.contains('tab-btn-2')){ + customer_info.classList.add('show') + mover_info.classList.remove('show') + + tab_btn_2.classList.add('tab-btn-active') + tab_btn_1.classList.remove('tab-btn-active') + + + + } + + +} + + diff --git a/templates/pages/p_main.html b/templates/pages/p_main.html index 072822d..31951bf 100644 --- a/templates/pages/p_main.html +++ b/templates/pages/p_main.html @@ -63,13 +63,35 @@
+
+
+ {% translate "Как отправить?" %} +
- - - - +
+ {% translate "Как перевезти?" %} +
-
+
+ + + + +{# #} +{# #} +{# #} +{# #} + + + + +

{% translate "Вам нужно отправить посылку быстро и недорого?" %}

@@ -175,6 +197,13 @@
+ + + + + + +