-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
19 lines (16 loc) · 882 Bytes
/
Copy pathscript.js
File metadata and controls
19 lines (16 loc) · 882 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// Define an array of category short_names
var categoryShortNames = ["Lunch", "Dinner", "Sushi", "Beverages", "Desserts", /* Add more categories as needed */];
// Function to select a random category short_name
function getRandomCategoryShortName() {
var randomIndex = Math.floor(Math.random() * categoryShortNames.length);
return categoryShortNames[randomIndex];
}
// Function to handle the click event on the "Specials" tile
function handleSpecialsClick() {
var randomCategoryShortName = getRandomCategoryShortName();
// Replace this with your actual function to load menu items
// Example: $dc.loadMenuItems(randomCategoryShortName);
console.log("Selected category: " + randomCategoryShortName);
}
// Attach the click event handler to the "Specials" tile
document.querySelector('#specialsTile').addEventListener('click', handleSpecialsClick);