Refactor code structure for improved readability and maintainability

This commit is contained in:
Roman Pyrih
2025-04-14 12:10:19 +02:00
parent a975cb277a
commit d042a7bcd4
5 changed files with 7056 additions and 74 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

@@ -669,6 +669,7 @@ strong {
a {
color: $cWhite;
background: #2e2d2c;
border-color: #2e2d2c;
}
}
@@ -682,7 +683,7 @@ strong {
text-transform: uppercase;
text-align: center;
padding: 13px 24px;
border: 1px solid #181c1d;
border: 1px solid #d3d3d3;
border-radius: 3px;
box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);
height: 100%;
@@ -826,6 +827,52 @@ strong {
line-height: 1.5;
}
}
.inst-client {
position: relative;
padding: 15px;
margin: 15px;
background: #e3e3e3;
border-radius: 5px;
transition: all 250ms ease-in-out;
h4 {
color: #181c1d;
font-size: 16px;
font-family: $font3;
font-weight: 400;
line-height: 1.5;
text-transform: uppercase;
strong {
font-weight: 700;
}
}
p {
color: #181c1d;
font-size: 16px;
font-family: $font3;
font-weight: 400;
line-height: 1.5;
&:last-child {
margin-bottom: 0;
}
strong {
font-weight: 600;
}
}
a {
display: block;
color: #181c1d;
font-size: 16px;
font-family: $font3;
font-weight: 600;
line-height: 1.5;
}
}
}
}
@@ -1055,3 +1102,187 @@ strong {
}
}
}
.box-4 {
padding-top: 150px;
padding-bottom: 150px;
._row {
&-1 {
._col {
&-1 {
h2 {
color: #1d1d1e;
font-family: $font3;
font-weight: 300;
font-size: 34px;
letter-spacing: 2px;
text-align: center;
text-transform: uppercase;
margin-bottom: 35px;
}
p {
color: #1d1d1e;
font-family: $font3;
font-weight: 300;
font-size: 20px;
letter-spacing: 2px;
text-align: center;
text-transform: uppercase;
margin-bottom: 35px;
}
ul {
list-style: none;
padding: 0;
margin: 0;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 14px;
flex-wrap: wrap;
li {
&:nth-child(1) {
a {
color: #ffffff;
background: #1d1d1e;
}
}
&:nth-child(2) {
a {
color: #1d1d1e;
background: #fff246;
}
}
a {
font-family: $font3;
font-weight: 700;
font-size: 14px;
letter-spacing: 1px;
padding: 16px 36px;
border-radius: 5px;
line-height: 1;
text-transform: uppercase;
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
gap: 10px;
}
}
}
}
}
}
}
}
.box-5 {
padding-bottom: 50px;
._row {
&-1 {
position: relative;
display: flex;
flex-direction: row;
column-gap: 100px;
align-items: center;
&::before {
content: '';
position: absolute;
top: 50%;
left: 70px;
background-image: url('/upload/filemanager/icon/Group.svg');
background-position: center;
background-size: contain;
background-repeat: no-repeat;
width: 440px;
height: 420px;
transform: translate(-50%, -50%);
opacity: 0.7;
}
@include respond-below(md) {
column-gap: 50px;
}
@include respond-below(sm) {
flex-direction: column;
row-gap: 50px;
&::before {
display: none;
}
}
._col {
position: relative;
z-index: 1;
&-1 {
img {
width: 100%;
max-width: 712px;
@include respond-below(sm) {
margin: 0 auto;
}
}
}
&-2 {
@include respond-below(sm) {
text-align: center;
}
h3 {
color: #1d1d1e;
font-size: 20px;
font-family: $font3;
font-weight: 600;
letter-spacing: 2px;
margin-bottom: 15px;
text-transform: uppercase;
}
h2 {
color: #fff;
font-size: 32px;
font-family: $font3;
font-weight: 700;
line-height: 1;
letter-spacing: 2px;
text-transform: uppercase;
display: inline-flex;
flex-direction: row;
align-items: center;
gap: 20px;
padding: 18px 24px 14px;
margin-bottom: 50px;
margin-left: -24px;
background: #2e2d2c;
border-radius: 100px;
@include respond-below(md) {
font-size: 26px;
}
}
p {
margin-bottom: 0px;
color: #000000;
font-family: $fLeagueSpartan;
font-size: 18px;
font-weight: 400;
letter-spacing: 1px;
width: 100%;
max-width: 356px;
}
}
}
}
}
}

View File

