// Store locations data const locations = [ { name: "Anaheim Hills", address: "8285 Santa Ana Canyon Rd, Suite 110, Anaheim Hills, CA 92808", lat: 33.858348, lng: -117.752303 }, { name: "Placentia", address: "1152 Imperial Hwy, Placentia, CA 92870", lat: 33.901650, lng: -117.861635 }, { name: "Aliso Viejo", address: "22912 Pacific Park Dr, Suite C, Aliso Viejo, CA 92656", lat: 33.582218, lng: -117.728859 }, ]; // Global variable for home store let homeStore = localStorage.getItem('homeStore') || "NULL"; // Function to calculate distance between two coordinates using Haversine formula function getDistance(lat1, lng1, lat2, lng2) { const R = 6371; // Radius of the Earth in km const dLat = (lat2 - lat1) * (Math.PI / 180); const dLng = (lng2 - lng1) * (Math.PI / 180); const a = Math.sin(dLat / 2) * Math.sin(dLat / 2) + Math.cos(lat1 * (Math.PI / 180)) * Math.cos(lat2 * (Math.PI / 180)) * Math.sin(dLng / 2) * Math.sin(dLng / 2); const c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); return R * c; // Distance in km } // Function to find the nearest store function findNearestStore(userLat, userLng) { let nearestStore = locations[0]; let minDistance = getDistance(userLat, userLng, nearestStore.lat, nearestStore.lng); locations.forEach((location) => { const distance = getDistance(userLat, userLng, location.lat, location.lng); if (distance < minDistance) { nearestStore = location; minDistance = distance; } }); return nearestStore; } // Set home store using geolocation if not already set if (homeStore === "NULL") { if (navigator.geolocation) { navigator.geolocation.getCurrentPosition( (position) => { const userLat = position.coords.latitude; const userLng = position.coords.longitude; const nearestStore = findNearestStore(userLat, userLng); homeStore = nearestStore.name; localStorage.setItem('homeStore', homeStore); console.log(`Home store set by geolocation: ${homeStore}`); location.reload(); // Refresh the page after setting the home store }, (error) => { console.error('Geolocation error:', error); } ); } } // Function to handle user selecting a home store function selectHomeStore(storeName) { homeStore = storeName; localStorage.setItem('homeStore', homeStore); console.log(`Home store selected by user: ${homeStore}`); alertStoreAddress(storeName); location.reload(); // Refresh the page after user selection } // Function to alert the address of the selected store function alertStoreAddress(storeName) { const store = locations.find(location => location.name === storeName); if (store) { alert(`The address of ${storeName} is: ${store.address}`); } else { alert('Store not found.'); } } // Example function to simulate store selection by the user document.querySelectorAll('.store-selector').forEach((button) => { button.addEventListener('click', (event) => { const storeName = event.target.dataset.storeName; selectHomeStore(storeName); }); }); // Console log the current home store console.log(`Current home store: ${homeStore}`);
Skip to main content
Porkys Pizza Logo
Pizza You'll Love... We Guarantee It! Voted Top 5 Pizza Makers in Southern California
We Deliver Fresh 'n Hot

Accessability Statement

General Statement

Porky's Pizza is committed to making its website accessible to individuals with disabilities by meeting or exceeing the requirements of Section 508 of the Rehabilitation Act by implimenting the Website Content Accessibility Guidelines (WCAG) 2.0 and 2.1.

Standards

Porky's Pizza uses the accessibility standards that have been issued via the W3C’s Web Content Accessibility Guidelines (WCAG) 2.1 level AA.

Additional Assistance

Part of our continued effort for accessibility is the understanding that sometimes the guidelines that have been set forth will fall short for some. If for any reason you would like any of the materials that we publish in an alternative format to aid in your ability to access such materials, please let us know at access@porkyspizza.com. We will do what we can to accommodate you.

Reporting Accessibility Issues

If you have any problems accessing parts of this website, please contact us at access@porkyspizza.com. When emailing us in regards to accessibility issues, please include the following information so that we can fully investigate the matter:

  • The website address in question
  • The problem you experienced
  • Your contact information