Save
This commit is contained in:
@@ -830,21 +830,19 @@ class Elementor_Places_Map extends \Elementor\Widget_Base
|
||||
const bounds = new google.maps.LatLngBounds();
|
||||
const markers = [];
|
||||
|
||||
let selectedLocation = null;
|
||||
|
||||
locations.forEach(loc => {
|
||||
if (loc.position && loc.position.lat && loc.position.lng) {
|
||||
const marker = new google.maps.Marker({
|
||||
position: loc.position,
|
||||
map: map,
|
||||
title: loc.name,
|
||||
icon: loc.icon || undefined
|
||||
position: loc.position,
|
||||
map: map,
|
||||
title: loc.name,
|
||||
icon: loc.icon || undefined
|
||||
});
|
||||
|
||||
|
||||
marker.addListener("click", () => {
|
||||
const voivKey = Object.keys(voivodeships).find(k => voivodeships[k].id === loc.voivodeship.id);
|
||||
console.log(voivodeships);
|
||||
console.log(voivodeships[voivKey].name);
|
||||
|
||||
if (voivKey) {
|
||||
select.value = voivodeships[voivKey].name;
|
||||
renderList(voivodeships[voivKey].name);
|
||||
@@ -852,20 +850,23 @@ class Elementor_Places_Map extends \Elementor\Widget_Base
|
||||
setTimeout(() => {
|
||||
const itemEl = listContainer.querySelector(`.location-item[data-id="${loc.id}"]`);
|
||||
if (itemEl) {
|
||||
const itemRect = itemEl.getBoundingClientRect();
|
||||
const containerRect = listContainer.getBoundingClientRect();
|
||||
const offsetTop = itemRect.top - containerRect.top;
|
||||
console.log('itemRect.top: ', itemRect.top);
|
||||
console.log('containerRect.top: ', containerRect.top);
|
||||
console.log('offsetTop: ', offsetTop);
|
||||
const containerTop = listContainer.getBoundingClientRect().top;
|
||||
const itemTop = itemEl.getBoundingClientRect().top;
|
||||
const scrollOffset = listContainer.scrollTop + (itemTop - containerTop);
|
||||
|
||||
if (offsetTop != 0) {
|
||||
listContainer.scrollTo({
|
||||
top: offsetTop,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
if(loc.id == selectedLocation) {
|
||||
itemEl.classList.add('highlight');
|
||||
setTimeout(() => itemEl.classList.remove('highlight'), 1000);
|
||||
return;
|
||||
} else {
|
||||
selectedLocation = loc.id;
|
||||
}
|
||||
|
||||
listContainer.scrollTo({
|
||||
top: scrollOffset,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
|
||||
itemEl.classList.add('highlight');
|
||||
setTimeout(() => itemEl.classList.remove('highlight'), 1000);
|
||||
}
|
||||
|
||||
@@ -975,4 +975,85 @@
|
||||
#header-nav nav.elementor-nav-menu--main > ul.elementor-nav-menu .menu-item .sub-arrow {
|
||||
padding-left: 4px;
|
||||
}
|
||||
}
|
||||
|
||||
#contact-btn-absolute {
|
||||
position: fixed;
|
||||
bottom: 40px;
|
||||
left: 40px;
|
||||
z-index: 99999;
|
||||
}
|
||||
#contact-btn-absolute .elementor-button {
|
||||
position: relative;
|
||||
padding: 16px;
|
||||
border-radius: 100%;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
}
|
||||
#contact-btn-absolute .elementor-button::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 100%;
|
||||
background: #22a9e1;
|
||||
animation: btn-pulse 2s infinite;
|
||||
}
|
||||
#contact-btn-absolute .elementor-button::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 100%;
|
||||
background: #22a9e1;
|
||||
animation: btn-pulse 2s infinite 0.5s;
|
||||
}
|
||||
#contact-btn-absolute .elementor-button .elementor-button-icon {
|
||||
position: relative;
|
||||
font-size: 24px;
|
||||
animation: btn-pulse-icon 2s infinite;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
@keyframes btn-pulse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes btn-pulse-icon {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
5% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
10% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
15% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
20% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
25% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
30% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
35% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
}/*# sourceMappingURL=custom.css.map */
|
||||
File diff suppressed because one or more lines are too long
@@ -1310,3 +1310,91 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#contact-btn-absolute {
|
||||
position: fixed;
|
||||
bottom: 40px;
|
||||
left: 40px;
|
||||
z-index: 99999;
|
||||
|
||||
.elementor-button {
|
||||
position: relative;
|
||||
padding: 16px;
|
||||
border-radius: 100%;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 100%;
|
||||
background: #22a9e1;
|
||||
|
||||
animation: btn-pulse 2s infinite;
|
||||
}
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border-radius: 100%;
|
||||
background: #22a9e1;
|
||||
|
||||
animation: btn-pulse 2s infinite 0.5s;
|
||||
}
|
||||
|
||||
.elementor-button-icon {
|
||||
position: relative;
|
||||
font-size: 24px;
|
||||
animation: btn-pulse-icon 2s infinite;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes btn-pulse {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@keyframes btn-pulse-icon {
|
||||
0% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
5% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
10% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
15% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
20% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
25% {
|
||||
transform: rotate(5deg);
|
||||
}
|
||||
30% {
|
||||
transform: rotate(-5deg);
|
||||
}
|
||||
35% {
|
||||
transform: rotate(0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user