@@ -1,5 +1,7 @@
<? \S::set_session('contact-form-token', bin2hex(random_bytes(32))); ?>
<?php
require 'wojewodztwa.php';
$google_map_api = 'AIzaSyD-1SOVhJXr6HREtfmMILvlmV-hml3nxUg';
$partnerzy_handlowi_polska = [
@@ -132,73 +134,6 @@ $partnerzy_handlowi_export = [
],
];
$wojewodztwa = [
'dolnoslaskie' => [
'id' => 1,
'name' => 'Dolnoslaskie',
],
'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',
]
];
$klienci_indywidualni = [
[
'id' => 1,
@@ -939,6 +874,144 @@ $klienci_indywidualni = [
'
],
];
$klienci_instytucjonalni = [
[
'id' => 1,
'voivodeship' => $wojewodztwa['podkarpackie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['podkarpackie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Kluczowych Klientów<br/>
Wiesław Ciebiera
</p>
<a href="tel:+48178595679">tel.:+48 17 859 56 79</a>
<a href="mailto:w.ciebiera@vidok.com">e-mail: w.ciebiera@vidok.com</a>
<br/>
<p>
Manager ds. Obsługi Inwestycji<br/>
Marek Potępa
</p>
<a href="tel:+48178595679">tel.: +48 17 859 56 79</a>
<a href="mailto:m.potępa@vidok.com">e-mail: m.potępa@vidok.com</a>
'
],
[
'id' => 2,
'voivodeship' => $wojewodztwa['malopolskie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['malopolskie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Sprzedaży Obiektowej<br/>
Tomasz Firlej
</p>
<a href="tel:+48880526550">tel.: +48 880 526 550</a>
<a href="mailto:t.firlej@vidok.com">e-mail: t.firlej@vidok.com</a>
'
],
[
'id' => 3,
'voivodeship' => $wojewodztwa['opolskie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['opolskie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Kluczowych Klientów<br/>
Artur Wąsowski
</p>
<a href="tel:+48728976847">tel.: +48 728 976 847</a>
<a href="mailto:a.wasowski@vidok.com">e-mail: a.wasowski@vidok.com</a>
'
],
[
'id' => 4,
'voivodeship' => $wojewodztwa['dolnoslaskie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['dolnoslaskie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Kluczowych Klientów<br/>
Artur Wąsowski
</p>
<a href="tel:+48728976847">tel.: +48 728 976 847</a>
<a href="mailto:a.wasowski@vidok.com">e-mail: a.wasowski@vidok.com</a>
'
],
[
'id' => 5,
'voivodeship' => $wojewodztwa['slaskie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['slaskie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Kluczowych Klientów<br/>
Artur Wąsowski
</p>
<a href="tel:+48728976847">tel.: +48 728 976 847</a>
<a href="mailto:a.wasowski@vidok.com">e-mail: a.wasowski@vidok.com</a>
'
],
[
'id' => 6,
'voivodeship' => $wojewodztwa['lubuskie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['lubuskie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Kluczowych Klientów<br/>
Artur Wąsowski
</p>
<a href="tel:+48728976847">tel.: +48 728 976 847</a>
<a href="mailto:a.wasowski@vidok.com">e-mail: a.wasowski@vidok.com</a>
'
],
[
'id' => 7,
'voivodeship' => $wojewodztwa['mazowieckie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['mazowieckie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Sprzedaży Obiektowej<br/>
Rafał Gil
</p>
<a href="mailto:r.gil@vidok.com">e-mail: r.gil@vidok.com</a>
'
],
[
'id' => 8,
'voivodeship' => $wojewodztwa['pomorskie'],
'description' => '
<h4>
WOJEWÓDZTWO<br/>
<strong>' . $wojewodztwa['pomorskie']['name'] . '</strong>
</h4>
<p>
Doradca ds. Sprzedaży Obiektowej<br/>
Rafał Gil
</p>
<a href="mailto:r.gil@vidok.com">e-mail: r.gil@vidok.com</a>
'
],
]
?>
<div class="main-page">
@@ -1298,14 +1371,58 @@ $klienci_indywidualni = [
</div>
</div>
</div>
<div class="box-4">
<div class="container">
<div class="_row _row-1">
<div class="_col _col-1">
<h2>Jesteś zainteresowany naszymi produktami?</h2>
<p>Skorzystaj z darmowej wyceny na podstawie projektu lub znajdź salon.</p>
<ul>
<li>
<a href="#">
Gdzie kupić
<img src="/upload/filemanager/icon/Arrow-1-yellow.svg" alt="">
</a>
</li>
<li>
<a href="#">
Bezpłatna wycena
<img src="/upload/filemanager/icon/Vector.svg" alt="">
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="box-5">
<div class="container">
<div class="_row _row-1">
<div class="_col _col-1">
<img src="/upload/filemanager/Pages/Kontakt/img-1.png" alt="">
</div>
<div class="_col _col-2">
<h3>SPRAWDZ</h3>
<h2>
NASZE KATALOGI
<img src="/upload/filemanager/icon/download-icon.svg" alt="">
</h2>
<p>Każdy katalog to połączenie wysokiej jakości produktów, nowoczesnego designu i technologicznych innowacji - tworzonych z myślą o wymagających klientach oraz aktualnych trendach w architekturze.</p>
</div>
</div>
</div>
</div>
</div>
<link class="footer" href="/plugins/fileuploader/jquery.fileuploader.min.css" rel="stylesheet" type="text/css">
<link class="footer" href="/plugins/fileuploader/font/font-fileuploader.css" rel="stylesheet" type="text/css">
<script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $google_map_api; ?>&callback=initMap" async defer></script>
<script src="https://maps.googleapis.com/maps/api/js?key=<?php echo $google_map_api; ?>&callback=initMap" defer></script>
<script class="footer" type="text/javascript" src="/plugins/fileuploader/jquery.fileuploader.min.js"></script>
<script type="text/javascript">
<script class="footer" type="text/javascript">
$(function(){
$('body').on('click', '#tabs-box #tabs-box-nav li a', function(e){
e.preventDefault();
@@ -1336,10 +1453,13 @@ $klienci_indywidualni = [
function initMap() {
const voivodeship = <?= json_encode($wojewodztwa); ?>;
const indywidualniLocations = <?= json_encode($klienci_indywidualni); ?>;
const klienciInstytucjonalni = <?= json_encode($klienci_instytucjonalni); ?>;
const mapOptions = {
center: { lat: 50.0411, lng: 21.9991 },
zoom: 11.2,
// center: { lat: 50.0411, lng: 21.9991 },
center: { lat: 51.9194, lng: 19.1451 },
// zoom: 11.2,
zoom: 6,
styles: [{
elementType: "geometry",
stylers: [{
@@ -1439,6 +1559,7 @@ $klienci_indywidualni = [
};
const map1 = new google.maps.Map(document.getElementById("map-klienci-indywidualni"), mapOptions);
const map2 = new google.maps.Map(document.getElementById("map-klienci-instytucjonalni"), mapOptions);
setupMapSection({
map: map1,
@@ -1446,6 +1567,13 @@ $klienci_indywidualni = [
mapWrapperId: 'klienci-indywidualni',
voivodeships: voivodeship
});
setupInstitutionalClientsMap({
map: map2,
voivodeships: voivodeship,
clients: klienciInstytucjonalni,
mapWrapperId: "klienci-instytucjonalni"
});
}
function setupMapSection({ map, locations, mapWrapperId, voivodeships }) {
@@ -1532,6 +1660,80 @@ $klienci_indywidualni = [
renderList(voivodeships.podkarpackie.name);
}
function setupInstitutionalClientsMap({ map, voivodeships, clients, mapWrapperId }) {
const wrapper = document.getElementById(mapWrapperId);
const listContainer = wrapper.querySelector(".map-point-info--body");
const select = wrapper.querySelector("select[name='voivodeship']");
const polygons = [];
Object.entries(voivodeships).forEach(([key, voiv]) => {
if (!voiv.polygon || !voiv.polygon.length) return;
const paths = voiv.polygon.map(([lng, lat]) => ({ lat, lng }));
const polygon = new google.maps.Polygon({
paths: paths,
strokeColor: "#ffd90048",
strokeOpacity: 1.0,
strokeWeight: 2,
fillColor: "#fff",
fillOpacity: 0.05,
map: map,
});
polygon.voivName = voiv.name;
polygon.addListener("click", () => {
highlightPolygon(voiv.name);
renderClientInfo(voiv.name);
});
polygons.push(polygon);
});
select.addEventListener("change", (e) => {
highlightPolygon(e.target.value);
renderClientInfo(e.target.value);
});
function highlightPolygon(activeVoivName) {
polygons.forEach(p => {
const isActive = p.voivName === activeVoivName;
p.setOptions({
strokeColor: isActive ? "#FFD700" : "#595959",
strokeWeight: isActive ? 3 : 2,
fillOpacity: isActive ? 0.2 : 0.05,
fillColor: isActive ? "#FFD700" : "#fff",
zIndex: isActive ? 1 : 0
});
});
}
function renderClientInfo(voivName) {
listContainer.innerHTML = '';
const found = clients.find(client => client.voivodeship.name === voivName);
const div = document.createElement("div");
div.className = "inst-client";
if (!found) {
div.innerHTML = `
<h4>
WOJEWÓDZTWO<br/>
<strong>${voivName}</strong>
</h4>
`
div.innerHTML += "<p>Brak danych</p>";
} else {
div.innerHTML = found.description;
}
listContainer.appendChild(div);
}
highlightPolygon(voivodeships.podkarpackie.name);
renderClientInfo(voivodeships.podkarpackie.name);
}
$(document).ready(function() {
$('#contact-form-new input.files').fileuploader({
fileMaxSize: 10,

6549
wojewodztwa.php Normal file

File diff suppressed because it is too large Load Diff