{"id":1146,"date":"2025-12-16T13:40:46","date_gmt":"2025-12-16T12:40:46","guid":{"rendered":"https:\/\/db-coatings.eu\/?page_id=1146"},"modified":"2025-12-17T10:34:05","modified_gmt":"2025-12-17T09:34:05","slug":"kalkulator-malowania-proszkowe","status":"publish","type":"page","link":"https:\/\/db-coatings.eu\/?page_id=1146","title":{"rendered":"Kalkulator"},"content":{"rendered":"\n<style>\n.app {\n  max-width: 1100px;\n  margin: auto;\n  font-family: Inter, Arial, sans-serif;\n}\n.section {\n  background: #fff;\n  border-radius: 20px;\n  padding: 24px;\n  margin-bottom: 24px;\n  box-shadow: 0 10px 30px rgba(0,0,0,.08);\n}\n.cards {\n  display: grid;\n  grid-template-columns: repeat(auto-fit,minmax(220px,1fr));\n  gap: 20px;\n}\n.card {\n  padding: 20px;\n  border-radius: 18px;\n  background: #fafafa;\n  cursor: pointer;\n  border: 2px solid transparent;\n  text-align: center;\n  font-weight: 600;\n  transition: .2s;\n}\n.card:hover {\n  transform: translateY(-2px);\n}\n.card.active {\n  border-color: #f97316;\n  background: #fff7ed;\n}\n.hidden { display:none }\ninput, select {\n  width: 100%;\n  padding: 10px;\n  border-radius: 10px;\n  border: 1px solid #d1d5db;\n  margin-top: 6px;\n}\nlabel {\n  font-weight: 600;\n  margin-top: 12px;\n  display:block;\n}\n.result {\n  font-size: 16px;\n  line-height: 1.6;\n}\n.price {\n  font-size: 22px;\n  color: #ea580c;\n}\n<\/style>\n\n<div class=\"app\">\n\n<!-- KSZTA\u0141T -->\n<div class=\"section\">\n  <h2>1. Wybierz kszta\u0142t<\/h2>\n  <div class=\"cards\">\n    <div class=\"card\" onclick=\"selectShape('flat',this)\">\ud83d\udd33 Element p\u0142aski<\/div>\n    <div class=\"card\" onclick=\"selectShape('box',this)\">\ud83d\udce6 Skrzynka<\/div>\n    <div class=\"card\" onclick=\"selectShape('cylinder',this)\">\ud83d\udfe6 Rura<\/div>\n    <div class=\"card\" onclick=\"selectShape('rim',this)\">\ud83d\udede Felga<\/div>\n  <\/div>\n<\/div>\n\n<!-- WYMIARY -->\n<div id=\"flat\" class=\"section hidden\">\n  <h3>Wymiary \u2013 element p\u0142aski<\/h3>\n  <label>D\u0142ugo\u015b\u0107 (mm)<\/label><input id=\"flat_l\" value=\"500\">\n  <label>Szeroko\u015b\u0107 (mm)<\/label><input id=\"flat_w\" value=\"500\">\n  <label>Ilo\u015b\u0107 sztuk<\/label><input id=\"flat_qty\" value=\"1\">\n<\/div>\n\n<div id=\"box\" class=\"section hidden\">\n  <h3>Wymiary \u2013 skrzynka<\/h3>\n  <label>D\u0142ugo\u015b\u0107 (mm)<\/label><input id=\"box_l\">\n  <label>Szeroko\u015b\u0107 (mm)<\/label><input id=\"box_w\">\n  <label>Wysoko\u015b\u0107 (mm)<\/label><input id=\"box_h\">\n  <label>Ilo\u015b\u0107 sztuk<\/label><input id=\"box_qty\" value=\"1\">\n<\/div>\n\n<div id=\"cylinder\" class=\"section hidden\">\n  <h3>Wymiary \u2013 rura<\/h3>\n  <label>\u015arednica (mm)<\/label><input id=\"cyl_d\">\n  <label>D\u0142ugo\u015b\u0107 (mm)<\/label><input id=\"cyl_l\">\n  <label>Ilo\u015b\u0107 sztuk<\/label><input id=\"cyl_qty\" value=\"1\">\n<\/div>\n\n<div id=\"rim\" class=\"section hidden\">\n  <h3>Felga<\/h3>\n  <label>Rozmiar<\/label>\n  <select id=\"rimSize\">\n    <option value=\"14\">14&#8243;<\/option>\n    <option value=\"15\">15&#8243;<\/option>\n    <option value=\"16\">16&#8243;<\/option>\n    <option value=\"17\">17&#8243;<\/option>\n    <option value=\"18\">18&#8243;<\/option>\n    <option value=\"19\">19&#8243;<\/option>\n    <option value=\"20\">20&#8243;<\/option>\n  <\/select>\n  <label>Ilo\u015b\u0107 sztuk<\/label>\n  <input id=\"rim_qty\" value=\"4\">\n<\/div>\n\n<!-- USTAWIENIA -->\n<div class=\"section\">\n  <h2>2. Ustawienia<\/h2>\n  <label>Grubo\u015b\u0107 pow\u0142oki (\u00b5m)<\/label><input id=\"thickness\" value=\"70\">\n  <label>Wydajno\u015b\u0107 (%)<\/label><input id=\"efficiency\" value=\"60\">\n  <label>Cena proszku (z\u0142 \/ kg)<\/label><input id=\"powderPrice\" value=\"20\">\n  <label>Koszt pracy (z\u0142 \/ m\u00b2)<\/label><input id=\"labor\" value=\"50\">\n  <label>Mar\u017ca (%)<\/label><input id=\"margin\" value=\"40\">\n<\/div>\n\n<!-- WYNIK -->\n<div class=\"section\">\n  <h2>3. Wycena<\/h2>\n  <div id=\"result\" class=\"result\">Wybierz kszta\u0142t i uzupe\u0142nij dane<\/div>\n<\/div>\n\n<\/div>\n\n<script>\nlet shape = null;\n\nconst rimAreas = {\n  14:0.30,15:0.32,16:0.35,17:0.38,18:0.41,19:0.44,20:0.47\n};\n\nfunction selectShape(s, el){\n  shape = s;\n  document.querySelectorAll('.card').forEach(c=>c.classList.remove('active'));\n  el.classList.add('active');\n\n  document.querySelectorAll('#flat,#box,#cylinder,#rim')\n    .forEach(e=>e.classList.add('hidden'));\n  document.getElementById(s).classList.remove('hidden');\n\n  calculate();\n}\n\ndocument.querySelectorAll('input,select').forEach(el=>{\n  el.addEventListener('input', calculate);\n});\n\nfunction n(v){ return Number(v) || 0 }\n\nfunction calculate(){\n  if(!shape) return;\n\n  let area = 0;\n  let qty = 1;\n\n  if(shape==='flat'){\n    area = n(flat_l.value) * n(flat_w.value) \/ 1e6;\n    qty = n(flat_qty.value);\n  }\n\n  if(shape==='box'){\n    area = 2 * (\n      n(box_l.value)*n(box_w.value) +\n      n(box_l.value)*n(box_h.value) +\n      n(box_w.value)*n(box_h.value)\n    ) \/ 1e6;\n    qty = n(box_qty.value);\n  }\n\n  if(shape==='cylinder'){\n    area = Math.PI * (n(cyl_d.value)\/1000) * (n(cyl_l.value)\/1000);\n    qty = n(cyl_qty.value);\n  }\n\n  if(shape==='rim'){\n    area = rimAreas[rimSize.value];\n    qty = n(rim_qty.value);\n  }\n\n  area *= qty;\n\n  const powderKg = area * n(thickness.value) * 0.15 \/ (n(efficiency.value)\/100) \/ 1000;\n  const powderCost = powderKg * n(powderPrice.value);\n  const laborCost = area * n(labor.value);\n  const total = (powderCost + laborCost) * (1 + n(margin.value)\/100);\n\n  result.innerHTML = `\n    Powierzchnia: <b>${area.toFixed(2)} m\u00b2<\/b><br>\n    Zu\u017cycie proszku: <b>${powderKg.toFixed(2)} kg<\/b><br>\n    Koszt proszku: <b>${powderCost.toFixed(2)} z\u0142<\/b><br>\n    Koszt pracy: <b>${laborCost.toFixed(2)} z\u0142<\/b><br><br>\n    <div class=\"price\">Cena dla klienta: ${total.toFixed(2)} z\u0142<\/div>\n  `;\n}\n<\/script>\n\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. Wybierz kszta\u0142t \ud83d\udd33 Element p\u0142aski \ud83d\udce6 Skrzynka \ud83d\udfe6 Rura \ud83d\udede Felga Wymiary \u2013 element p\u0142aski D\u0142ugo\u015b\u0107 (mm) Szeroko\u015b\u0107 (mm) Ilo\u015b\u0107 sztuk Wymiary \u2013 skrzynka D\u0142ugo\u015b\u0107 (mm) Szeroko\u015b\u0107 (mm) Wysoko\u015b\u0107 (mm) Ilo\u015b\u0107 sztuk Wymiary \u2013 rura \u015arednica (mm) D\u0142ugo\u015b\u0107 (mm) Ilo\u015b\u0107 sztuk Felga Rozmiar 14&#8243;15&#8243;16&#8243;17&#8243;18&#8243;19&#8243;20&#8243; Ilo\u015b\u0107 sztuk 2. Ustawienia Grubo\u015b\u0107 pow\u0142oki (\u00b5m) Wydajno\u015b\u0107 (%) Cena [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"class_list":["post-1146","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/db-coatings.eu\/index.php?rest_route=\/wp\/v2\/pages\/1146","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/db-coatings.eu\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/db-coatings.eu\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/db-coatings.eu\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/db-coatings.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1146"}],"version-history":[{"count":8,"href":"https:\/\/db-coatings.eu\/index.php?rest_route=\/wp\/v2\/pages\/1146\/revisions"}],"predecessor-version":[{"id":1151,"href":"https:\/\/db-coatings.eu\/index.php?rest_route=\/wp\/v2\/pages\/1146\/revisions\/1151"}],"wp:attachment":[{"href":"https:\/\/db-coatings.eu\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1146"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}