Craft Your Perfect Pizza

Drag, drop, and customize to create your dream pizza masterpiece!

Pizza Builder

Choose Your Toppings

Cheese

Mozzarella

Mozzarella

Cheddar

Cheddar

Parmesan

Parmesan

Gorgonzola

Gorgonzola

Provolone

Provolone

Meats

Pepperoni

Pepperoni

Ham

Ham

Bacon

Bacon

Sausage

Sausage

Chicken

Chicken

Vegetables

Mushrooms

Mushrooms

Olives

Olives

Peppers

Peppers

Onions

Onions

Tomatoes

Tomatoes

Sauces

Marinara

Marinara

Alfredo

Alfredo

BBQ

BBQ

Pesto

Pesto

Customize Further

Choose Size

Choose Crust

Your Pizza Order

Pizza Details

  • Size: Medium (12")
  • Crust: Classic
  • Toppings: 0 selected

Order Summary

  • Pizza Subtotal: $12.99
  • Toppings: $3.50
  • Total: $16.49
, '')); const toppingsPrice = parseFloat(document.getElementById('toppingsPrice').textContent.replace('} // Simple drag and drop functionality for toppings const toppings = document.querySelectorAll('.topping'); const pizzaCanvas = document.getElementById('pizzaCanvas'); const toppingCountElement = document.getElementById('toppingCount'); let toppingCount = 0; toppings.forEach(topping => { topping.addEventListener('mousedown', function(e) { const toppingType = this.getAttribute('data-topping'); const toppingImg = this.querySelector('img').src; // Create a new topping on the pizza const newTopping = document.createElement('img'); newTopping.src = toppingImg; newTopping.alt = toppingType; newTopping.className = 'absolute w-12 h-12 object-cover rounded-full cursor-move'; newTopping.style.left = '50%'; newTopping.style.top = '50%'; newTopping.style.transform = 'translate(-50%, -50%)'; // Add to pizza canvas pizzaCanvas.appendChild(newTopping); toppingCount++; toppingCountElement.textContent = toppingCount + " selected"; // Make it draggable makeDraggable(newTopping); // Add delete button const deleteBtn = document.createElement('span'); deleteBtn.innerHTML = feather.icons['x'].toSvg({ class: 'w-3 h-3' }); deleteBtn.className = 'absolute -top-1 -right-1 bg-red-500 text-white rounded-full p-1 cursor-pointer hover:bg-red-600'; deleteBtn.onclick = function(e) { e.stopPropagation(); pizzaCanvas.removeChild(newTopping); toppingCount--; toppingCountElement.textContent = toppingCount + " selected"; }; newTopping.appendChild(deleteBtn); }); }); function makeDraggable(element) { let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; element.onmousedown = dragMouseDown; function dragMouseDown(e) { e = e || window.event; e.preventDefault(); // Get the mouse cursor position at startup pos3 = e.clientX; pos4 = e.clientY; document.onmouseup = closeDragElement; // Call a function whenever the cursor moves document.onmousemove = elementDrag; } function elementDrag(e) { e = e || window.event; e.preventDefault(); // Calculate the new cursor position pos1 = pos3 - e.clientX; pos2 = pos4 - e.clientY; pos3 = e.clientX; pos4 = e.clientY; // Set the element's new position const rect = pizzaCanvas.getBoundingClientRect(); const centerX = rect.left + rect.width / 2; const centerY = rect.top + rect.height / 2; const distance = Math.sqrt(Math.pow(e.clientX - centerX, 2) + Math.pow(e.clientY - centerY, 2)); // Only move if within pizza bounds if (distance < rect.width / 2) { element.style.top = (element.offsetTop - pos2) + "px"; element.style.left = (element.offsetLeft - pos1) + "px"; } } function closeDragElement() { // Stop moving when mouse button is released document.onmouseup = null; document.onmousemove = null; } } }); , '')) || 0; const total = pizzaPrice + crustExtra + toppingsPrice; document.getElementById('totalPrice').textContent = `${total.toFixed(2)}`; } // Simple drag and drop functionality for toppings const toppings = document.querySelectorAll('.topping'); const pizzaCanvas = document.getElementById('pizzaCanvas'); const toppingCountElement = document.getElementById('toppingCount'); let toppingCount = 0; toppings.forEach(topping => { topping.addEventListener('mousedown', function(e) { const toppingType = this.getAttribute('data-topping'); const toppingImg = this.querySelector('img').src; // Create a new topping on the pizza const newTopping = document.createElement('img'); newTopping.src = toppingImg; newTopping.alt = toppingType; newTopping.className = 'absolute w-12 h-12 object-cover rounded-full cursor-move'; newTopping.style.left = '50%'; newTopping.style.top = '50%'; newTopping.style.transform = 'translate(-50%, -50%)'; // Add to pizza canvas pizzaCanvas.appendChild(newTopping); toppingCount++; toppingCountElement.textContent = toppingCount + " selected"; // Make it draggable makeDraggable(newTopping); // Add delete button const deleteBtn = document.createElement('span'); deleteBtn.innerHTML = feather.icons['x'].toSvg({ class: 'w-3 h-3' }); deleteBtn.className = 'absolute -top-1 -right-1 bg-red-500 text-white rounded-full p-1 cursor-pointer hover:bg-red-600'; deleteBtn.onclick = function(e) { e.stopPropagation(); pizzaCanvas.removeChild(newTopping); toppingCount--; toppingCountElement.textContent = toppingCount + " selected"; }; newTopping.appendChild(deleteBtn); }); }); function makeDraggable(element) { let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0; element.onmousedown = dragMouseDown; function dragMouseDown(e) { e = e || window.event; e.preventDefault(); // Get the mouse cursor position at startup pos3 = e.clientX; pos4 = e.clientY; document.onmouseup = closeDragElement; // Call a function whenever the cursor moves document.onmousemove = elementDrag; } function elementDrag(e) { e = e || window.event; e.preventDefault(); // Calculate the new cursor position pos1 = pos3 - e.clientX; pos2 = pos4 - e.clientY; pos3 = e.clientX; pos4 = e.clientY; // Set the element's new position const rect = pizzaCanvas.getBoundingClientRect(); const centerX = rect.left + rect.width / 2; const centerY = rect.top + rect.height / 2; const distance = Math.sqrt(Math.pow(e.clientX - centerX, 2) + Math.pow(e.clientY - centerY, 2)); // Only move if within pizza bounds if (distance < rect.width / 2) { element.style.top = (element.offsetTop - pos2) + "px"; element.style.left = (element.offsetLeft - pos1) + "px"; } } function closeDragElement() { // Stop moving when mouse button is released document.onmouseup = null; document.onmousemove = null; } } });