1(function ($) { 2 $(document).ready(function () { 3 4 /* ========================= 5 MAIN SERVICE AREA MAP 6 ========================== */ 7 8 if ($('#custom_map').length) { 9 const map = L.map('custom_map', { scrollWheelZoom: false }) 10 .setView([47.5, -120.5], 7); 11 12 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 13 attribution: '© OpenStreetMap contributors' 14 }).addTo(map); 15 16 const counties = [ 17 { 18 name: "Puget Sound Area", 19 lat: 47.45, 20 lng: -122.4, 21 cities: [ 22 "Seattle", "Tacoma", "Bellevue", "Everett", "Redmond", 23 "Kirkland", "Renton", "Kent", "Auburn", "Federal Way", 24 "Bremerton", "Olympia", "Lynnwood", "Shoreline" 25 ] 26 }, 27 { 28 name: "Bellingham & Surrounding Areas", 29 lat: 48.749, 30 lng: -122.4783, 31 cities: [ 32 "Bellingham", "Ferndale", "Lynden", "Everson", 33 "Blaine", "Sumas", "Nooksack" 34 ] 35 }, 36 { 37 name: "Seattle & Surrounding Areas", 38 lat: 47.6062, 39 lng: -122.3321, 40 cities: [ 41 "Seattle", "Bellevue", "Redmond", "Kirkland", 42 "Bothell", "Shoreline", "Burien", "SeaTac", 43 "Mercer Island", "Issaquah" 44 ] 45 }, 46 { 47 name: "Spokane", 48 lat: 47.6588, 49 lng: -117.4260, 50 cities: [ 51 "Spokane", "Spokane Valley", "Liberty Lake", 52 "Cheney", "Airway Heights", "Deer Park", "Medical Lake" 53 ] 54 }, 55 { 56 name: "Yakima County & Surrounding Areas", 57 lat: 46.53, 58 lng: -120.52, 59 cities: [ 60 "Yakima", "Union Gap", "Selah", "Moxee", "Wapato", 61 "Toppenish", "Sunnyside", "Zillah", "Granger", 62 "Grandview", "Tieton", "Naches", "Mabton" 63 ] 64 }, 65 { 66 name: "Coeur d'Alene, Idaho", 67 lat: 47.6777, 68 lng: -116.7805, 69 cities: [ 70 "Coeur d'Alene", "Post Falls", "Hayden", 71 "Rathdrum", "Spirit Lake", "Dalton Gardens" 72 ] 73 }, 74 { 75 name: "Moscow, Idaho", 76 lat: 46.7310, 77 lng: -117.0000, 78 cities: ["Moscow"] 79 }, 80 { 81 name: "Tri-Cities", 82 lat: 46.2396, 83 lng: -119.0984, 84 cities: ["Kennewick", "Richland", "Pasco", "West Richland"] 85 } 86 ]; 87 88 const countyMarkers = {}; 89 let defaultMarker; 90 91 const locationIcon = L.icon({ 92 iconUrl: 'https://pacificcoastmemorials.com/wp-content/uploads/2026/01/location-pin.png', 93 iconSize: [30, 30], 94 iconAnchor: [15, 40], 95 popupAnchor: [0, -35] 96 }); 97 98 function countyPopup(county) { 99 let html = `<strong>${county.name}</strong><p>Cities:</p><ul>`; 100 county.cities.forEach(city => html += `<li>${city}</li>`); 101 html += `</ul>`; 102 return html; 103 } 104 105 counties.forEach(county => { 106 const marker = L.marker([county.lat, county.lng], { icon: locationIcon }) 107 .addTo(map) 108 .bindPopup(countyPopup(county)); 109 110 countyMarkers[county.name] = marker; 111 112 if (county.name === 'Puget Sound Area') { 113 defaultMarker = marker; 114 } 115 }); 116 117 if (defaultMarker) defaultMarker.openPopup(); 118 119 const pugetSoundPolygon = L.polygon( 120 [ 121 [47.5, -122.5], 122 [47.0, -122.0], 123 [47.5, -121.5], 124 [48.0, -122.0], 125 [48.5, -122.5], 126 [47.5, -122.5] 127 ], 128 { 129 color: 'blue', 130 weight: 2, 131 opacity: 0.5, 132 fillColor: 'blue', 133 fillOpacity: 0.2 134 } 135 ).addTo(map); 136 137 pugetSoundPolygon.bindPopup( 138 "<strong>Puget Sound</strong><br>This is the Puget Sound area, a beautiful estuary located in Washington State." 139 ); 140 141 $('.area-card').on('click', function (e) { 142 e.preventDefault(); 143 const countyName = $(this).data('county'); 144 145 $('.area-card').removeClass('active'); 146 $(this).addClass('active'); 147 148 if (countyMarkers[countyName]) { 149 countyMarkers[countyName].openPopup(); 150 } 151 }); 152 } 153 154 /* ========================= 155 TABS 156 ========================== */ 157 158 $(document).on('click', '.tab', function () { 159 $('.tab, .tab-content').removeClass('active'); 160 const tab = $(this).data('tab'); 161 $(this).addClass('active'); 162 $('#' + tab).addClass('active'); 163 }); 164 165 /* ========================= 166 SLICK SLIDERS 167 ========================== */ 168 169 $('.pcm-images').slick({ 170 vertical: true, 171 verticalSwiping: true, 172 slidesToShow: 1, 173 autoplay: true, 174 autoplaySpeed: 2000 175 }); 176 177 $('.slick-slider-image').slick({ 178 slidesToShow: 1, 179 autoplay: true, 180 autoplaySpeed: 2500,
181 arrows: false 182 }); 183 184 if ($(window).width() <= 992 && $(window).width() >= 576) { 185 $('.top-other-link .flex-row-center').slick({ 186 slidesToShow: 4, 187 arrows: false, 188 autoplay: true, 189 autoplaySpeed: 2000, 190 responsive: [{ 191 breakpoint: 500, 192 settings: { slidesToShow: 2 } 193 }] 194 }); 195 } 196 197 $('.contact-locations-grid').slick({ 198 slidesToShow: 4, 199 arrows: false, 200 autoplay: true, 201 autoplaySpeed: 2000, 202 responsive: [{ 203 breakpoint: 500, 204 settings: { slidesToShow: 3 } 205 }] 206 }); 207 208 $('.blog-featured__slider').slick({ 209 slidesToShow: 3, 210 slidesToScroll: 1, 211 arrows: true, 212 autoplay: true, 213 autoplaySpeed: 2000, 214 prevArrow: '<button type="button" class="slick-arrow slick-prev"><i class="fa-solid fa-angle-left"></i></button>', 215 nextArrow: '<button type="button" class="slick-arrow slick-next"><i class="fa-solid fa-angle-right"></i></button>', 216 responsive: [{ 217 breakpoint: 767, 218 settings: { 219 slidesToShow: 2 220 } 221 }, 222 { 223 breakpoint: 576, 224 settings: { 225 slidesToShow: 1 226 } 227 }] 228 }); 229 230 /* ========================= 231 LOCATION MAP 232 ========================== */ 233 234 let locationMarkers = {}; 235 let markerDefault; 236 237 if (jQuery('#location_map').length > 0) { 238 const locationMap = L.map('location_map', { scrollWheelZoom: false }).setView([47.5, -120.5], 7); 239 240 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 241 attribution: '© OpenStreetMap contributors' 242 }).addTo(locationMap); 243 244 // Example counties data 245 const locations = [ 246 { 247 name: "Idaho Monuments", 248 lat: 47.7176, 249 lng: -116.9500, 250 address: "1200 Innovation Way, Post Falls, ID 83854", 251 phone: "(208) 262-9393", 252 website: "https://pacificcoastmemorials.com/idahomonuments/", 253 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/Attachment.jpg" 254 }, 255 { 256 name: "Pacific Coast Memorials - Production Facility", 257 lat: 48.0831, 258 lng: -121.9700, 259 address: "10515 Mountain Loop Hwy, Granite Falls, WA 98252", 260 phone: "(425) 348-9868", 261 website: "https://cemeterytim.com/", 262 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/Pacific-Coast-Memorial.png" 263 }, 264 { 265 name: "Oregon Monument", 266 lat: 42.3265, 267 lng: -122.8756, 268 address: "302 N. Front Street, Medford, OR 97501", 269 phone: "(541) 772-2214", 270 website: "https://pacificcoastmemorials.com/oregonmonument/", 271 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/oregon-monument-banner.jpeg" 272 }, 273 { 274 name: "Premier Memorial", 275 lat: 47.2115, 276 lng: -122.4573, 277 address: "5414 Pacific Ave, Tacoma, WA 98408", 278 phone: "(253) 472-0369", 279 website: "https://pacificcoastmemorials.com/premiermemorial/", 280 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/premier-memorial-banner.jpeg" 281 }, 282 { 283 name: "Pacific Coast Memorial", 284 lat: 47.9101, 285 lng: -122.2221, 286 address: "5703 Evergreen Way, Everett, WA 98203", 287 phone: "(425) 348-9868", 288 website: "https://pacificcoastmemorials.com/everett/", 289 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/IMG_0194.jpeg" 290 }, 291 { 292 name: "Yakima Monuments", 293 lat: 46.584900, 294 lng: -120.514282, 295 address: "608 West Nob Hill Boulevard, Yakima, Washington 98902", 296 phone: "(509) 426-3612", 297 website: "https://pacificcoastmemorials.com/cemeterytim/", 298 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/20260128_084102.jpeg" 299 }, 300 { 301 name: "Tri-Cities Monuments", 302 lat: 46.231201, 303 lng: -119.090057, 304 address: "325 West Lewis Street, Pasco, Washington 99301", 305 phone: "(509) 426-3613", 306 website: "https://pacificcoastmemorials.com/pasco/", 307 image: "https://pacificcoastmemorials.com/wp-content/uploads/2026/01/IMG_7708.png" 308 } 309 ]; 310 311 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 312 attribution: '© OpenStreetMap contributors' 313 }).addTo(locationMap); 314 315 function cityPopupHtml(location) { 316 return ` 317 <div class="contact-location-card"> 318 <div class="location-card-image"> 319 <img src="${location.image}" alt="${location.name}"> 320 </div> 321 <div class="location-card-content"> 322 <h4 class="location-card-name">${location.name}</h4> 323 <div class="location-card-info"> 324 <div class="location-card-info-row"> 325 <svg fill="none" stroke="currentColor" viewBox="0 0 24 24"> 326 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" 327 d="M17.657 16.657L13.414 20.9a1.998 1.998 0 01-2.827 0l-4.244-4.243a8 8 0 1111.314 0z"> 328 </path> 329 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" 330 d="M15 11a3 3 0 11-6 0 3 3 0 016 0z"></path> 331 </svg>
332 <span>${location.address}</span> 333 </div> 334 <div class="location-card-info-row"> 335 <svg fill="none" stroke="currentColor" viewBox="0 0 24 24"> 336 <path stroke-linecap="round" stroke-linejoin="round" stroke-width="1.5" 337 d="M3 5a2 2 0 012-2h3.28a1 1 0 01.948.684l1.498 4.493a1 1 0 01-.502 1.21l-2.257 1.13a11.042 11.042 0 005.516 5.516l1.13-2.257a1 1 0 011.21-.502l4.493 1.498a1 1 0 01.684.949V19a2 2 0 01-2 2h-1C9.716 21 3 14.284 3 6V5z"> 338 </path> 339 </svg> 340 <span>${location.phone}</span> 341 </div> 342 </div> 343 <a href="${location.website}" class="location-card-link"> 344 Visit Website â 345 </a> 346 </div> 347 </div> 348 `; 349 } 350 351 locations.forEach(location => { 352 if (!location.lat || !location.lng) return; 353 354 const marker = L.marker([location.lat, location.lng]).addTo(locationMap); 355 locationMarkers[location.name] = marker; 356 marker.bindPopup(cityPopupHtml(location)); 357 358 if (location.name === 'Idaho Monuments') { 359 markerDefault = marker; 360 } 361 }); 362 363 if (markerDefault) { 364 markerDefault.openPopup(); 365 } 366 jQuery('.location-card').on('click', function (e) { 367 e.preventDefault(); 368 369 const locationName = jQuery(this).data('location'); 370 const $target = jQuery('#location_map'); 371 372 jQuery('.location-card').removeClass('active'); 373 jQuery(this).addClass('active'); 374 const headerOffset = 150; 375 376 const scrollPosition = $target.offset().top - headerOffset; 377 jQuery('html, body').animate( 378 { 379 scrollTop: scrollPosition 380 }, 381 600, 382 function () { 383 const lmarker = locationMarkers[locationName]; 384 if (lmarker) { 385 locationMap.setView(lmarker.getLatLng(), 8, { 386 animate: true 387 }); 388 389 setTimeout(() => { 390 lmarker.openPopup(); 391 }, 300); 392 } else { 393 console.warn("No marker found for:", locationName); 394 } 395 } 396 ); 397 }); 398 } 399 400 401 if (jQuery('#areaServedMap').length > 0) { 402 const map = L.map('areaServedMap', { scrollWheelZoom: false }).setView([47.5, -120.5], 7); 403 404 405 L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { 406 attribution: '© OpenStreetMap contributors' 407 }).addTo(map); 408 const counties = [ 409 { 410 name: "Baker", 411 lat: 44.7749, 412 lng: -117.8344, 413 cities: ["Baker City"] 414 }, 415 { 416 name: "Benton", 417 lat: 44.4910, 418 lng: -123.4268, 419 cities: ["Adair Village", "Albany", "Corvallis", "Monroe", "Philomath"] 420 }, 421 { 422 name: "Clackamas", 423 lat: 45.1885, 424 lng: -122.2201, 425 cities: [ 426 "Canby", "Damascus", "Estacada", "Gladstone", "Happy Valley", 427 "Lake Oswego", "Milwaukie", "Oregon City", "Sandy", 428 "Tualatin", "West Linn", "Wilsonville" 429 ] 430 }, 431 { 432 name: "Clatsop", 433 lat: 46.0247, 434 lng: -123.7055, 435 cities: ["Astoria", "Cannon Beach", "Gearhart", "Seaside", "Warrenton"] 436 }, 437 { 438 name: "Columbia", 439 lat: 45.9437, 440 lng: -122.9916, 441 cities: ["Clatskanie", "Columbia City", "Rainier", "Scappoose", "St. Helens", "Vernonia"] 442 }, 443 { 444 name: "Coos", 445 lat: 43.1745, 446 lng: -124.0948, 447 cities: ["Bandon", "Coos Bay", "Coquille", "Lakeside", "Myrtle Point", "North Bend", "Powers"] 448 }, 449 { 450 name: "Crook", 451 lat: 44.3069, 452 lng: -120.8539, 453 cities: ["Prineville"] 454 }, 455 { 456 name: "Curry", 457 lat: 42.4716, 458 lng: -124.2131, 459 cities: ["Brookings", "Gold Beach", "Port Orford"] 460 }, 461 { 462 name: "Deschutes", 463 lat: 43.9148, 464 lng: -121.2289, 465 cities: ["Bend", "La Pine", "Redmond", "Sisters"] 466 }, 467 { 468 name: "Douglas", 469 lat: 43.2792, 470 lng: -123.1650, 471 cities: ["Canyonville", "Drain", "Elkton", "Glendale", "Myrtle Creek", "Oakland", "Reedsport", "Roseburg", "Sutherlin", "Winston"] 472 }, 473 { 474 name: "Gilliam", 475 lat: 45.3796, 476 lng: -120.2103, 477 cities: ["Condon"] 478 }, 479 { 480 name: "Grant", 481 lat: 44.4906, 482 lng: -119.0096, 483 cities: ["Canyon City", "Dayville", "John Day", "Long Creek", "Monument", "Mt. Vernon", "Prairie City"] 484 }, 485 { 486 name: "Harney", 487 lat: 43.0642, 488 lng: -118.9679, 489 cities: ["Burns", "Hines"] 490 }, 491 { 492 name: "Hood River", 493 lat: 45.5191, 494 lng: -121.6516, 495 cities: ["Cascade Locks", "Hood River"] 496 }, 497 { 498 name: "Jackson", 499 lat: 42.3345, 500 lng: -122.7647, 501 cities: [ 502 "Ashland", "Butte Falls", "Central Point", "Eagle Point", 503 "Gold Hill", "Jacksonville", "Medford", "Phoenix", 504 "Rogue River", "Shady Cove", "Talent" 505 ] 506 }, 507 { 508 name: "Jefferson", 509 lat: 44.6978, 510 lng: -121.1787, 511 cities: ["Madras", "Metolius"] 512 }, 513 { 514 name: "Josephine", 515 lat: 42.3656, 516 lng: -123.5550, 517 cities: ["Cave Junction", "Grants Pass"] 518 }, 519 { 520 name: "Klamath", 521 lat: 42.6835, 522 lng: -121.6490, 523 cities: ["Bonanza", "Chiloquin", "Klamath Falls", "Malin", "Merrill"] 524 }, 525 { 526 name: "Lake", 527 lat: 42.7889, 528 lng: -120.3874, 529 cities: ["Lakeview", "Paisley"] 530 }, 531 { 532 name: "Lane", 533 lat: 44.0424, 534 lng: -122.9914, 535 cities: [ 536 "Coburg", "Cottage Grove", "Creswell", "Eugene", "Florence", 537 "Junction City", "Lowell", "Oakridge", "Springfield", "Veneta", "Westfir" 538 ] 539 }, 540 { 541 name: "Lincoln", 542 lat: 44.6368, 543 lng: -123.9054, 544 cities: ["Depoe Bay", "Lincoln City", "Newport", "Siletz", "Toledo", "Waldport", "Yachats"] 545 }, 546 { 547 name: "Linn", 548 lat: 44.4910, 549 lng: -122.5340, 550 cities: ["Albany", "Brownsville", "Halsey", "Harrisburg", "Lebanon", "Lyons", "Mill City", "Scio", "Sweet Home", "Tangent"] 551 }, 552 { 553 name: "Malheur", 554 lat: 43.1889, 555 lng: -117.6012, 556 cities: ["Adrian", "Jordan Valley", "Nyssa", "Ontario", "Vale"] 557 }, 558 { 559 name: "Marion", 560 lat: 44.9032, 561 lng: -122.5819, 562 cities: [ 563 "Aumsville", "Aurora", "Donald", "Gates", "Gervais", 564 "Hubbard", "Jefferson", "Keizer", "Mt. Angel", 565 "Salem", "Scotts Mills", "Silverton", "St. Paul", "Stayton", "Turner", "Woodburn" 566 ] 567 }, 568 { 569 name: "Morrow", 570 lat: 45.4181, 571 lng: -119.5856, 572 cities: ["Boardman", "Heppner", "Ione", "Irrigon"] 573 }, 574 { 575 name: "Multnomah", 576 lat: 45.5478, 577 lng: -122.4176, 578 cities: ["Fairview", "Gresham", "Maywood Park", "Portland", "Troutdale", "Wood Village"] 579 }, 580 { 581 name: "Polk", 582 lat: 44.9021, 583 lng: -123.4129, 584 cities: ["Dallas", "Falls City", "Independence", "Monmouth"] 585 }, 586 { 587 name: "Sherman", 588 lat: 45.4053, 589 lng: -120.6890, 590 cities: ["Grass Valley", "Moro", "Rufus", "Wasco"] 591 }, 592 { 593 name: "Tillamook", 594 lat: 45.4563, 595 lng: -123.7386, 596 cities: ["Bay City", "Garibaldi", "Manzanita", "Nehalem", "Rockaway Beach", "Tillamook", "Wheeler"] 597 }, 598 { 599 name: "Umatilla", 600 lat: 45.5946, 601 lng: -118.7395, 602 cities: ["Adams", "Athena", "Echo", "Helix", "Hermiston", "Milton-Freewater", "Pendleton", "Pilot Rock", "Stanfield", "Ukiah", "Umatilla"] 603 }, 604 { 605 name: "Union", 606 lat: 45.3106,
607 lng: -118.0078, 608 cities: ["Cove", "Elgin", "Imbler", "La Grande", "North Powder", "Summerville", "Union"] 609 }, 610 { 611 name: "Wallowa", 612 lat: 45.5798, 613 lng: -117.1817, 614 cities: ["Enterprise", "Joseph", "Lostine", "Wallowa"] 615 }, 616 { 617 name: "Wasco", 618 lat: 45.1602, 619 lng: -121.1679, 620 cities: ["Antelope", "Dufur", "Maupin", "Mosier", "Shaniko", "The Dalles"] 621 }, 622 { 623 name: "Washington", 624 lat: 45.5594, 625 lng: -123.0980, 626 cities: [ 627 "Banks", "Beaverton", "Cornelius", "Durham", "Forest Grove", 628 "Gaston", "Hillsboro", "King City", "North Plains", 629 "Sherwood", "Tigard", "Tualatin" 630 ] 631 }, 632 { 633 name: "Wheeler", 634 lat: 44.7260, 635 lng: -120.0281, 636 cities: ["Fossil", "Mitchell"] 637 }, 638 { 639 name: "Yamhill", 640 lat: 45.2336, 641 lng: -123.3089, 642 cities: ["Amity", "Carlton", "Dayton", "Dundee", "Lafayette", "McMinnville", "Newberg", "Sheridan", "Willamina", "Yamhill"] 643 } 644 ]; 645 646 let defaultMarker; 647 const countyMarkers = {}; 648 const bounds = L.latLngBounds(); 649 // const locationIcon = L.icon({ 650 // iconUrl: 'https://dicks-towing.com/wp-content/uploads/2025/06/location-pin.png', 651 // iconSize: [30, 30], 652 // iconAnchor: [15, 40], 653 // popupAnchor: [0, -35] 654 // }); 655 656 function cityPopupHtml(county) { 657 let html = `<strong>${county.name}</strong><p>Cities:</p><ul>`; 658 county.cities.forEach(city => { 659 html += `<li>${city}</li>`; 660 }); 661 html += `</ul>`; 662 return html; 663 } 664 665 counties.forEach(county => { 666 const marker = L.marker([county.lat, county.lng]).addTo(map); 667 668 marker.bindPopup(cityPopupHtml(county)); 669 countyMarkers[county.name] = marker; 670 bounds.extend([county.lat, county.lng]); 671 if (county.name == 'Baker') { 672 defaultMarker = marker; 673 } 674 }); 675 676 if (defaultMarker) { 677 defaultMarker.openPopup(); 678 } 679 680 map.fitBounds(bounds, { padding: [50, 50] }); 681 682 $('.county').on('click', function (e) { 683 e.preventDefault(); 684 const countyName = $(this).data('county'); 685 $('.county').removeClass('active'); 686 $(this).addClass('active'); 687 const marker = countyMarkers[countyName]; 688 if (marker) { 689 // map.setView(marker.getLatLng(), 8); 690 marker.openPopup(); 691 } else { 692 console.warn("No marker found for:", countyName); 693 } 694 }); 695 } 696 697 $('.headstone-unveiling-slider').each(function () { 698 699 var $this = $(this); 700 701 if ($this.find('.swiper-slide').length > 0) { 702 703 // 1ï¸â£ Cache original images (for thumbnails) 704 var images = []; 705 $this.find('.swiper-slide img').each(function () { 706 images.push($(this).attr('src')); 707 }); 708 709 // 2ï¸â£ Initialize Swiper 710 var swiper = new Swiper(this, { 711 centeredSlides: true, 712 loop: true, 713 speed: 500, 714 slidesPerView: 2.5, 715 spaceBetween: 40, 716 autoplay: { 717 delay: 3000, 718 }, 719 720 pagination: { 721 el: $this.find(".image-indicators")[0], 722 clickable: true, 723 type: 'custom', 724 renderCustom: function (swiper, current, total) { 725 726 var html = '<button class="prev-btn">Prev</button>'; 727 html += '<div class="scrollable-wrapper">'; 728 729 for (let i = 0; i < images.length; i++) { 730 var className = swiper.realIndex === i ? 'active' : ''; 731 html += '<span class="' + className + '" data-index="' + i + '">'; 732 html += '<img src="' + images[i] + '" class="indicator" />'; 733 html += '</span>'; 734 } 735 736 html += '</div><button class="next-btn">Next</button>'; 737 return html; 738 } 739 }, 740 741 on: { 742 // 3ï¸â£ Smoothly update active thumbnail + scroll 743 slideChangeTransitionStart: function () { 744 745 var activeIndex = this.realIndex; 746 747 var $wrapper = $this.find('.scrollable-wrapper'); 748 var $thumbs = $wrapper.find('span'); 749 var $activeThumb = $thumbs.eq(activeIndex); 750 751 // Remove previous active 752 $thumbs.removeClass('active'); 753 $activeThumb.addClass('active'); 754 755 if ($activeThumb.length) {
756 var wrapperWidth = $wrapper.outerWidth(); 757 var thumbLeft = $activeThumb[0].offsetLeft; 758 var thumbWidth = $activeThumb.outerWidth(); 759 760 var scrollPosition = thumbLeft - (wrapperWidth / 2) + (thumbWidth / 2); 761 762 $wrapper.stop().animate({ scrollLeft: scrollPosition }, 400); // smooth 763 } 764 } 765 } 766 }); 767 768 // 4ï¸â£ Click thumbnail to change slide 769 $this.on('click', '.image-indicators span', function () { 770 var index = $(this).data('index'); 771 swiper.slideToLoop(index); 772 }); 773 774 // 5ï¸â£ Optional: Prev/Next buttons inside custom pagination 775 $this.on('click', '.prev-btn', function () { 776 swiper.slidePrev(); 777 }); 778 $this.on('click', '.next-btn', function () { 779 swiper.slideNext(); 780 }); 781 782 } 783 784 }); 785 786 var $wrapper = $(".srvcs_banner .buy_right"); 787 788 $wrapper.on("mousemove", function (e) { 789 var width = $wrapper.outerWidth(); 790 var scrollWidth = $wrapper.get(0).scrollWidth; 791 792 var offset = $wrapper.offset(); 793 var mouseX = e.pageX - offset.left; 794 var scrollPercent = mouseX / width; 795 796 $wrapper.scrollLeft(scrollPercent * (scrollWidth - width)); 797 }); 798 799 $(document).on('click', '.sub-header-link ul li.menu-item-has-children .sub-toggle', function (e) { 800 e.preventDefault(); 801 $(this).closest('.menu-item-has-children').find('ul.sub-menu').slideToggle(); 802 }); 803 804 $(document).on('click', '.panel-card', function () { 805 $('.details-panel').removeClass('active'); 806 var value = $(this).data('panel-card'); 807 $("#" + value).addClass('active'); 808 809 // Smooth scroll with header height minus 810 // Header ki height lo 811 var headerHeight = $('.site-header').outerHeight(); 812 $('html, body').animate({ 813 scrollTop: $("#" + value).offset().top - headerHeight 814 }, 800); 815 816 817 }); 818 819 $(document).on('click', '.close-btn', function () { 820 $('.details-panel').removeClass('active'); 821 }); 822 823 $('.categories button').click(function () { 824 $('.categories button').removeClass('active'); 825 $(this).addClass('active'); 826 827 var category = $(this).data('category'); // use data-category attribute on button 828 829 if (category === 'all') { 830 $('.color-card').show(); 831 } else { 832 $('.color-card').hide(); 833 $('.color-card').filter(function () { 834 return $(this).data('category') === category; 835 }).show(); 836 } 837 }); 838 839 }); 840 841 function loadJotform({ 842 containerId, 843 formId, 844 title, 845 delayMobile = 3000 846 }) { 847 const renderForm = () => { 848 const container = document.getElementById(containerId); 849 850 if (!container) return; 851 852 container.innerHTML = ` 853 <iframe 854 id="JotFormIFrame-${formId}" 855 title="${title}" 856 allowtransparency="true" 857 allow="geolocation; microphone; camera; fullscreen; payment" 858 src="https://form.jotform.com/${formId}" 859 frameborder="0" 860 style="min-width:100%;max-width:100%;height:539px;border:none;" 861 scrolling="no"> 862 </iframe> 863 `; 864 865 const initForm = () => { 866 window.jotformEmbedHandler?.( 867 `iframe[id='JotFormIFrame-${formId}']`, 868 "https://form.jotform.com/" 869 ); 870 }; 871 872 if (window.jotformEmbedHandler) { 873 initForm(); 874 } else { 875 const script = document.createElement("script"); 876 script.src = "https://cdn.jotfor.ms/s/umd/latest/for-form-embed-handler.js"; 877 script.onload = initForm; 878 document.body.appendChild(script); 879 } 880 }; 881 882 if (window.innerWidth < 768) { 883 window.addEventListener("load", () => { 884 setTimeout(renderForm, delayMobile); 885 }); 886 } else { 887 renderForm(); 888 } 889 } 890 891 loadJotform({ 892 containerId: "gallery-form-container", 893 formId: "262026008391147", 894 title: "Pacific Coast Memorials gallery Form", 895 delayMobile: 3000 896 }); 897 898 loadJotform({ 899 containerId: "jotform-container", 900 formId: "261116944778063", 901 title: "PNW Monuments Request a Quote Form - General Request", 902 delayMobile: 3000 903 }); 904})(jQuery); 905 906(function () { 907 "use strict"; 908 909 var form = document.getElementById("collectionFilterForm"); 910 var results = document.getElementById("galleryResult"); 911 var resetBtn = document.getElementById("collectionResetFilters"); 912 var searchInput = form ? form.querySelector('input[name="search"]') : null; 913 var debounceTimer = null; 914 915 if (!form || !results) return; 916 917 function getFilterData(page) { 918 var data = new FormData(); 919 data.append("action", "gallery_filter_monuments"); 920 data.append("nonce", ajaxObject.nonce); 921 data.append("paged", page || 1); 922 923 // Select dropdowns 924 form.querySelectorAll("select").forEach(function (el) { 925 if (el.name && el.value) { 926 data.append(el.name, el.value); 927 } 928 }); 929 930 // Checkboxes 931 form.querySelectorAll('input[type="checkbox"]').forEach(function (el) { 932 if (el.checked && el.name) { 933 data.append(el.name, el.value); 934 } 935 }); 936
937 // Search field 938 if (searchInput && searchInput.value.trim()) { 939 data.append("search", searchInput.value.trim()); 940 } 941 942 return data; 943 } 944 945 function fetchResults(page) { 946 results.classList.add("pnw-loading"); 947 948 fetch(ajaxObject.ajaxurl, { 949 method: "POST", 950 body: getFilterData(page), 951 }) 952 .then(function (res) { 953 return res.json(); 954 }) 955 .then(function (data) { 956 if (data.success && data.data.html) { 957 results.innerHTML = data.data.html; 958 } else { 959 results.innerHTML = 960 '<div class="pnw-no-results"><p>No monuments found. Try different filters.</p></div>'; 961 } 962 results.classList.remove("pnw-loading"); 963 964 if (page && page > 1) { 965 results.scrollIntoView({ behavior: "smooth", block: "start" }); 966 } 967 968 updateURLParams(); 969 970 bindPagination(); 971 }) 972 .catch(function () { 973 results.innerHTML = 974 '<div class="pnw-no-results"><p>Something went wrong. Please try again.</p></div>'; 975 results.classList.remove("pnw-loading"); 976 }); 977 } 978 979 function triggerFilter() { 980 clearTimeout(debounceTimer); 981 debounceTimer = setTimeout(function () { 982 fetchResults(1); 983 }, 300); 984 } 985 986 form.querySelectorAll("select").forEach(function (el) { 987 el.addEventListener("change", triggerFilter); 988 }); 989 990 form.querySelectorAll('input[type="checkbox"]').forEach(function (el) { 991 el.addEventListener("change", triggerFilter); 992 }); 993 994 if (searchInput) { 995 searchInput.addEventListener("input", function () { 996 clearTimeout(debounceTimer); 997 debounceTimer = setTimeout(function () { 998 fetchResults(1); 999 }, 500); 1000 }); 1001 } 1002 1003 if (resetBtn) { 1004 resetBtn.addEventListener("click", function () { 1005 form.querySelectorAll("select").forEach(function (el) { 1006 el.selectedIndex = 0; 1007 }); 1008 form.querySelectorAll('input[type="checkbox"]').forEach(function (el) { 1009 el.checked = false; 1010 }); 1011 if (searchInput) searchInput.value = ""; 1012 fetchResults(1); 1013 }); 1014 } 1015 1016 function bindPagination() { 1017 results.querySelectorAll(".pnw-pagination a").forEach(function (link) { 1018 link.addEventListener("click", function (e) { 1019 e.preventDefault(); 1020 var url = new URL(this.href); 1021 var page = url.searchParams.get("paged") || 1; 1022 fetchResults(page); 1023 }); 1024 }); 1025 } 1026 1027 function updateURLParams() { 1028 var params = new URLSearchParams(); 1029 1030 form.querySelectorAll("select").forEach(function (el) { 1031 if (el.name && el.value) params.set(el.name, el.value); 1032 }); 1033 1034 form 1035 .querySelectorAll('input[type="checkbox"]:checked') 1036 .forEach(function (el) { 1037 if (el.name) params.set(el.name, el.value); 1038 }); 1039 1040 if (searchInput && searchInput.value.trim()) { 1041 params.set("search", searchInput.value.trim()); 1042 } 1043 1044 var qs = params.toString(); 1045 var newUrl = window.location.pathname + (qs ? "?" + qs : ""); 1046 window.history.replaceState(null, "", newUrl); 1047 } 1048 1049 function restoreFromURL() { 1050 var params = new URLSearchParams(window.location.search); 1051 var hasFilters = false; 1052 1053 params.forEach(function (value, key) { 1054 // Try select 1055 var select = form.querySelector('select[name="' + key + '"]'); 1056 if (select) { 1057 select.value = value; 1058 hasFilters = true; 1059 return; 1060 } 1061 1062 // Try checkbox 1063 var checkbox = form.querySelector( 1064 'input[type="checkbox"][name="' + key + '"]', 1065 ); 1066 if (checkbox) { 1067 checkbox.checked = true; 1068 hasFilters = true; 1069 return; 1070 } 1071 1072 // Try search 1073 if (key === "search" && searchInput) { 1074 searchInput.value = value; 1075 hasFilters = true; 1076 } 1077 }); 1078 1079 if (hasFilters) { 1080 fetchResults(1); 1081 } 1082 } 1083 1084 bindPagination(); 1085 restoreFromURL(); 1086})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.