Spaces:
Running
Running
publish
Browse filesFiles changed (3)
- index.html+86-69
- render.jsAdded+146
- sw.js+2-2
123456338 unmodified lines34534634734834935047 unmodified lines39839940040140240340440521 unmodified lines4274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634648 unmodified lines47347447547647747847948048148248348448548648748848949049149249349449549649749849923 unmodified lines52352452552652752852953053153253353453553653753853935 unmodified lines57557657757857958033 unmodified lines61461561661761861962063 unmodified lines684685686687688689690691692693694203 unmodified lines8988999009019029039041 unmodified line9069079089099109119123 unmodified lines91691791891992092192292392492592692792892993093193293393493593693793828 unmodified lines96796896997097197297397497597697797897914 unmodified lines994995996997998999100010011002100310046 unmodified lines101110121013101410151016101763 unmodified lines1081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112424 unmodified lines1149115011511152115311541155115628 unmodified lines118511861187118811891190119111921193119411951196<!doctype html><html lang="en"><head><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>LUCE | Custom lab-grown diamonds, made to order</title>338 unmodified lines.x-callout { padding: 24px; }}/* live stage */.x-sum__photo, .x-sum__ref { display: none !important; }.x-stage { margin: 0 0 24px; }47 unmodified lines<main id="main"><section class="x-hero" aria-labelledby="hero-title"><img src="p-hero.jpg" alt="Cushion halo ring in white and rose gold on black" /><div class="x-wrap x-hero__copy"><h1 id="hero-title">Real diamond. Grown, not mined.</h1><p class="x-hero__sub">Set to order in gold and platinum. Certified, never simulant.</p><div class="x-callout" id="hero-callout">21 unmodified lines<ul class="x-films__row"><li class="x-film" data-preset="coin"><figure class="x-film__fig"><img src="ref-coin.jpg" alt="An 1854 US three dollar gold piece" width="900" height="900" loading="lazy" /><figcaption>The 1854 $3 gold piece the film ring was cut from. Smithsonian, public domain. <a href="https://www.denofgeek.com/culture/the-irishman-ring-explained/" target="_blank" rel="noopener">See it in the film</a></figcaption></figure><p class="x-film__name">The Coin</p><p class="x-film__src">Inspired by <cite>The Irishman</cite> (2019)</p><p class="x-film__text">A gold coin-face ring ringed with diamonds, the circle-of-trust ring.</p><p class="x-film__spec">Signet · 14k yellow · 1.00 ct · coin face · diamond rim</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Coin">Copy this</button></li><li class="x-film" data-preset="don"><figure class="x-film__fig"><img src="p-signet.jpg" alt="Gold signet ring on dark velvet" width="960" height="1200" loading="lazy" /><figcaption>Flush-set signet, priced in 18k. <a href="https://www.townandcountrymag.com/style/mens-fashion/a37937872/pinky-rings-meaning/" target="_blank" rel="noopener">Pinky ring history</a></figcaption></figure><p class="x-film__name">The Don</p><p class="x-film__src">Inspired by <cite>The Godfather</cite> (1972)</p><p class="x-film__text">A heavy signet, the ring they kiss.</p><p class="x-film__spec">Signet · 18k yellow · 1.50 ct · hand-engraved face</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Don">Copy this</button></li><li class="x-film" data-preset="vegas"><figure class="x-film__fig"><img src="p-pinky.jpg" alt="Diamond ring on black, stone set high" width="960" height="1200" loading="lazy" /><figcaption><img class="x-refthumb" src="ref-vegas.jpg" alt="Reference: stone pinky on a suited hand" width="48" height="48" loading="lazy" />Reference: stone pinky. Photo, Pexels.</figcaption></figure><p class="x-film__name">The Vegas Pinky</p><p class="x-film__src">Inspired by <cite>Casino</cite> (1995)</p><p class="x-film__text">A big diamond on the little finger, 1970s Strip style.</p><p class="x-film__spec">Pinky ring · 18k yellow · 2.00 ct · bezel</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Vegas Pinky">Copy this</button></li><li class="x-film" data-preset="jersey"><figure class="x-film__fig"><img src="p-jersey.jpg" alt="Gold pinky ring on dark velvet" width="960" height="1200" loading="lazy" /><figcaption><img class="x-refthumb" src="ref-jersey.jpg" alt="Reference: gold ring with a dark stone" width="48" height="48" loading="lazy" />Reference: gold pinky, dark stone. Photo, Unsplash.<a href="https://www.vogue.com/article/i-love-pinky-rings-diddy-tony-soprano" target="_blank" rel="noopener">See it on the show</a></figcaption></figure><p class="x-film__name">The Jersey Pinky</p><p class="x-film__src">Inspired by <cite>The Sopranos</cite> (1999)</p><p class="x-film__text">Tony wore a ruby. This one carries a lab diamond in the same heavy gold.</p><p class="x-film__spec">Pinky ring · 14k yellow · 1.00 ct</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Jersey Pinky">Copy this</button></li>8 unmodified lines<div class="x-head"><h2 id="pieces-title">The Pieces</h2></div><div class="x-grid"><button type="button" class="x-card" data-piece="Signet"><span class="x-media"><span>The Signet</span><img src="p-signet.jpg" alt="Gold signet ring on dark velvet" width="960" height="1200" loading="lazy" /></span><span class="x-card__body"><span class="x-card__title">The Signet</span><span class="x-card__text">A men's signet, flush-set with a single stone.</span><span class="x-card__from" data-from="Signet">From $1,770</span><span class="x-card__eta">Ready in 3 to 4 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Pinky ring"><span class="x-media"><span>Pinky</span><img src="p-pinky.jpg" alt="Diamond ring on black, stone set high" width="960" height="1200" loading="lazy" /></span><span class="x-card__body"><span class="x-card__title">The Pinky</span><span class="x-card__text">Small face, one diamond, worn on the left hand.</span><span class="x-card__from" data-from="Pinky ring">From $1,470</span><span class="x-card__eta">Ready in 3 to 4 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Tennis chain"><span class="x-media"><span>The Tennis Chain</span><img src="p-chain.jpg" alt="Diamond line chain on black" width="960" height="1200" loading="lazy" /></span><span class="x-card__body"><span class="x-card__title">The Tennis Chain</span><span class="x-card__text">Four-prong links, 3mm to 5mm, any length.</span><span class="x-card__from" data-from="Tennis chain">From $2,540</span><span class="x-card__eta">Ready in 2 to 3 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Tennis bracelet"><span class="x-media"><span>The Tennis Bracelet</span><img src="p-bracelet.jpg" alt="Diamond line bracelet on black, close" width="960" height="1200" loading="lazy" /></span><span class="x-card__body"><span class="x-card__title">The Tennis Bracelet</span><span class="x-card__text">Line bracelet, box clasp with safety.</span><span class="x-card__from" data-from="Tennis bracelet">From $1,660</span><span class="x-card__eta">Ready in 2 to 3 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Solitaire"><span class="x-media"><span>The Solitaire</span><img src="p-solitaire.jpg" alt="Cushion solitaire ring on black" width="960" height="1200" loading="lazy" /></span><span class="x-card__body"><span class="x-card__title">The Solitaire</span><span class="x-card__text">Six-prong or four-prong, the stone sits high.</span><span class="x-card__from" data-from="Solitaire">From $1,270</span><span class="x-card__eta">Ready in 3 to 4 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Halo"><span class="x-media"><span>The Halo</span><img src="p-halo.jpg" alt="Halo ring with pavé band on black" width="960" height="1200" loading="lazy" /></span><span class="x-card__body"><span class="x-card__title">The Halo</span><span class="x-card__text">Cushion centre, pavé halo, matching band.</span><span class="x-card__from" data-from="Halo">From $1,570</span><span class="x-card__eta">Ready in 4 to 5 weeks</span><span class="x-card__go">Start this piece</span></span></button></div>23 unmodified lines<div class="x-stage x-stage--mob" data-stage><div class="x-stage__frame"><img class="x-stage__img is-on" src="p-halo.jpg" alt="" width="960" height="1200" /><img class="x-stage__img" src="p-halo.jpg" alt="" width="960" height="1200" aria-hidden="true" /><p class="x-stage__chip"><i class="x-stage__sw"></i><span class="x-stage__txt">Choose a piece</span></p></div><div class="x-stage__tabs" role="group" aria-label="View"><button type="button" data-view="studio" aria-pressed="true">Studio</button><button type="button" data-view="worn" aria-pressed="false">Real life</button></div></div><div class="x-fields"><fieldset id="f-piece"><legend>Piece</legend><div class="x-opts"><label class="x-opt"><input type="radio" name="piece" value="Signet" required /><span>Signet</span></label><label class="x-opt"><input type="radio" name="piece" value="Pinky ring" /><span>Pinky ring</span></label><label class="x-opt"><input type="radio" name="piece" value="Tennis chain" /><span>Tennis chain</span></label><label class="x-opt"><input type="radio" name="piece" value="Tennis bracelet" /><span>Tennis bracelet</span></label>35 unmodified lines<label class="x-opt"><input type="radio" name="colour" value="D-F" /><span>D-F</span></label><label class="x-opt"><input type="radio" name="colour" value="G-H" checked /><span>G-H</span></label><label class="x-opt"><input type="radio" name="colour" value="I-J" /><span>I-J</span></label></div></div><div>33 unmodified lines<label class="x-opt x-addon" data-addon="side"><input type="checkbox" name="addon" value="side" /><span>Side stones, two 0.25 ct <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="halo"><input type="checkbox" name="addon" value="halo" /><span>Hidden halo <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="rim"><input type="checkbox" name="addon" value="rim" /><span>Diamond rim, 25 stones <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="coin"><input type="checkbox" name="addon" value="coin" /><span>Coin face <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="handeng"><input type="checkbox" name="addon" value="handeng" /><span>Hand-engraved face or monogram <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="bezel"><input type="checkbox" name="addon" value="bezel" /><span>Bezel setting <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="finish"><input type="checkbox" name="addon" value="finish" /><span>Matte or hammered finish <b data-addon-price></b></span></label>63 unmodified lines<div id="sum-price-wrap" aria-live="polite" hidden><div class="x-stage x-stage--desk" data-stage><div class="x-stage__frame"><img class="x-stage__img is-on" src="p-halo.jpg" alt="" width="960" height="1200" /><img class="x-stage__img" src="p-halo.jpg" alt="" width="960" height="1200" aria-hidden="true" /><p class="x-stage__chip"><i class="x-stage__sw"></i><span class="x-stage__txt">Choose a piece</span></p></div><div class="x-stage__tabs" role="group" aria-label="View"><button type="button" data-view="studio" aria-pressed="true">Studio</button><button type="button" data-view="worn" aria-pressed="false">Real life</button></div></div><figure class="x-sum__photo" id="sum-photo" hidden><img id="sum-photo-img" src="" alt="" width="400" height="300" /><figcaption class="x-sum__ref" id="sum-photo-cap" hidden>Your reference</figcaption></figure><p class="x-sum__ref" id="sum-ref" hidden><img id="sum-ref-img" src="" alt="" width="56" height="56" />Your reference</p>203 unmodified lines/* Pricing: edit numbers here. Stone is [carat, $] points, interpolated linearly; past the last point it extends at the last slope. */var PRICING = {stone: [[0.25, 150], [0.5, 260], [1, 520], [1.5, 900], [2, 1180], [3, 2150], [4, 3050], [5, 3950]],setting: { "Signet": 1250, "Pinky ring": 950, "Solitaire": 750, "Halo": 1050, "Band": 650, "Studs": 350, "Tennis chain": 1400, "Tennis bracelet": 900, "Something else": 900 },metal: { "10k": 0.85, "14k": 1.0, "18k": 1.35, "platinum": 1.6 },perCtw: { "10k": 340, "14k": 380, "18k": 480, "platinum": 560 },ctwPieces: ["Band", "Tennis chain", "Tennis bracelet"],1 unmodified lineengraving: 75,offer: { pct: 10, until: "2026-11-30", label: "Opening offer, 10% off" },shape: { "Round": 1, "Oval": 0.92, "Pear": 0.92, "Marquise": 0.92, "Asscher": 0.92, "Emerald": 0.9, "Cushion": 0.9, "Radiant": 0.9, "Princess": 0.88 },colour: { "D-F": 1.15, "G-H": 1, "I-J": 0.85 },clarity: { "VVS": 1.2, "VS": 1, "SI": 0.85 },cert: { "IGI": 0, "GIA": 150 },bigSize: { from: 13, add: 90 },3 unmodified linesside: { label: "Side stones, two 0.25 ct", side: true, amt: 120, rings: true },halo: { label: "Hidden halo", amt: 220, rings: true },rim: { label: "Diamond rim, 25 stones", amt: 480, only: ["Signet", "Pinky ring"] },coin: { label: "Coin face", amt: 350, metal: true, only: ["Signet", "Pinky ring"] },handeng: { label: "Hand-engraved face or monogram", amt: 180 },bezel: { label: "Bezel setting", amt: 90 },finish: { label: "Matte or hammered finish", amt: 60 },rush: { label: "Rush, two weeks sooner", amt: 200, rush: true }},roundTo: 10,fromSpec: { "Signet": 1, "Pinky ring": 1, "Solitaire": 1, "Halo": 1, "Band": 1, "Studs": 0.5, "Tennis chain": 3, "Tennis bracelet": 2, "Something else": 1 }};/* Flat deposit in dollars, the same for every piece. */var DEPOSIT = 250;/* Presets for "Rings from the films". Prices come from PRICING at run time. The configurator has no setting choice, so setting goes in notes. */var FILM_PRESETS = [{ id: "coin", piece: "Signet", metal: "14k yellow", carat: 1.0, addons: ["coin", "rim"], img: "ref-coin.jpg", notes: "The Coin: coin face, 25 diamonds around the rim" },{ id: "don", piece: "Signet", metal: "18k yellow", carat: 1.5, addons: ["handeng"], img: "p-signet.jpg", notes: "The Don: flush-set single stone" },{ id: "vegas", piece: "Pinky ring", metal: "18k yellow", carat: 2.0, addons: ["bezel"], img: "p-pinky.jpg", notes: "The Vegas Pinky" },{ id: "jersey", piece: "Pinky ring", metal: "14k yellow", carat: 1.0, addons: [], img: "p-jersey.jpg", notes: "The Jersey Pinky" }];var DEPOSIT_URL = "https://payhip.com/b/x9a2h";var FORM_ENDPOINT = "https://luce-atelier.netlify.app/";28 unmodified linesif (engraved) raw += PRICING.engraving;return roundUp(raw);}var RINGS = ["Signet", "Pinky ring", "Solitaire", "Halo", "Band"];function addonApplies(k, piece) {var a = PRICING.addons[k]; if (!a) return false;if (a.only) return a.only.indexOf(piece) > -1;if (a.rings) return RINGS.indexOf(piece) > -1;return true;}function addonAmt(k, spec) {var a = PRICING.addons[k], m = metalKey(spec.metal);if (a.side) return 2 * stone(0.25) * (PRICING.colour[spec.colour] || 1) * (PRICING.clarity[spec.clarity] || 1) + a.amt;14 unmodified lineslines.push(["Diamonds, " + ct.toFixed(2) + " ctw " + desc, ct * PRICING.perCtw[m] * q * len]);} else if (PRICING.pairPieces.indexOf(piece) > -1) {lines.push(["Two stones, " + ct.toFixed(2) + " ct each " + desc, 2 * stone(ct) * q]);} else {lines.push(["Center stone, " + ct.toFixed(2) + " ct " + desc, stone(ct) * q]);}var cert = PRICING.cert[spec.cert] || 0;lines.push([(spec.cert || "IGI") + " certificate", cert * (PRICING.pairPieces.indexOf(piece) > -1 ? 2 : 1)]);(spec.addons || []).forEach(function (k) { if (addonApplies(k, piece)) lines.push([PRICING.addons[k].label, addonAmt(k, spec)]); });if (spec.engraved) lines.push(["Inside engraving", PRICING.engraving]);if (RINGS.indexOf(piece) > -1 && Number(spec.size) >= PRICING.bigSize.from) lines.push(["Size " + spec.size, PRICING.bigSize.add * PRICING.metal[m]]);6 unmodified linesfunction deposit() { return DEPOSIT; }function usd(n) { return "$" + n.toLocaleString("en-US"); }function wasNow(c) { return c.off ? '<s class="x-was">' + usd(c.list) + '</s><span class="x-now">' + usd(c.total) + '</span><span class="x-save">Save ' + usd(c.off) + " (" + PRICING.offer.pct + "%)</span>" : '<span class="x-now">' + usd(c.total) + "</span>"; }window.LucePrice = { price: price, calc: calc, wasNow: wasNow, offerLive: offerLive, addonApplies: addonApplies, addonAmt: addonAmt, deposit: deposit, usd: usd };document.querySelectorAll("[data-from]").forEach(function (el) {var k = el.dataset.from; el.innerHTML = "From " + wasNow(calc({ piece: k, ct: PRICING.fromSpec[k], metal: "14k", addons: [] }));63 unmodified linesreturn { price: c.total, deposit: P.deposit(c.total), lines: c.lines, c: c };}var PHOTOS = {"Signet": ["p-signet.jpg", "w-signet.jpg"], "Pinky ring": ["p-pinky.jpg", "w-pinky.jpg"],"Tennis chain": ["p-chain.jpg", ""], "Tennis bracelet": ["p-bracelet.jpg", "w-bracelet.jpg"],"Solitaire": ["p-solitaire.jpg", "w-solitaire.jpg"], "Halo": ["p-halo.jpg", "w-halo.jpg"],"Band": ["p-band.jpg", ""], "Studs": ["p-studs.jpg", ""], "Something else": ["p-hero.jpg", ""]};var stageView = "studio";function mmFor(ct) { return (6.5 * Math.cbrt(ct)).toFixed(1); }function paintStage() {var piece = (form.querySelector('input[name="piece"]:checked') || {}).value || "";var shape = (form.querySelector('input[name="shape"]:checked') || {}).value || "";var metalIn = form.querySelector('input[name="metal"]:checked');var ct = parseFloat(carat.value) || 0;var set = PHOTOS[piece] || ["p-halo.jpg", ""];var ref = activeRef && activeRef.piece === piece ? activeRef.img : "";var worn = set[1];var src = stageView === "worn" && worn ? worn : (ref || set[0]);var bits = [];if (piece) bits.push(piece);if (piece && ct) bits.push(ct.toFixed(2) + (/Tennis/.test(piece) ? " ctw" : " ct") + (shape ? " " + shape.toLowerCase() : ""));if (piece && ct && !/Tennis/.test(piece)) bits.push("about " + mmFor(ct) + " mm");if (metalIn) bits.push(metalIn.value);var txt = bits.length ? bits.join(" \u00b7 ") : "Choose a piece";document.querySelectorAll("[data-stage]").forEach(function (st) {var imgs = st.querySelectorAll(".x-stage__img"), on = st.querySelector(".x-stage__img.is-on"), off = on === imgs[0] ? imgs[1] : imgs[0];if (on.getAttribute("src") !== src) {off.onload = function () { off.classList.add("is-on"); on.classList.remove("is-on"); off.removeAttribute("aria-hidden"); on.setAttribute("aria-hidden", "true"); };off.src = src; off.alt = piece || "LUCE piece";}var chip = st.querySelector(".x-stage__chip"), t = st.querySelector(".x-stage__txt");if (t.textContent !== txt) { t.textContent = txt; chip.classList.remove("is-pulse"); void chip.offsetWidth; chip.classList.add("is-pulse"); }var sw = st.querySelector(".x-stage__sw"), msw = metalIn && metalIn.parentNode.querySelector(".x-sw");sw.style.background = msw ? msw.style.background : "#c9a56b";var wb = st.querySelector('[data-view="worn"]'); wb.disabled = !worn;st.querySelectorAll("[data-view]").forEach(function (b) { b.setAttribute("aria-pressed", String(b.dataset.view === (worn ? stageView : "studio"))); });});}document.querySelectorAll("[data-view]").forEach(function (b) { b.addEventListener("click", function () { stageView = b.dataset.view; paintStage(); }); });function update() {var piece = val("piece");var isChain = piece === "Tennis chain", isBrace = piece === "Tennis bracelet";24 unmodified linesform.querySelectorAll(".x-addon").forEach(function (lab) {var k = lab.dataset.addon, ok = !piece || P.addonApplies(k, piece);lab.hidden = !ok;lab.querySelector("[data-addon-price]").textContent = "+" + P.usd(Math.round(P.addonAmt(k, specA)));});var ph = document.getElementById("sum-photo"), phi = document.getElementById("sum-photo-img");var card = piece && document.querySelector('.x-card[data-piece="' + piece + '"] img');var src = activeRef && activeRef.piece === piece ? activeRef.img : (card ? card.getAttribute("src") : "");28 unmodified linesvar presetNotes = "";FILM_PRESETS.forEach(function (sp) {var card = document.querySelector('.x-film[data-preset="' + sp.id + '"]'); if (!card) return;card.querySelector("[data-preset-price]").innerHTML = P.wasNow(P.calc({ piece: sp.piece, ct: sp.carat, metal: sp.metal, addons: sp.addons }));card.querySelector("[data-preset-go]").addEventListener("click", function () {var r = form.querySelector('input[type="radio"][name="piece"][value="' + sp.piece + '"]');var m = form.querySelector('input[type="radio"][name="metal"][value="' + sp.metal + '"]');if (r) r.checked = true;if (m) m.checked = true;carat.value = sp.carat; carat.dataset.moved = "1";form.querySelectorAll('input[name="addon"]').forEach(function (i) { i.checked = sp.addons.indexOf(i.value) > -1; });activeRef = { piece: sp.piece, img: sp.img, notes: sp.notes };1234567338 unmodified lines34634734834935035135235335435535635735835936036136236336436536636736836937037137247 unmodified lines42042142242342442542642721 unmodified lines4494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854868 unmodified lines49549649749849950050150250350450550650750850951051151251351451551651751851952052123 unmodified lines54554654754854955055155255355455555655755855956035 unmodified lines59659759859960060160233 unmodified lines63663763863964064164264364463 unmodified lines708709710711712713714715716203 unmodified lines9209219229239249259261 unmodified line9289299309319329339343 unmodified lines93893994094194294394494594694794894995095195295395495595695795895996096196228 unmodified lines9919929939949959969979989991000100110021003100414 unmodified lines101910201021102210231024102510261027102810296 unmodified lines103610371038103910401041104263 unmodified lines11061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113824 unmodified lines116311641165116611671168116911701171117228 unmodified lines1201120212031204120512061207120812091210121112121213<!doctype html><html lang="en"><head><script src="render.js"></script><meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" /><title>LUCE | Custom lab-grown diamonds, made to order</title>338 unmodified lines.x-callout { padding: 24px; }}.x-render { display: block; background: #14110f; }.x-render svg, .x-stage__svg svg { display: block; width: 100%; height: 100%; }.x-hero > .x-render { position: absolute; inset: 0; }.x-media .x-render { position: absolute; inset: 0; transition: transform 1.4s var(--ease); }.x-card:hover .x-media .x-render { transform: scale(1.04); }.x-film__fig .x-render { aspect-ratio: 4 / 5; }.x-stage__svg { position: absolute; inset: 0; transition: opacity 0.25s var(--ease); }.x-stage__svg.is-swap { opacity: 0.25; }.x-hero::after { display: none; }.x-hero > .x-render { display: none; }.x-hero__piece { position: relative; width: min(300px, 72vw); aspect-ratio: 4 / 5; margin: 0 auto 32px; border: 1px solid rgba(176,141,87,0.45); }@media (min-width: 961px) {.x-hero { align-items: center; }.x-hero__copy { display: grid; grid-template-columns: 1fr minmax(320px, 420px); column-gap: 64px; align-items: center; text-align: left; padding-block: 96px; }.x-hero__copy > * { grid-column: 1; }.x-hero__copy > .x-hero__piece { grid-column: 2; grid-row: 1 / span 4; width: 100%; margin: 0; }.x-hero h1, .x-hero__sub { margin-left: 0; }.x-hero__copy #hero-callout { margin-left: 0; }}/* live stage */.x-sum__photo, .x-sum__ref { display: none !important; }.x-stage { margin: 0 0 24px; }47 unmodified lines<main id="main"><section class="x-hero" aria-labelledby="hero-title"><div class="x-wrap x-hero__copy"><span class="x-render x-hero__piece" data-spec='{"piece": "Halo", "shape": "Cushion", "ct": 1.5, "metal": "14k white"}'></span><h1 id="hero-title">Real diamond. Grown, not mined.</h1><p class="x-hero__sub">Set to order in gold and platinum. Certified, never simulant.</p><div class="x-callout" id="hero-callout">21 unmodified lines<ul class="x-films__row"><li class="x-film" data-preset="coin"><figure class="x-film__fig"><span class="x-render" data-spec='{"piece": "Signet", "shape": "Round", "ct": 0.25, "metal": "14k yellow", "addons": ["coin", "rim"]}'></span><figcaption><img class="x-refthumb" src="ref-coin.jpg" alt="The 1854 three dollar gold piece" width="48" height="48" loading="lazy" />Film ring: 14k gold, a $3 Liberty coin, 25 diamonds. <a href="https://www.townandcountrymag.com/style/jewelry-and-watches/a29960694/the-irishman-pinky-rings/" rel="noopener">Source</a></figcaption></figure><p class="x-film__name">The Coin</p><p class="x-film__src">Inspired by <cite>The Irishman</cite> (2019)</p><p class="x-film__text">A Liberty coin face in 14k gold, ringed with 25 lab diamonds, the circle-of-trust ring.</p><p class="x-film__spec">Signet · 14k yellow · coin face · 25-diamond rim</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Coin">Copy this</button></li><li class="x-film" data-preset="don"><figure class="x-film__fig"><span class="x-render" data-spec='{"piece": "Cigar band", "shape": "Round", "ct": 0.5, "metal": "18k yellow", "addons": []}'></span><figcaption>Film ring: a plain domed cigar band, worn through the film. <a href="https://www.studioauctions.com/Marlon_Brando_Ring_from_The_Godfather-LOT424.aspx" rel="noopener">Source</a></figcaption></figure><p class="x-film__name">The Don</p><p class="x-film__src">Inspired by <cite>The Godfather</cite> (1972)</p><p class="x-film__text">The ring Bonasera kisses: a wide, plain, domed gold band. Made here in solid 18k, with one flush diamond as an option.</p><p class="x-film__spec">Cigar band · 18k yellow · plain</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Don">Copy this</button></li><li class="x-film" data-preset="vegas"><figure class="x-film__fig"><span class="x-render" data-spec='{"piece": "Pinky ring", "shape": "Emerald", "ct": 2, "metal": "14k yellow", "colour": "Blue", "addons": []}'></span><figcaption>Film ring: 14k yellow gold, a blue emerald-cut stone. <a href="https://bamfstyle.com/2025/11/14/casino-ace/" rel="noopener">Source</a></figcaption></figure><p class="x-film__name">The Vegas Pinky</p><p class="x-film__src">Inspired by <cite>Casino</cite> (1995)</p><p class="x-film__text">Ace wore a blue emerald-cut on the little finger. Here the stone is a blue lab-grown diamond.</p><p class="x-film__spec">Pinky ring · 14k yellow · 2.00 ct blue emerald-cut</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Vegas Pinky">Copy this</button></li><li class="x-film" data-preset="jersey"><figure class="x-film__fig"><span class="x-render" data-spec='{"piece": "Pinky ring", "shape": "Round", "ct": 0.5, "metal": "14k yellow", "addons": ["ruby"]}'></span><figcaption>Show ring: gold pinky, a ruby and a diamond clustered. <a href="https://bamfstyle.com/2016/06/10/tony-soprano-finale" rel="noopener">Source</a></figcaption></figure><p class="x-film__name">The Jersey Pinky</p><p class="x-film__src">Inspired by <cite>The Sopranos</cite> (1999)</p><p class="x-film__text">Tony's right-pinky ring: a pear ruby beside a round diamond in heavy gold. Lab ruby, lab diamond, 14k.</p><p class="x-film__spec">Pinky ring · 14k yellow · pear lab ruby · 0.50 ct</p><p class="x-film__price" data-preset-price> </p><button type="button" class="x-btn" data-preset-go aria-label="Copy The Jersey Pinky">Copy this</button></li>8 unmodified lines<div class="x-head"><h2 id="pieces-title">The Pieces</h2></div><div class="x-grid"><button type="button" class="x-card" data-piece="Signet"><span class="x-media"><span>The Signet</span><span class="x-render" data-spec='{"piece": "Signet", "shape": "Round", "ct": 0.5, "metal": "18k yellow"}'></span></span><span class="x-card__body"><span class="x-card__title">The Signet</span><span class="x-card__text">A men's signet, flush-set with a single stone.</span><span class="x-card__from" data-from="Signet">From $1,770</span><span class="x-card__eta">Ready in 3 to 4 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Pinky ring"><span class="x-media"><span>Pinky</span><span class="x-render" data-spec='{"piece": "Pinky ring", "shape": "Round", "ct": 1, "metal": "14k yellow"}'></span></span><span class="x-card__body"><span class="x-card__title">The Pinky</span><span class="x-card__text">Small face, one diamond, worn on the left hand.</span><span class="x-card__from" data-from="Pinky ring">From $1,470</span><span class="x-card__eta">Ready in 3 to 4 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Tennis chain"><span class="x-media"><span>The Tennis Chain</span><span class="x-render" data-spec='{"piece": "Tennis chain", "shape": "Round", "ct": 10, "metal": "14k white"}'></span></span><span class="x-card__body"><span class="x-card__title">The Tennis Chain</span><span class="x-card__text">Four-prong links, 3mm to 5mm, any length.</span><span class="x-card__from" data-from="Tennis chain">From $2,540</span><span class="x-card__eta">Ready in 2 to 3 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Tennis bracelet"><span class="x-media"><span>The Tennis Bracelet</span><span class="x-render" data-spec='{"piece": "Tennis bracelet", "shape": "Round", "ct": 5, "metal": "14k white"}'></span></span><span class="x-card__body"><span class="x-card__title">The Tennis Bracelet</span><span class="x-card__text">Line bracelet, box clasp with safety.</span><span class="x-card__from" data-from="Tennis bracelet">From $1,660</span><span class="x-card__eta">Ready in 2 to 3 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Solitaire"><span class="x-media"><span>The Solitaire</span><span class="x-render" data-spec='{"piece": "Solitaire", "shape": "Oval", "ct": 1.5, "metal": "Platinum"}'></span></span><span class="x-card__body"><span class="x-card__title">The Solitaire</span><span class="x-card__text">Six-prong or four-prong, the stone sits high.</span><span class="x-card__from" data-from="Solitaire">From $1,270</span><span class="x-card__eta">Ready in 3 to 4 weeks</span><span class="x-card__go">Start this piece</span></span></button><button type="button" class="x-card" data-piece="Halo"><span class="x-media"><span>The Halo</span><span class="x-render" data-spec='{"piece": "Halo", "shape": "Cushion", "ct": 1.5, "metal": "14k white"}'></span></span><span class="x-card__body"><span class="x-card__title">The Halo</span><span class="x-card__text">Cushion centre, pavé halo, matching band.</span><span class="x-card__from" data-from="Halo">From $1,570</span><span class="x-card__eta">Ready in 4 to 5 weeks</span><span class="x-card__go">Start this piece</span></span></button></div>23 unmodified lines<div class="x-stage x-stage--mob" data-stage><div class="x-stage__frame"><div class="x-stage__svg"></div><p class="x-stage__chip"><i class="x-stage__sw"></i><span class="x-stage__txt">Choose a piece</span></p></div></div><div class="x-fields"><fieldset id="f-piece"><legend>Piece</legend><div class="x-opts"><label class="x-opt"><input type="radio" name="piece" value="Signet" required /><span>Signet</span></label><label class="x-opt"><input type="radio" name="piece" value="Cigar band" /><span>Cigar band</span></label><label class="x-opt"><input type="radio" name="piece" value="Pinky ring" /><span>Pinky ring</span></label><label class="x-opt"><input type="radio" name="piece" value="Tennis chain" /><span>Tennis chain</span></label><label class="x-opt"><input type="radio" name="piece" value="Tennis bracelet" /><span>Tennis bracelet</span></label>35 unmodified lines<label class="x-opt"><input type="radio" name="colour" value="D-F" /><span>D-F</span></label><label class="x-opt"><input type="radio" name="colour" value="G-H" checked /><span>G-H</span></label><label class="x-opt"><input type="radio" name="colour" value="I-J" /><span>I-J</span></label><label class="x-opt"><input type="radio" name="colour" value="Blue" /><span>Fancy blue</span></label></div></div><div>33 unmodified lines<label class="x-opt x-addon" data-addon="side"><input type="checkbox" name="addon" value="side" /><span>Side stones, two 0.25 ct <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="halo"><input type="checkbox" name="addon" value="halo" /><span>Hidden halo <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="rim"><input type="checkbox" name="addon" value="rim" /><span>Diamond rim, 25 stones <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="coin"><input type="checkbox" name="addon" value="coin" /><span>Liberty coin face, cast replica <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="ruby"><input type="checkbox" name="addon" value="ruby" /><span>Pear lab ruby, bypass <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="flush"><input type="checkbox" name="addon" value="flush" /><span>One flush-set diamond <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="handeng"><input type="checkbox" name="addon" value="handeng" /><span>Hand-engraved face or monogram <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="bezel"><input type="checkbox" name="addon" value="bezel" /><span>Bezel setting <b data-addon-price></b></span></label><label class="x-opt x-addon" data-addon="finish"><input type="checkbox" name="addon" value="finish" /><span>Matte or hammered finish <b data-addon-price></b></span></label>63 unmodified lines<div id="sum-price-wrap" aria-live="polite" hidden><div class="x-stage x-stage--desk" data-stage><div class="x-stage__frame"><div class="x-stage__svg"></div><p class="x-stage__chip"><i class="x-stage__sw"></i><span class="x-stage__txt">Choose a piece</span></p></div></div><figure class="x-sum__photo" id="sum-photo" hidden><img id="sum-photo-img" src="" alt="" width="400" height="300" /><figcaption class="x-sum__ref" id="sum-photo-cap" hidden>Your reference</figcaption></figure><p class="x-sum__ref" id="sum-ref" hidden><img id="sum-ref-img" src="" alt="" width="56" height="56" />Your reference</p>203 unmodified lines/* Pricing: edit numbers here. Stone is [carat, $] points, interpolated linearly; past the last point it extends at the last slope. */var PRICING = {stone: [[0.25, 150], [0.5, 260], [1, 520], [1.5, 900], [2, 1180], [3, 2150], [4, 3050], [5, 3950]],setting: { "Signet": 1250, "Cigar band": 1600, "Pinky ring": 950, "Solitaire": 750, "Halo": 1050, "Band": 650, "Studs": 350, "Tennis chain": 1400, "Tennis bracelet": 900, "Something else": 900 },metal: { "10k": 0.85, "14k": 1.0, "18k": 1.35, "platinum": 1.6 },perCtw: { "10k": 340, "14k": 380, "18k": 480, "platinum": 560 },ctwPieces: ["Band", "Tennis chain", "Tennis bracelet"],1 unmodified lineengraving: 75,offer: { pct: 10, until: "2026-11-30", label: "Opening offer, 10% off" },shape: { "Round": 1, "Oval": 0.92, "Pear": 0.92, "Marquise": 0.92, "Asscher": 0.92, "Emerald": 0.9, "Cushion": 0.9, "Radiant": 0.9, "Princess": 0.88 },colour: { "D-F": 1.15, "G-H": 1, "I-J": 0.85, "Blue": 1.8 },clarity: { "VVS": 1.2, "VS": 1, "SI": 0.85 },cert: { "IGI": 0, "GIA": 150 },bigSize: { from: 13, add: 90 },3 unmodified linesside: { label: "Side stones, two 0.25 ct", side: true, amt: 120, rings: true },halo: { label: "Hidden halo", amt: 220, rings: true },rim: { label: "Diamond rim, 25 stones", amt: 480, only: ["Signet", "Pinky ring"] },coin: { label: "Liberty coin face, cast replica", amt: 350, metal: true, only: ["Signet", "Pinky ring"] },ruby: { label: "Pear lab ruby, bypass set", amt: 190, only: ["Pinky ring", "Signet"] },flush: { label: "One flush-set diamond", amt: 0, only: ["Cigar band"] },handeng: { label: "Hand-engraved face or monogram", amt: 180 },bezel: { label: "Bezel setting", amt: 90 },finish: { label: "Matte or hammered finish", amt: 60 },rush: { label: "Rush, two weeks sooner", amt: 200, rush: true }},roundTo: 10,fromSpec: { "Signet": 1, "Cigar band": 1, "Pinky ring": 1, "Solitaire": 1, "Halo": 1, "Band": 1, "Studs": 0.5, "Tennis chain": 3, "Tennis bracelet": 2, "Something else": 1 }};/* Flat deposit in dollars, the same for every piece. */var DEPOSIT = 250;/* Presets for "Rings from the films". Prices come from PRICING at run time. The configurator has no setting choice, so setting goes in notes. */var FILM_PRESETS = [{ id: "coin", piece: "Signet", metal: "14k yellow", shape: "Round", colour: "G-H", carat: 0.25, addons: ["coin", "rim"], img: "ref-coin.jpg", notes: "The Coin: Liberty coin face, 25 diamonds around it, 14k" },{ id: "don", piece: "Cigar band", metal: "18k yellow", shape: "Round", colour: "G-H", carat: 0.5, addons: [], img: "", notes: "The Don: wide domed cigar band, plain gold" },{ id: "vegas", piece: "Pinky ring", metal: "14k yellow", shape: "Emerald", colour: "Blue", carat: 2.0, addons: [], img: "", notes: "The Vegas Pinky: blue emerald-cut, 14k yellow" },{ id: "jersey", piece: "Pinky ring", metal: "14k yellow", shape: "Round", colour: "G-H", carat: 0.5, addons: ["ruby"], img: "", notes: "The Jersey Pinky: pear ruby and round diamond, bypass" }];var DEPOSIT_URL = "https://payhip.com/b/x9a2h";var FORM_ENDPOINT = "https://luce-atelier.netlify.app/";28 unmodified linesif (engraved) raw += PRICING.engraving;return roundUp(raw);}var RINGS = ["Signet", "Cigar band", "Pinky ring", "Solitaire", "Halo", "Band"];function addonApplies(k, piece) {var a = PRICING.addons[k]; if (!a) return false;if (a.only) return a.only.indexOf(piece) > -1;if (a.rings) return RINGS.indexOf(piece) > -1;return true;}function noStone(spec, piece) { var a = spec.addons || []; return a.indexOf("coin") > -1 && piece !== "Cigar band" || piece === "Cigar band" && a.indexOf("flush") < 0; }function addonAmt(k, spec) {var a = PRICING.addons[k], m = metalKey(spec.metal);if (a.side) return 2 * stone(0.25) * (PRICING.colour[spec.colour] || 1) * (PRICING.clarity[spec.clarity] || 1) + a.amt;14 unmodified lineslines.push(["Diamonds, " + ct.toFixed(2) + " ctw " + desc, ct * PRICING.perCtw[m] * q * len]);} else if (PRICING.pairPieces.indexOf(piece) > -1) {lines.push(["Two stones, " + ct.toFixed(2) + " ct each " + desc, 2 * stone(ct) * q]);} else if (!noStone(spec, piece)) {lines.push(["Center stone, " + ct.toFixed(2) + " ct " + desc, stone(ct) * q]);}var cert = noStone(spec, piece) ? 0 : PRICING.cert[spec.cert] || 0;if (!noStone(spec, piece) || (spec.addons || []).indexOf("rim") > -1) lines.push([(spec.cert || "IGI") + " certificate", cert * (PRICING.pairPieces.indexOf(piece) > -1 ? 2 : 1)]);(spec.addons || []).forEach(function (k) { if (addonApplies(k, piece)) lines.push([PRICING.addons[k].label, addonAmt(k, spec)]); });if (spec.engraved) lines.push(["Inside engraving", PRICING.engraving]);if (RINGS.indexOf(piece) > -1 && Number(spec.size) >= PRICING.bigSize.from) lines.push(["Size " + spec.size, PRICING.bigSize.add * PRICING.metal[m]]);6 unmodified linesfunction deposit() { return DEPOSIT; }function usd(n) { return "$" + n.toLocaleString("en-US"); }function wasNow(c) { return c.off ? '<s class="x-was">' + usd(c.list) + '</s><span class="x-now">' + usd(c.total) + '</span><span class="x-save">Save ' + usd(c.off) + " (" + PRICING.offer.pct + "%)</span>" : '<span class="x-now">' + usd(c.total) + "</span>"; }window.LucePrice = { price: price, calc: calc, wasNow: wasNow, offerLive: offerLive, addonApplies: addonApplies, noStone: noStone, addonAmt: addonAmt, deposit: deposit, usd: usd };document.querySelectorAll("[data-from]").forEach(function (el) {var k = el.dataset.from; el.innerHTML = "From " + wasNow(calc({ piece: k, ct: PRICING.fromSpec[k], metal: "14k", addons: [] }));63 unmodified linesreturn { price: c.total, deposit: P.deposit(c.total), lines: c.lines, c: c };}function paintStage() {var piece = (form.querySelector('input[name="piece"]:checked') || {}).value || "Halo";var shape = (form.querySelector('input[name="shape"]:checked') || {}).value || "Round";var metalIn = form.querySelector('input[name="metal"]:checked');var ct = parseFloat(carat.value) || 1, addons = [];form.querySelectorAll('input[name="addon"]:checked').forEach(function (i) { if (!P.addonApplies || P.addonApplies(i.value, piece)) addons.push(i.value); });var colour = (form.querySelector('input[name="colour"]:checked') || {}).value || "G-H";var spec = { piece: piece, shape: shape, ct: ct, colour: colour, metal: metalIn ? metalIn.value : "14k yellow", addons: addons };var key = JSON.stringify(spec), tennis = /Tennis/.test(piece);var bits = [piece], bare = P.noStone(spec, piece);if (!bare) bits.push(ct.toFixed(2) + (tennis ? " ctw" : " ct") + (colour === "Blue" ? " blue" : "") + " " + shape.toLowerCase());if (!bare && !tennis) bits.push(((6.5 * Math.cbrt(ct)).toFixed(1)) + " mm across");if (addons.indexOf("coin") > -1) bits.push("coin face");bits.push(spec.metal);var txt = bits.join(" \u00b7 ");document.querySelectorAll("[data-stage]").forEach(function (st) {var host = st.querySelector(".x-stage__svg");if (host.dataset.key !== key) {host.dataset.key = key; host.classList.add("is-swap");setTimeout(function () { host.innerHTML = window.lucePieceSVG(spec); host.classList.remove("is-swap"); }, host.innerHTML ? 120 : 0);}var chip = st.querySelector(".x-stage__chip"), t = st.querySelector(".x-stage__txt");if (t.textContent !== txt) { t.textContent = txt; chip.classList.remove("is-pulse"); void chip.offsetWidth; chip.classList.add("is-pulse"); }var sw = st.querySelector(".x-stage__sw"), msw = metalIn && metalIn.parentNode.querySelector(".x-sw");sw.style.background = msw ? msw.style.background : "#c9a56b";});}function update() {var piece = val("piece");var isChain = piece === "Tennis chain", isBrace = piece === "Tennis bracelet";24 unmodified linesform.querySelectorAll(".x-addon").forEach(function (lab) {var k = lab.dataset.addon, ok = !piece || P.addonApplies(k, piece);lab.hidden = !ok;var amt = Math.round(P.addonAmt(k, specA));lab.querySelector("[data-addon-price]").textContent = amt ? "+" + P.usd(amt) : "priced by carat";});var fc = document.getElementById("f-carat"); if (fc) fc.hidden = !!piece && P.noStone(specA, piece);var ph = document.getElementById("sum-photo"), phi = document.getElementById("sum-photo-img");var card = piece && document.querySelector('.x-card[data-piece="' + piece + '"] img');var src = activeRef && activeRef.piece === piece ? activeRef.img : (card ? card.getAttribute("src") : "");28 unmodified linesvar presetNotes = "";FILM_PRESETS.forEach(function (sp) {var card = document.querySelector('.x-film[data-preset="' + sp.id + '"]'); if (!card) return;card.querySelector("[data-preset-price]").innerHTML = P.wasNow(P.calc({ piece: sp.piece, ct: sp.carat, metal: sp.metal, shape: sp.shape, colour: sp.colour, addons: sp.addons }));card.querySelector("[data-preset-go]").addEventListener("click", function () {var r = form.querySelector('input[type="radio"][name="piece"][value="' + sp.piece + '"]');var m = form.querySelector('input[type="radio"][name="metal"][value="' + sp.metal + '"]');if (r) r.checked = true;if (m) m.checked = true;[["shape", sp.shape], ["colour", sp.colour]].forEach(function (f) { var x = form.querySelector('input[name="' + f[0] + '"][value="' + f[1] + '"]'); if (x) x.checked = true; });carat.value = sp.carat; carat.dataset.moved = "1";form.querySelectorAll('input[name="addon"]').forEach(function (i) { i.checked = sp.addons.indexOf(i.value) > -1; });activeRef = { piece: sp.piece, img: sp.img, notes: sp.notes };
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146/* LUCE spec renderer: draws the piece exactly as configured (shape, carat to scale, metal, setting, add-ons). */(function () { var uid = 0; var METAL = { "14k yellow": ["#f3d79a", "#c9a25a", "#8a6a2f"], "18k yellow": ["#f6d58a", "#d1a246", "#8c6420"], "14k white": ["#f4f5f7", "#c4c8ce", "#80858d"], "18k white": ["#f7f8fa", "#cbd0d6", "#868b93"], "14k rose": ["#f3c9b4", "#cf9277", "#8f5a45"], "18k rose": ["#f5c6ad", "#d18d6e", "#8d5440"], "Platinum": ["#eef0f3", "#b9bec6", "#767c85"] }; function mm(ct) { return 6.5 * Math.cbrt(Math.max(ct, 0.01)); } // parametric outline: n points, half-width a function outline(shape, a, n) { var b = a * ({ Oval: 1.4, Pear: 1.5, Marquise: 1.9, Emerald: 1.35, Radiant: 1.2, Cushion: 1.04 }[shape] || 1), pts = [], i, t, x, y, c, s, e; for (i = 0; i < n; i++) { t = (i / n) * Math.PI * 2; c = Math.cos(t); s = Math.sin(t); if (shape === "Pear") { x = s * Math.pow(Math.abs(Math.sin(t / 2)), 1.4) * 1.22; y = -c; } else if (shape === "Marquise") { x = (s < 0 ? -1 : 1) * Math.pow(Math.abs(s), 1.5); y = -c; } else if (shape === "Round" || shape === "Oval" || !shape) { x = s; y = -c; } else { e = { Cushion: 4, Princess: 14, Asscher: 7, Emerald: 9, Radiant: 7 }[shape] || 4; x = (s < 0 ? -1 : 1) * Math.pow(Math.abs(s), 2 / e); y = -(c < 0 ? -1 : 1) * Math.pow(Math.abs(c), 2 / e); } pts.push([x * a, y * b]); } return pts; } function halfH(shape, w) { return w / 2 * ({ Oval: 1.4, Pear: 1.5, Marquise: 1.9, Emerald: 1.35, Radiant: 1.2, Cushion: 1.04 }[shape] || 1); } function poly(p, k) { return p.map(function (q) { return (q[0] * k).toFixed(1) + "," + (q[1] * k).toFixed(1); }).join(" "); } function shapePath(shape, w) { var p = outline(shape, w / 2, 64); return "M" + poly(p, 1).replace(/ /g, " L") + "Z"; } var SH0 = ["#ffffff", "#dfe7ef", "#9aa9b9", "#4c5866", "#c9d4df", "#2f3842", "#eef3f8", "#7d8a98"], SHB = ["#cfe3ff", "#6fa3e8", "#2f63b8", "#14336e", "#5b8fd6", "#0d2552", "#a9ccff", "#24509a"], SH = SH0; function stone(x, y, w, shape, id, rot) { var g = '<g transform="translate(' + x.toFixed(1) + "," + y.toFixed(1) + ")" + (rot ? " rotate(" + rot + ")" : "") + '">', N = 16, P = outline(shape, w / 2, N * 2), i, k; var step = shape === "Emerald" || shape === "Asscher"; if (w < 16) { g += '<polygon points="' + poly(outline(shape, w / 2, 24), 1) + '" fill="url(#st' + id + ')" stroke="#fff" stroke-opacity=".7" stroke-width=".6"/>'; g += '<polygon points="' + poly(outline(shape, w / 2, 12), 0.5) + '" fill="#fff" opacity=".85"/>'; return g + "</g>"; } if (step) { [1, 0.8, 0.6, 0.42].forEach(function (k2, j) { g += '<polygon points="' + poly(P, k2) + '" fill="' + (SH === SHB ? ["#163a7a", "#6fa3e8", "#2a5cae", "#a9ccff"] : ["#5d6977", "#cfd8e2", "#7f8c9a", "#e9eff5"])[j] + '" stroke="#fff" stroke-opacity=".5" stroke-width=".7"/>'; }); [0.125, 0.375, 0.625, 0.875].forEach(function (f) { var q = P[Math.round(f * P.length) % P.length]; g += '<line x1="' + q[0].toFixed(1) + '" y1="' + q[1].toFixed(1) + '" x2="' + (q[0] * 0.42).toFixed(1) + '" y2="' + (q[1] * 0.42).toFixed(1) + '" stroke="#fff" stroke-opacity=".55" stroke-width=".8"/>'; }); } else { g += '<polygon points="' + poly(P, 1) + '" fill="#3a4450"/>'; for (i = 0; i < N * 2; i++) { var a = P[i], b = P[(i + 1) % (N * 2)], ta = [a[0] * 0.56, a[1] * 0.56], tb = [b[0] * 0.56, b[1] * 0.56]; k = (i * 5 + 3) % SH.length; g += '<polygon points="' + poly([a, b, tb], 1) + '" fill="' + SH[k] + '" stroke="#0e1114" stroke-opacity=".25" stroke-width=".4"/>'; g += '<polygon points="' + poly([a, tb, ta], 1) + '" fill="' + SH[(k + 3) % SH.length] + '" stroke="#0e1114" stroke-opacity=".25" stroke-width=".4"/>'; } g += '<polygon points="' + poly(P, 0.56) + '" fill="url(#st' + id + ')" stroke="#fff" stroke-opacity=".6" stroke-width=".6"/>'; for (i = 0; i < N * 2; i += 4) { var q2 = P[i]; g += '<line x1="0" y1="0" x2="' + (q2[0] * 0.56).toFixed(1) + '" y2="' + (q2[1] * 0.56).toFixed(1) + '" stroke="#8796a6" stroke-opacity=".35" stroke-width=".5"/>'; } } g += '<polygon points="' + poly(P, 1) + '" fill="none" stroke="#fff" stroke-opacity=".9" stroke-width="' + Math.max(0.8, w / 90) + '"/>'; var f = w * 0.09; g += '<path d="M' + (-w * 0.18) + "," + (-w * 0.2 - f) + " l" + f * 0.3 + "," + f * 0.7 + " l" + f * 0.7 + "," + f * 0.3 + " l" + -f * 0.7 + "," + f * 0.3 + " l" + -f * 0.3 + "," + f * 0.7 + " l" + -f * 0.3 + "," + -f * 0.7 + " l" + -f * 0.7 + "," + -f * 0.3 + " l" + f * 0.7 + "," + -f * 0.3 + 'Z" fill="#fff"/>'; return g + "</g>"; } function dots(points, d, id) { var keep = SH; SH = SH0; var o = points.map(function (p) { return stone(p[0], p[1], d, "Round", id); }).join(""); SH = keep; return o; } function arc(cx, cy, rx, ry, a0, a1, n) { var o = []; for (var i = 0; i < n; i++) { var a = a0 + (a1 - a0) * (n === 1 ? 0.5 : i / (n - 1)); o.push([cx + rx * Math.cos(a), cy + ry * Math.sin(a)]); } return o; } function outlinePts(shape, w, off, n) { var hw = w / 2 + off; return outline(shape, hw, n).map(function (p) { return [p[0], p[1] * (halfH(shape, w) + off) / (halfH(shape, w) * (hw / (w / 2)) || 1)]; }); }
window.lucePieceSVG = function (spec) { SH = spec.colour === "Blue" ? SHB : SH0; var id = ++uid, piece = spec.piece || "Solitaire", shape = spec.shape || "Round", ct = +spec.ct || 1; var M = METAL[spec.metal] || METAL["14k yellow"], add = spec.addons || [], has = function (k) { return add.indexOf(k) > -1; }; var matte = has("finish"), K = 13; // px per mm var defs = '<defs><linearGradient id="m' + id + '" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="' + M[2] + '"/><stop offset=".22" stop-color="' + (matte ? M[1] : M[0]) + '"/><stop offset=".45" stop-color="' + M[1] + '"/><stop offset=".62" stop-color="' + (matte ? M[1] : M[0]) + '"/><stop offset="1" stop-color="' + M[2] + '"/></linearGradient>' + '<linearGradient id="mb' + id + '" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="' + M[2] + '"/><stop offset="1" stop-color="' + M[1] + '" stop-opacity="0.7"/></linearGradient>' + '<radialGradient id="st' + id + '" cx="0.35" cy="0.3" r="0.9"><stop offset="0" stop-color="#ffffff"/><stop offset="0.5" stop-color="' + (spec.colour === "Blue" ? "#7fb0f0" : "#cdd8e3") + '"/><stop offset="1" stop-color="' + (spec.colour === "Blue" ? "#1d3f80" : "#6f7f90") + '"/></radialGradient><radialGradient id="rb' + id + '" cx="0.35" cy="0.3" r="0.8"><stop offset="0" stop-color="#ff9aa8"/><stop offset="0.45" stop-color="#c0142e"/><stop offset="1" stop-color="#4a0510"/></radialGradient>' + '<radialGradient id="bg' + id + '" cx="0.5" cy="0.42" r="0.7"><stop offset="0" stop-color="#2a231d"/><stop offset="1" stop-color="#14110f"/></radialGradient></defs>'; var out = '<rect width="400" height="500" fill="url(#bg' + id + ')"/>'; var mg = "url(#m" + id + ")", mb = "url(#mb" + id + ")"; var cx = 200, w = mm(ct) * K;
if (/Tennis/.test(piece)) { var chain = piece === "Tennis chain", total = chain ? 140 : 52, per = ct / total, d = Math.max(9, Math.min(30, mm(per) * K * 0.9)); var n = Math.round((chain ? 640 : 520) / (d * 1.12)), pts = []; for (var i = 0; i < n; i++) { var t = i / (n - 1), a = Math.PI * (0.05 + 0.9 * t); pts.push([cx - 150 * Math.cos(a), 120 + (chain ? 300 : 250) * Math.sin(a)]); } out += pts.map(function (p) { return '<circle cx="' + p[0] + '" cy="' + p[1] + '" r="' + d * 0.62 + '" fill="' + mg + '"/>'; }).join(""); out += dots(pts, d, id); if (!chain) out += '<rect x="' + (cx - 150 * Math.cos(Math.PI * 0.05) - 10) + '" y="96" width="20" height="26" rx="3" fill="' + mg + '"/>'; } else if (piece === "Studs") { [130, 270].forEach(function (x) { out += '<rect x="' + (x - 3) + '" y="250" width="6" height="90" fill="' + mb + '"/>'; if (has("bezel")) out += '<path d="' + shapePath(shape, w + 10) + '" transform="translate(' + x + ',230)" fill="' + mg + '"/>'; else [[-1, -1], [1, -1], [1, 1], [-1, 1]].forEach(function (q) { out += '<circle cx="' + (x + q[0] * w * 0.36) + '" cy="' + (230 + q[1] * halfH(shape, w) * 0.72) + '" r="' + Math.max(4, w * 0.09) + '" fill="' + mg + '"/>'; }); out += stone(x, 230, w, shape, id); }); } else { // ring in three-quarter view: back of shank, head, front of shank out += '<g transform="translate(200,250) scale(1.18) translate(-200,-292)">'; var cigar = piece === "Cigar band", heavy = piece === "Signet" || piece === "Pinky ring", bw = cigar ? 46 : heavy ? 24 : 15, cy = 340, rx = 128, ry = 48; out += '<path d="M' + (cx - rx) + "," + cy + " A" + rx + "," + ry + " 0 0,1 " + (cx + rx) + "," + cy + '" fill="none" stroke="' + mb + '" stroke-width="' + bw + '"/>'; var hy = cy - ry - 34; if (cigar) { // wide domed band: no head } else if (piece === "Signet") { var fw = 140, fh = 112; out += '<path d="M' + (cx - 46) + "," + (cy - ry + 6) + " L" + (cx - fw / 2 + 6) + "," + (hy + 30) + " L" + (cx + fw / 2 - 6) + "," + (hy + 30) + " L" + (cx + 46) + "," + (cy - ry + 6) + 'Z" fill="' + mb + '"/>'; out += '<rect x="' + (cx - fw / 2) + '" y="' + (hy - fh / 2) + '" width="' + fw + '" height="' + fh + '" rx="34" fill="' + mg + '" stroke="' + M[2] + '" stroke-width="2"/>'; if (has("coin")) { out += '<circle cx="' + cx + '" cy="' + hy + '" r="48" fill="' + mg + '" stroke="' + M[2] + '" stroke-width="5" stroke-dasharray="2 3"/><circle cx="' + cx + '" cy="' + hy + '" r="38" fill="none" stroke="' + M[2] + '" stroke-width="1.2"/>'; out += '<text x="' + cx + '" y="' + (hy + 4) + '" text-anchor="middle" font-family="Georgia,serif" font-size="30" font-weight="700" fill="' + M[2] + '">3</text><text x="' + cx + '" y="' + (hy + 20) + '" text-anchor="middle" font-family="Georgia,serif" font-size="9" letter-spacing="1" fill="' + M[2] + '">DOLLARS</text><text x="' + cx + '" y="' + (hy - 24) + '" text-anchor="middle" font-family="Georgia,serif" font-size="8" letter-spacing="1" fill="' + M[2] + '">1854</text>'; } else if (has("handeng")) { for (var e = -3; e <= 3; e++) out += '<path d="M' + (cx - 58) + "," + (hy + e * 12) + " q29," + (e % 2 ? 8 : -8) + " 58,0 t58,0" + '" fill="none" stroke="' + M[2] + '" stroke-width="1.2" opacity="0.8"/>'; } if (has("rim")) out += dots(outlinePts("Cushion", fw - 20, 0, 22).map(function (p) { return [cx + p[0] * 1.02, hy + p[1] * 0.8]; }), 9, id); if (!has("coin")) { var sw = Math.min(w, 70); out += '<path d="' + shapePath(shape, sw + 8) + '" transform="translate(' + cx + "," + hy + ')" fill="' + M[2] + '"/>'; out += stone(cx, hy, sw, shape, id); } } else { var hh = halfH(shape, w); // gallery under the head out += '<path d="M' + (cx - 26) + "," + (cy - ry + 4) + " L" + (cx - w * 0.3) + "," + (hy + hh * 0.4) + " L" + (cx + w * 0.3) + "," + (hy + hh * 0.4) + " L" + (cx + 26) + "," + (cy - ry + 4) + 'Z" fill="' + mb + '"/>'; if (has("halo") && piece !== "Halo") out += dots(arc(cx, hy + hh * 0.55, w * 0.42, 10, 0.15, Math.PI - 0.15, 9), 6, id); if (has("side")) { var sw2 = mm(0.25) * K; out += stone(cx - w / 2 - sw2 / 2 - 4, hy + 6, sw2, shape, id) + stone(cx + w / 2 + sw2 / 2 + 4, hy + 6, sw2, shape, id); } if (piece === "Halo") { var hd = Math.max(7, w * 0.11); out += '<path d="' + shapePath(shape, w + hd * 2.6) + '" transform="translate(' + cx + "," + hy + ')" fill="' + mg + '"/>'; out += dots(outlinePts(shape, w, hd * 0.75, Math.round((w + hd * 3) * 3.2 / (hd * 1.15))).map(function (p) { return [cx + p[0], hy + p[1]]; }), hd, id); } if (has("bezel") || piece === "Pinky ring" && has("bezel")) out += '<path d="' + shapePath(shape, w + 12) + '" transform="translate(' + cx + "," + hy + ')" fill="' + mg + '" stroke="' + M[2] + '" stroke-width="1.5"/>'; if (has("ruby")) { var rw = Math.max(26, w * 0.95), rh = rw * 1.45, rxp = cx + w * 0.42 + rw * 0.3; out += '<ellipse cx="' + rxp + '" cy="' + (hy + 4) + '" rx="' + (rw / 2 + 5) + '" ry="' + (rh / 2 + 5) + '" fill="' + mg + '" transform="rotate(-28 ' + rxp + " " + (hy + 4) + ')"/>'; out += '<path d="' + shapePath("Pear", rw) + '" transform="translate(' + rxp + "," + (hy + 4) + ') rotate(152)" fill="url(#rb' + id + ')" stroke="#ffb3be" stroke-opacity=".5"/>'; out += '<ellipse cx="' + (rxp - rw * 0.15) + '" cy="' + (hy - rh * 0.12) + '" rx="' + rw * 0.12 + '" ry="' + rw * 0.2 + '" fill="#fff" opacity=".55" transform="rotate(-28 ' + rxp + " " + hy + ')"/>'; cx -= w * 0.3; } out += stone(cx, hy, w, shape, id); if (!has("bezel")) [[-1, -1], [1, -1], [1, 1], [-1, 1]].forEach(function (q) { out += '<circle cx="' + (cx + q[0] * w * 0.38) + '" cy="' + (hy + q[1] * hh * 0.78) + '" r="' + Math.max(4, w * 0.075) + '" fill="' + mg + '"/>'; }); } if (has("ruby")) cx = 200; // front of shank out += '<path d="M' + (cx - rx) + "," + cy + " A" + rx + "," + ry + " 0 0,0 " + (cx + rx) + "," + cy + '" fill="none" stroke="' + mg + '" stroke-width="' + bw + '"/>'; if (cigar && has("flush")) { out += '<circle cx="' + cx + '" cy="' + (cy + ry) + '" r="' + (Math.min(w, 40) / 2 + 4) + '" fill="' + M[2] + '"/>' + stone(cx, cy + ry, Math.min(w, 40), shape, id); } if (!matte) out += '<path d="M' + (cx - rx * 0.6) + "," + (cy + ry * 0.82) + " A" + rx + "," + ry + " 0 0,0 " + (cx + rx * 0.2) + "," + (cy + ry * 0.98) + '" fill="none" stroke="#fff" stroke-opacity="0.55" stroke-width="2.5"/>'; if (piece === "Band") out += dots(arc(cx, cy, rx, ry, Math.PI * 0.08, Math.PI * 0.92, 15), 13, id); if (has("pave") && piece !== "Band") out += dots(arc(cx, cy, rx, ry, Math.PI * 1.08, Math.PI * 1.3, 4).concat(arc(cx, cy, rx, ry, Math.PI * 1.7, Math.PI * 1.92, 4)), 7, id); if (piece === "Halo") out += dots(arc(cx, cy, rx, ry, Math.PI * 1.06, Math.PI * 1.32, 4).concat(arc(cx, cy, rx, ry, Math.PI * 1.68, Math.PI * 1.94, 4)), 7, id); out += "</g>"; } return '<svg viewBox="0 0 400 500" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="' + piece + ", " + ct + " ct " + shape + ", " + (spec.metal || "") + '" preserveAspectRatio="xMidYMid slice">' + defs + out + "</svg>"; }; window.luceRenderAll = function () { document.querySelectorAll("[data-spec]").forEach(function (el) { try { el.innerHTML = window.lucePieceSVG(JSON.parse(el.getAttribute("data-spec"))); } catch (e) {} }); }; if (document.readyState !== "loading") window.luceRenderAll(); else document.addEventListener("DOMContentLoaded", window.luceRenderAll);})();12345var C = "luce-v1";var CORE = ["./", "index.html", "manifest.webmanifest", "icon-192.png", "p-hero.jpg", "p-signet.jpg", "p-pinky.jpg", "p-halo.jpg", "p-solitaire.jpg", "p-chain.jpg", "p-bracelet.jpg"];self.addEventListener("install", function (e) { e.waitUntil(caches.open(C).then(function (c) { return c.addAll(CORE); })); self.skipWaiting(); });self.addEventListener("activate", function (e) { e.waitUntil(caches.keys().then(function (k) { return Promise.all(k.filter(function (x) { return x !== C; }).map(function (x) { return caches.delete(x); })); })); self.clients.claim(); });self.addEventListener("fetch", function (e) {12345var C = "luce-v2";var CORE = ["./", "index.html", "render.js", "manifest.webmanifest", "icon-192.png"];self.addEventListener("install", function (e) { e.waitUntil(caches.open(C).then(function (c) { return c.addAll(CORE); })); self.skipWaiting(); });self.addEventListener("activate", function (e) { e.waitUntil(caches.keys().then(function (k) { return Promise.all(k.filter(function (x) { return x !== C; }).map(function (x) { return caches.delete(x); })); })); self.clients.claim(); });self.addEventListener("fetch", function (e) {
index.html+86-69
render.jsAdded+146
sw.js+2-2