Screen Print
T-Shirts
/* for non-mobile devices */
:root {
–title-font-size: 20px; /* Set the font size of the title to 20px on non-mobile devices */
–calculator-box-size: 50%
%; /* Set the size of the calculator box to 50% width on non-mobile devices */
}
/* for mobile devices */
@media (max-width: 575.98px) {
:root {
–title-font-size: 20px; /* Set the font size of the title to 20px on mobile devices */
–calculator-box-size: 100%; /* Set the size of the calculator box to 100% width on mobile devices */
}
}
* {box-sizing: border-box;} .calculator-container{ font-family: ‘Helvetica’, sans-serif; width: var(–calculator-box-size); border: 1px solid black; padding: 20px; display: inline-block; border: #333 1px solid; border-radius: 2px; padding: 5px 5px;} h2.title{ font-size: var(–title-font-size); } .location{ margin-top: 10px} .delete-location{ cursor: pointer; color: red} .card{ border: 1px solid #ccc; border-radius: 5px; padding: 0; margin-bottom: 15px} .card-header{ padding: 5px 15px; border-bottom: 1px solid #ccc; background-color: #000; color: white; font-weight: bold} .card-body{ padding: 15px 15px} .card-two{ display: flex; justify-content: space-between; align-items: start; gap: 1rem} .location-controls{ margin-top: 15px} .btn{ font-size: 1rem; padding: 5px 10px;} .btn-block{ display: block; width: 100%; background-color: #6274b4; border-radius: 5px; border: 1px solid #aaa; color: white; font-weight: bold} .card-controls{ text-align: right} .form-control{ min-height: 25px; font-size: 1rem; width: 100%}
SCREEN PRINTING
PRICING CALCULATOR
Per Unit Price: $
Total Cost (Before Tax): $
const teeTypeSelector=document.getElementById(‘teeType’); const quantitySlider=document.getElementById(‘quantity’); const quantityInput=document.getElementById(‘quantityValue’); const locationsContainer=document.getElementById(‘locationsContainer’); const priceDisplay=document.getElementById(‘price’); const totalCostDisplay=document.getElementById(‘totalCost’); var colorsMax=6; window.onload=()=>{ typeChildren=[]; teeTypeSelector.replaceChildren(typeChildren); for (let type in configuration.types){ typeChild=document.createElement(‘option’); typeChild.value=configuration.types[type]; typeChildText=document.createTextNode(type); typeChild.appendChild(typeChildText); teeTypeSelector.appendChild(typeChild);} let maxQuantity=Math.max(…configuration.quantities); let minQuantity=Math.min(…configuration.quantities); if (quantitySlider.value >maxQuantity){ quantitySlider.setAttribute(‘value’, maxQuantity); quantitySlider.value=maxQuantity; quantityInput.setAttribute(‘value’, maxQuantity); quantityInput.value=maxQuantity;} quantitySlider.setAttribute(‘max’, maxQuantity); quantitySlider.setAttribute(‘min’, minQuantity); colorsMax=configuration.colors.length; document.querySelectorAll(‘.location’).forEach((location, index)=>{ location.querySelector(‘.colors’).setAttribute(‘max’, colorsMax);}); primaryPricingMatrix=configuration.pricings; additionalLocationPricingMatrix=configuration.altpricings; calculatePrice();};
var primaryPricingMatrix={}; var additionalLocationPricingMatrix={}; function calculatePrice(){ let teeTypeCost=parseFloat(teeTypeSelector.value); let quantity=parseInt(quantityInput.value); let totalCost=0; document.querySelectorAll(‘.location’).forEach((location, index)=>{ let colors=parseInt(location.querySelector(‘.colors’).value); let pricingMatrix=index===0 ? primaryPricingMatrix : additionalLocationPricingMatrix; let closestQuantity=Object.keys(pricingMatrix).reduce((prev, curr)=>{ return (Math.abs(curr – quantity) < Math.abs(prev – quantity) ? curr : prev);}); let locationPrice=pricingMatrix[closestQuantity][colors – 1]; totalCost +=locationPrice * quantity;}); let price=totalCost / quantity + teeTypeCost; priceDisplay.textContent=price.toFixed(2); totalCostDisplay.textContent=totalCost.toFixed(2); quantitySlider.value=quantity;} function addLocation(){ let locationCount=document.querySelectorAll('.location').length + 1; let locationDiv=document.createElement('div'); locationDiv.className='card location'; locationDiv.innerHTML=`
`; locationsContainer.appendChild(locationDiv); locationDiv.querySelector(‘.colors’).addEventListener(‘input’, (event)=>{ locationDiv.querySelector(‘.colorValue’).textContent=event.target.value; calculatePrice();}); calculatePrice();} function deleteLocation(element){ element.closest(‘.card’).remove(); calculatePrice();} teeTypeSelector.addEventListener(‘change’, calculatePrice); quantitySlider.addEventListener(‘input’, ()=>{ quantityInput.value=quantitySlider.value; calculatePrice();}); quantityInput.addEventListener(‘input’, calculatePrice); document.querySelector(‘.location .colors’).addEventListener(‘input’, (event)=>{ document.querySelector(‘.location .colorValue’).textContent=event.target.value; calculatePrice();}); document.getElementById(‘addLocation’).addEventListener(‘click’, addLocation);
Tultex 241 65/35 Poly/Cotton
PC55 50/50 Cotton/Poly
PC54 100% Cotton
Gildan 980 100% Ring Spun Cotton
Gildan 8000 50/50 Cotton/Poly
Gildan 2000 100% Cotton
Gildan 980 100% Ring Spun Cotton
District DM130 TriBlend
Sport-Tek ST380 100% Poly
Sport-Tek ST350 100% Poly