diff --git a/js/light/light-pdf.js b/js/light/light-pdf.js index 2166a96..18ad60b 100644 --- a/js/light/light-pdf.js +++ b/js/light/light-pdf.js @@ -5,8 +5,8 @@ * Zie LICENTIE.md. */ -// PDF van de light-versie: voorblad "Uw woningontwerp" (beeld, kerncijfers, keuzes, indicatieve prijs, contact en -// QR-code naar de modelpagina), de aanzichten en plattegrond (HousePdf, klantvariant) en een pagina over de werkwijze. +// PDF van de light-versie: voorblad "Uw woningontwerp" (beeld, kerncijfers, keuzes, indicatieve prijs tenzij +// d.price === false, contact en QR-code naar de modelpagina), de aanzichten en plattegrond (HousePdf, klantvariant) en een pagina over de werkwijze. window.LightPdf = (() => { const COMPANY = { naam: 'Van Emous Mantelzorgwoningen', @@ -136,22 +136,24 @@ window.LightPdf = (() => { y = keyValues(doc, M, y + 6, 150, d.choices, 'Uw keuzes'); // Prijs: rustig, als de rest van de pagina; alleen het bedrag groter en vet. - const py = Math.max(y + 4, 196); - doc.setDrawColor(...LINE); - doc.setLineWidth(0.3); - doc.line(M, py, M + 150, py); - doc.setTextColor(...MUTED); - doc.setFont('helvetica', 'normal'); - doc.setFontSize(10); - doc.text('Indicatieve prijs', M, py + 9); - doc.setTextColor(...INK); - doc.setFont('helvetica', 'bold'); - doc.setFontSize(20); - doc.text(CostModel.eur(Math.round(i.price / 100) * 100), M, py + 19); - doc.setFont('helvetica', 'normal'); - doc.setFontSize(9); - doc.setTextColor(...MUTED); - doc.text('incl. btw, onder voorbehoud', M, py + 25); + const py = Math.max(y + 4, 196), price = d.price !== false; + if (price) { + doc.setDrawColor(...LINE); + doc.setLineWidth(0.3); + doc.line(M, py, M + 150, py); + doc.setTextColor(...MUTED); + doc.setFont('helvetica', 'normal'); + doc.setFontSize(10); + doc.text('Indicatieve prijs', M, py + 9); + doc.setTextColor(...INK); + doc.setFont('helvetica', 'bold'); + doc.setFontSize(20); + doc.text(CostModel.eur(Math.round(i.price / 100) * 100), M, py + 19); + doc.setFont('helvetica', 'normal'); + doc.setFontSize(9); + doc.setTextColor(...MUTED); + doc.text('incl. btw, onder voorbehoud', M, py + 25); + } // Beeld van de woning const bx = 190, by = 18, bw = PW - M - bx, bh = 206; @@ -162,7 +164,7 @@ window.LightPdf = (() => { contactBand(doc, 240, d.url, `Bekijk ${d.label} online`); doc.setFontSize(7); doc.setTextColor(...MUTED); - doc.text('Dit ontwerp en de prijs zijn indicatief; hieraan kunnen geen rechten worden ontleend.', M, PH - 6); + doc.text(`Dit ontwerp${price ? ' en de prijs zijn' : ' is'} indicatief; hieraan kunnen geen rechten worden ontleend.`, M, PH - 6); } function process(doc, d) { diff --git a/js/light/light.js b/js/light/light.js index 9100309..a1720ce 100644 --- a/js/light/light.js +++ b/js/light/light.js @@ -8,8 +8,9 @@ // Light-versie voor de modelpagina's: één model in 3D, een paar keuzes en de kerncijfers; opslaan = PDF met // aanzichten en plattegrond. Alle logica in LightModel (en daarachter de gewone modellen). // Inbedden:
(vanzelf gemount), of -// TectumLight.mount(el, { model, frames, url, modelViewer, save }); url = adres voor de QR-code in de PDF (standaard de -// modelpagina), modelViewer = adres van model-viewer (standaard js/vendor naast dit script). +// TectumLight.mount(el, { model, frames, url, modelViewer, save, price }); url = adres voor de QR-code in de PDF (standaard +// de modelpagina), modelViewer = adres van model-viewer (standaard js/vendor naast dit script), price: false (of +// data-price="false") = geen prijs in beeld en in de PDF; design().info.price blijft er wel in. // save = { label, icon, onSave(ontwerp) } vervangt de PDF-knop (bijv. ontwerp aanvragen op de site); onSave krijgt // { design, label, key, info, choices, url }: design = house-design-JSON zoals de configurator die opslaat, choices = de // keuzes in woorden (zoals op het voorblad van de PDF). Zonder save blijft het de PDF. @@ -69,6 +70,7 @@ window.TectumLight = (() => { function mount(root, opts) { const o = opts || {}; const model = LightModel.create(o.model || root.dataset.model, { frames: o.frames }); + const showPrice = o.price !== false && root.dataset.price !== 'false'; let ch = clone(model.initial); let unitSel = model.base.units[0].id; let cur = null; // { st, parts, info } @@ -502,7 +504,7 @@ window.TectumLight = (() => { const kv = (k, v) => `
${k}${v}
`; $('.tl-facts').innerHTML = kv('Vloer bruto', `${nl(i.brutoM2, 1)} m²`) + kv('Leefbaar', `${nl(i.leefbaarM2, 1)} m²`) + kv('Inhoud', `${nl(i.inhoudM3, 0)} m³`) + kv('Gewicht', `${nl(Math.round(i.kg / 10) * 10, 0)} kg`); - $('.tl-buy').innerHTML = `
${CostModel.eur(Math.round(i.price / 100) * 100)}indicatief, incl. btw
+ $('.tl-buy').innerHTML = `
${showPrice ? `${CostModel.eur(Math.round(i.price / 100) * 100)}indicatief, incl. btw` : ''}
${o.save ? `` : ''}`; @@ -632,7 +634,7 @@ window.TectumLight = (() => { try { let image = null; try { image = snapshot(); } catch (err) { console.warn(err); } - LightPdf.generate({ st, label: model.label, info: cur.info, choices: LightModel.describe(model, ch, cur.st), url: pageUrl, image }) + LightPdf.generate({ st, label: model.label, info: cur.info, choices: LightModel.describe(model, ch, cur.st), url: pageUrl, image, price: showPrice }) .save(`${model.label.replace(/[^A-Za-z0-9_-]+/g, '-')}-${new Date().toISOString().slice(0, 10)}.pdf`); } catch (err) { console.error(err); @@ -669,11 +671,13 @@ window.TectumLight = (() => { io.observe(stage); // GLB van het ontwerp (afgewerkte woning zoals in 3D, maaiveld onder het midden = oorsprong); één keer per ontwerp. + // Alles onder het maaiveld (sandwichpanelen, vloerbalken) valt weg: AR zet het laagste punt op de grond. let glb = null; function makeGlb() { if (glb && glb.parts === cur.parts) return glb; if (glb) URL.revokeObjectURL(glb.url); - const out = as3d(() => GlbWriter.build(rootsOf(cur.parts), { name: model.label, origin: HouseModel.groundOrigin(cur.st, cur.parts) })); + const out = as3d(() => GlbWriter.build(rootsOf(cur.parts).filter(g => g !== cur.parts.sandwichGroup), + { name: model.label, origin: HouseModel.groundOrigin(cur.st, cur.parts), clipBelow: 0 })); glb = { parts: cur.parts, blob: out.blob, url: URL.createObjectURL(out.blob), stats: out.stats }; return glb; } @@ -702,7 +706,7 @@ window.TectumLight = (() => { // kader van position: fixed). De AR-knop van model-viewer verschijnt alleen als het toestel AR kan. const mvSrc = o.modelViewer || root.dataset.modelViewer || new URL('../vendor/model-viewer-umd.min.js', SCRIPT_SRC).href; let arView = null, arOpen = false; - const AR_NOTE = 'Ware grootte · met twee vingers verkleinen of draaien'; + const AR_NOTE = 'Ware grootte · met twee vingers draaien, met één vinger verplaatsen'; function closeAr() { if (!arOpen) return; arOpen = false; @@ -718,7 +722,7 @@ window.TectumLight = (() => { arView.setAttribute('role', 'dialog'); arView.setAttribute('aria-modal', 'true'); arView.innerHTML = ` + ar ar-modes="webxr scene-viewer quick-look" ar-scale="fixed" ar-placement="floor" xr-environment>