showroom list v1

This commit is contained in:
Roman Pyrih
2025-12-02 14:30:30 +01:00
parent 4ce0f47260
commit a6a6534d3b
4 changed files with 506 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -6,6 +6,11 @@ html {
scroll-padding-top: 105px; scroll-padding-top: 105px;
} }
body {
&.fixed {
overflow: hidden;
}
}
p { p {
&:last-child { &:last-child {
margin-bottom: 0; margin-bottom: 0;
@@ -521,6 +526,250 @@ strong {
.box-4 { .box-4 {
padding-top: 115px; padding-top: 115px;
padding-bottom: 115px; padding-bottom: 115px;
.box-4--wrapper {
#box-showrooms {
display: flex;
flex-direction: row;
column-gap: 70px;
nav#showrooms-nav {
margin-top: 105px;
min-width: 240px;
ul {
display: flex;
flex-direction: column;
padding: 0;
margin: 0;
list-style: none;
row-gap: 7px;
li {
&.active {
input {
font-weight: 700;
text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.14);
}
}
input {
color: #1d1d1e;
font-family: $font3;
font-weight: 300;
font-size: 18px;
line-height: 1;
text-align: center;
text-transform: uppercase;
border: none;
border-radius: 0;
background: transparent;
cursor: pointer;
}
}
}
}
#showrooms-lists {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 50px;
width: 100%;
.showrooms-list {
&-1 {
.showrooms-list-title {
background: #1e2832;
h3 {
color: #fff;
}
}
}
&-2 {
.showrooms-list-title {
h3 {
color: #3f3f3f;
}
}
}
.showrooms-list-title {
display: block;
width: 100%;
max-width: fit-content;
padding: 14px 30px 12px;
margin: 0 auto 50px;
border-radius: 20px;
border: 1px solid #dfdfdf;
h3 {
font-family: $font3;
font-weight: 600;
font-size: 20px;
line-height: 1;
text-align: center;
margin: 0;
}
}
.showrooms-list-cards {
ol {
padding: 0;
margin: 0;
display: grid;
grid-template-columns: repeat(2, minmax(205px, 1fr));
row-gap: 60px;
column-gap: 40px;
li.showroom-card {
display: none;
// display: flex;
flex-direction: column;
align-items: center;
row-gap: 20px;
&.active {
display: flex;
}
.showroom-card-text {
p {
color: $cTxtBlack;
font-family: $font3;
font-weight: 400;
font-size: 16px;
line-height: 1.5;
text-align: center;
}
}
.showroom-card-action {
input {
color: #000000;
font-family: $font3;
font-weight: 500;
font-size: 12px;
line-height: 14px;
text-transform: uppercase;
padding: 14px 30px 12px;
background: #fff;
border: 1px solid #bbbbbb;
border-radius: 5px;
cursor: pointer;
}
}
.showroom-card--popup {
position: fixed;
inset: 0;
display: flex;
align-items: center;
justify-content: center;
z-index: 1;
backdrop-filter: blur(3px);
background: rgba(0, 0, 0, 0.2);
visibility: hidden;
opacity: 0;
transition: all 50ms ease-in-out;
&.active {
visibility: visible;
opacity: 1;
}
.showroom-card--popup-wrapper {
width: 650px;
margin-top: 120px;
background: $cWhite;
border-radius: 30px;
display: flex;
flex-direction: column;
overflow: hidden;
.popup--head {
display: flex;
flex-direction: row;
background: #1e2832;
padding: 40px 60px 35px 60px;
p {
color: $cWhite;
font-family: $font3;
font-weight: 600;
font-size: 20px;
line-height: 1;
margin: 0;
position: relative;
&:not(:last-child) {
padding-right: 25px;
margin-right: 25px;
&::before {
content: '';
position: absolute;
top: 0;
right: 0;
bottom: 3px;
width: 1px;
background: $cWhite;
}
}
}
}
.popup--body {
padding: 20px;
.popup--body-info {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 30px;
p,
a {
color: $cTxtBlack;
font-family: $font3;
font-weight: 400;
font-size: 16px;
line-height: 1.5;
strong {
font-weight: 700;
}
}
.info-name {
p {
padding-left: 11px;
border-left: 5px solid #000;
}
}
.info-time {
}
.info-products {
img {
max-height: 30px;
}
}
}
.popup--body-map {
margin-top: 20px;
line-height: 0;
border-radius: 10px;
overflow: hidden;
}
}
}
}
}
}
}
}
}
}
}
} }
.box-5 { .box-5 {

View File

@@ -1,3 +1,88 @@
<?php
$provinces = [
'dolnoslaskie' => [
'id' => 1,
'name' => 'Dolnośląskie',
],
'kujawsko-pomorskie' => [
'id' => 2,
'name' => 'Kujawsko-pomorskie',
],
'lubelskie' => [
'id' => 3,
'name' => 'Lubelskie',
],
'lubuskie' => [
'id' => 4,
'name' => 'Lubuskie',
],
'lodzkie' => [
'id' => 5,
'name' => 'Łódzkie',
],
'malopolskie' => [
'id' => 6,
'name' => 'Małopolskie',
],
'mazowieckie'=> [
'id' => 7,
'name' => 'Mazowieckie',
],
'opolskie'=> [
'id' => 8,
'name' => 'Opolskie',
],
'podkarpackie'=> [
'id' => 9,
'name' => 'Podkarpackie',
],
'podlaskie'=> [
'id' => 10,
'name' => 'Podlaskie',
],
'pomorskie'=> [
'id' => 11,
'name' => 'Pomorskie',
],
'slaskie'=> [
'id' => 12,
'name' => 'Śląskie',
],
'swietokrzyskie'=> [
'id' => 13,
'name' => 'Świętokrzyskie',
],
'warminsko-mazurskie'=> [
'id' => 14,
'name' => 'Warmińsko-mazurskie',
],
'wielkopolskie'=> [
'id' => 15,
'name' => 'Wielkopolskie',
],
'zachodniopomorskie'=> [
'id' => 16,
'name' => 'Zachodniopomorskie',
]
];
$company_showrooms = [
[
'provinces' => $provinces['podkarpackie'],
'data' => [
'text' => '<strong>Rudna Mała</strong><br/> Rudna Mała 75/k. Rzeszowa<br/> 36-054 Rudna Mała',
],
'data_popup' => [
]
]
];
$partner_showrooms = [
];
?>
<div class="main-page"> <div class="main-page">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
@@ -177,13 +262,122 @@
<div class="container"> <div class="container">
<div class="box-4--wrapper"> <div class="box-4--wrapper">
<div class="c-row"> <div class="c-row">
lista <div id="box-showrooms">
<nav id="showrooms-nav">
<ul>
<?php foreach ($provinces as $key => $value) : ?>
<li>
<input
type="button"
value="<?= $value['name']; ?>"
province="<?= $value['name']; ?>"
>
</li>
<?php endforeach; ?>
</ul>
</nav>
<div id="showrooms-lists">
<div class="showrooms-list showrooms-list-1">
<div class="showrooms-list-title">
<h3>SALONY FIRMOWE</h3>
</div>
<div class="showrooms-list-cards">
<ol>
<?php foreach ($company_showrooms as $key => $value) : ?>
<li class="showroom-card" province='<?= $value['provinces']['name']; ?>'>
<div class="showroom-card-text">
<p><?= $value['data']['text']; ?></p>
</div>
<div class="showroom-card-action">
<input type="button" value="więcej o salonie">
</div>
<div class="showroom-card--popup">
<div class="showroom-card--popup-wrapper">
<div class="popup--head">
<p>SALON PARTNERSKI</p>
<p>VIDOK Okna i Drzwi</p>
</div>
<div class="popup--body">
<div class="popup--body-info">
<div class="info-name">
<p>
<strong>OKNOBUD</strong><br/>
ul. Siemiradzkiego 9<br/>
33-300 <strong>Nowy Sącz</strong>
</p>
</div>
<div class="info-time">
<p>
<strong>Godziny otwarcia:</strong><br/>
Pn-Pt: 8-17<br/>
Sob: 9-13
</p>
</div>
<div class="info-products">
<p>Dostępne produkty</p>
<img src="/upload/filemanager/icon/available-products-1.svg" alt="">
</div>
<div class="info-contact">
<p>
<a href="tel:+48 18 442 19 97">+48 18 442 19 97</a><br/>
<a href="tel:+48 502 458 992">+48 502 458 992</a><br/>
<a href="mailto:oknobud.sacz@gmail.com">oknobud.sacz@gmail.com</a>
</p>
</div>
</div>
<div class="popup--body-map">
<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2559.1425723841835!2d21.973517577050675!3d50.10233831236703!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x473ce36b077ae3b5%3A0x31bb36833c20c2f0!2sVIDOK%20Sp.%20z%20o.o.%20Producent%20okien%20i%20drzwi!5e0!3m2!1spl!2spl!4v1764582571106!5m2!1spl!2spl" width="100%" height="200" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
</div>
</div>
</div>
</div>
</li>
<?php endforeach; ?>
</ol>
</div>
</div>
<div class="showrooms-list showrooms-list-2">
<div class="showrooms-list-title">
<h3>SALONY PARTNERSKIE</h3>
</div>
<div class="showrooms-list-cards">
<ol>
<li class="showroom-card">
<div class="showroom-card-text">
<p>
<strong>Rudna Mała</strong><br/>
Rudna Mała 75/k. Rzeszowa<br/>
36-054 Rudna Mała
</p>
</div>
<div class="showroom-card-action">
<input type="button" value="więcej o salonie">
</div>
</li>
<li class="showroom-card">
<div class="showroom-card-text">
<p>
<strong>Rudna Mała</strong><br/>
Rudna Mała 75/k. Rzeszowa<br/>
36-054 Rudna Mała
</p>
</div>
<div class="showroom-card-action">
<input type="button" value="więcej o salonie">
</div>
</li>
</ol>
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
<section class="box-5"> <section class="box-5">
<div class="container"> <div class="container">
<div class="box-5--wrapper"> <div class="box-5--wrapper">
@@ -353,4 +547,63 @@ $(document).ready(function() {
} }
}); });
}); });
$(document).ready(function() {
let boxShowrooms = $('#box-showrooms');
let showroomsNav = $('#showrooms-nav', boxShowrooms)
$(document).on('click', '.showroom-card--popup', function(e) {
if (e.target === this) {
$(this).removeClass('active');
$('body').removeClass('fixed')
}
});
boxShowrooms.on('click', '#showrooms-nav li input', function(e) {
e.preventDefault();
showroomsNavHandler($(this));
showroomsListHandler($(this).attr('province'))
});
boxShowrooms.on('click', '#showrooms-lists .showroom-card .showroom-card-action input', function(e) {
e.preventDefault();
showMoreInfoPopup($(this));
});
function showroomsNavHandler(item){
$(item).parent().parent().find('li').not($(item)).removeClass('active')
$(item).parent().addClass('active');
}
function showroomsListHandler(province) {
$('#showrooms-lists .showroom-card', boxShowrooms).each(function(){
if($(this).attr('province') == province) {
$(this).addClass('active')
} else{
$(this).removeClass('active')
}
})
}
function defaultProvinces() {
let target = $('#showrooms-nav input[province="Podkarpackie"]');
if (target.length) {
target.trigger('click');
}
}
function showMoreInfoPopup(item){
$(item).parent().siblings('.showroom-card--popup').addClass('active')
$('body').addClass('fixed')
}
// MARK: auto load functions
defaultProvinces();
})
</script> </script>