. Configuración de privacidad y de cookies

Tus últimos cálculos

    • Aún no has calculado ningún proyecto.
🧵

Calculadora de Telas ULTIMATE

Cálculos matemáticos reales de modistería orientados a tu talla y proyecto.

Tiene estampado, cuadros, rayas o pelo (Ej: Terciopelo) Requiere casar el patrón, cortar en una misma dirección (+20%).

Calcular Presupuesto (Opcional)

Para confeccionar este proyecto necesitas comprar:

0 metros
Costo Estimado Principal
0.00€

Desglose del cálculo

La tela incluye costuras y holguras. ¡Siempre recomendamos lavar tu tela secarla y plancharla antes de cortarla!
${item.title} Fecha: ${item.date} ${item.result} ${item.cost}

`; historyList.appendChild(li); }); } historyModal.classList.add('alf-active'); }); historyList.addEventListener('click', (e) => { if(e.target.classList.contains('alf-btn-history-delete')) { const id = e.target.dataset.id; let history = JSON.parse(localStorage.getItem('alf_calc_history') || '[]'); // Handle new objects with ID, or fallback to removing the exact object string match for old legacy objects if(id !== "undefined") { history = history.filter(h => h.id !== id); } else { // Legacy delete (find the parent li index) const li = e.target.closest('li'); const index = Array.from(historyList.children).indexOf(li); if(index > -1) history.splice(index, 1); } localStorage.setItem('alf_calc_history', JSON.stringify(history)); updateHistoryCount(); historyBtn.click(); // Re-render list } if(e.target.classList.contains('alf-btn-history-load')) { const id = e.target.dataset.id; const history = JSON.parse(localStorage.getItem('alf_calc_history') || '[]'); let item = null; if(id !== "undefined") { item = history.find(h => h.id === id); } else { const li = e.target.closest('li'); const index = Array.from(historyList.children).indexOf(li); item = history[index]; } if(item && item.params) { activeEditId = id !== "undefined" ? id : null; // Set the active edit state submitBtnSpan.textContent = "Actualizar Cálculo Modificado"; // Visual feedback const p = item.params; clientNameInput.value = p.client || ""; catSelect.value = p.cat; populateTypes(); typeSelect.value = p.type; checkSleeves(); sleeveSelect.value = p.sleeve || "none"; widthSelect.value = p.width; sizeSelect.value = p.size; directionalCheck.checked = p.dirCheck !== undefined ? p.dirCheck : true; priceInput.value = p.price || ""; currencySelect.value = p.currency || "€"; if(system !== p.system) { const targetBtn = Array.from(unitBtns).find(b => b.dataset.system === p.system); if(targetBtn) targetBtn.click(); } lengthInput.value = p.length; historyModal.classList.remove('alf-active'); resultContainer.classList.add('alf-hidden'); setTimeout(() => { form.style.display = 'flex'; document.querySelector('.alf-top-controls').style.display = 'flex'; }, 300); } } }); closeHistoryBtn.addEventListener('click', () => { historyModal.classList.remove('alf-active'); }); historyModal.addEventListener('click', (e) => { if(e.target === historyModal) historyModal.classList.remove('alf-active'); }); // Export Logic printBtn.addEventListener('click', () => { window.print(); }); copyBtn.addEventListener('click', () => { if (!navigator.clipboard) return alert('¡Tu navegador no soporta copiado rápido! Selecciona el texto manualmente.'); navigator.clipboard.writeText(latestReportText).then(() => { copyBtn.classList.add('alf-copied'); setTimeout(() => { copyBtn.classList.remove('alf-copied'); }, 2000); }); }); emailBtn.addEventListener('click', () => { const subject = encodeURIComponent(`Materiales de costura: ${finalProjectName}`); const body = encodeURIComponent(latestReportText); window.location.href = `mailto:?subject=${subject}&body=${body}`; }); function animateValue(obj, start, end, duration) { let startTimestamp = null; const step = (timestamp) => { if (!startTimestamp) startTimestamp = timestamp; const progress = Math.min((timestamp - startTimestamp) / duration, 1); const easeOutProgress = progress * (2 - progress); const currentVal = (start + (end - start) * easeOutProgress).toFixed(1); obj.innerHTML = currentVal.replace('.', ','); if (progress < 1) window.requestAnimationFrame(step); }; window.requestAnimationFrame(step); } });