PLANER

window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-7TGV5YJWZE');

Klikni na element, kateremu želiš spremeniti material in barvo.

/* Stil za pozadinsku sliku */ .background-svg { width: 140%; /* Povećanje širine na 110% */ height: auto; /* Automatsko zadržavanje proporcija */ margin-left: -20%; /* Centriranje slike */ position: relative; /* Omogućava postavljanje z-index-a */ z-index: 1; /* Postavljanje pozadine ispod dropdown-a */ } /* Za mobilne uređaje */ @media (max-width: 768px) { .background-svg { width: 140%; /* Povećanje na 140% */ margin-left: -15%; /* Centriranje slike */ } } /* Stil za SVG elemente */ .svg-element { cursor: pointer; stroke: #bbb; /* Podesite boju linije */ stroke-width: 0.1px; /* Podesite debljinu linije */ } /* Dropdown meni stilovi */ .dropdown-menu { display: none; position: absolute; background: white; border: 1px solid #ccc; box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); padding: 10px; z-index: 999; /* Postavljanje dropdown-a iznad drugih elemenata */ overflow: visible; /* Omogućava da dropdown izlazi izvan okvira */ font-size: 16px; } /*.dropdown-menu img { width: 70px; }*/ /* Dropdown item stilovi */ .dropdown-item { display: flex; align-items: center; gap: 10px; padding: 4px; border: 1px solid #ccc; background-color: transparent; text-align: left; width: 190px; cursor: pointer; font-size: 16px; } .dropdown-item:hover { background: #f0f0f0; } .dropdown-item img { width: 70px; /* Širina slike */ height: auto; border-radius: 5px; /* Zaobljeni uglovi (opcionalno) */ } .dropdown-item:hover { background-color: #f0f0f0; } /* Stil za pozadinsku sliku (ponovno postavljanje za mobilne uređaje) */ @media (max-width: 768px) { .background-svg { width: 170%; /* Povećanje širine na 130% */ margin-left: -35%; /* Centriranje slike */ } .dropdown-menu img { width: 70px; height: 40px; } .dropdown-item { /*display: block;*/ padding: 10px 2px; } /* Za roditeljsku div-u (ako je potrebno) */ .image-container { position: relative; width: 100%; max-width: 100vw; height: auto; overflow: visible; /* Omogućava da dropdown izlazi van okvira */ } /* Stil teksture u padajucem meniju slika*/ .teksturs { /*width= 30px; height: 40px;*/ } // Centralizovana lista pozadina const backgroundImages = { "Hrast Casella beli": "https://cdn.egger.com/img/pim/8854369042462/8854526132254/AR_16_9.webp?width=1440&srcext=png", "Hrast Casella natur svetli": "https://cdn.egger.com/img/pim/8854529179678/8854529212446/AR_16_9.webp?width=1440&srcext=png", "Hrast Casella natur": "https://cdn.egger.com/img/pim/8854530424862/8854530457630/AR_16_9.webp?width=1440&srcext=png", "Hrast Halifax beli": "https://cdn.egger.com/img/pim/8854365110302/8854522658846/AR_16_9.webp?width=1440&srcext=png", "Hrast Halifax natur": "https://cdn.egger.com/img/pim/8854365503518/8854523150366/AR_16_9.webp?width=1440&srcext=png", "Hrast Halifax tabak": "https://cdn.egger.com/img/pim/8854365896734/8854523248670/AR_16_9.webp?width=1440&srcext=png", "Hrast Halifax kalaj": "https://cdn.egger.com/img/pim/8854403743774/8854539632670/AR_16_9.webp?width=1440&srcext=png", "Ariš planinski antracit": "https://cdn.egger.com/img/pim/8854416326686/8854543269918/AR_16_9.webp?width=1440&srcext=png", "Termo ariš planinski braon": "https://cdn.egger.com/img/pim/8854416719902/8854543368222/AR_16_9.webp?width=1440&srcext=png", "Ariš planinski natur": "https://cdn.egger.com/img/pim/8854543663134/8854543695902/AR_16_9.webp?width=1440&srcext=png", "Jasen Navarra": "https://cdn.egger.com/img/pim/8854369042462/8854526132254/AR_16_9.webp?width=1440&srcext=png", "Jasen Navarra": "https://cdn.egger.com/img/pim/8854369042462/8854526132254/AR_16_9.webp?width=1440&srcext=png", "Hrast Sherman antracit": "https://cdn.egger.com/img/pim/8854377693214/8854528098334/AR_16_9.webp?width=1440&srcext=png", "Termo hrast crno-braon": "https://cdn.egger.com/img/pim/8854366289950/8854523346974/AR_16_9.webp?width=1440&srcext=png", "Orah Warmia braon": "https://cdn.egger.com/img/pim/8854527311902/8854527344670/AR_16_9.webp?width=1440&srcext=png", "Beton Chicago svetlo sivi": "https://cdn.egger.com/img/pim/8854324805662/8854505521182/AR_16_9.webp?width=1440&srcext=png", "Beton Chicago tamno sivi": " https://cdn.egger.com/img/pim/8854325198878/8854505816094/AR_16_9.webp?width=1440&srcext=png", "Pietra Grigia crni": "https://cdn.egger.com/img/pim/8854326771742/8854506012702/AR_16_9.webp?width=1440&srcext=png", "Scivaro škriljac": "https://cdn.egger.com/img/pim/8854510632990/8854510665758/AR_16_9.webp?width=1440&srcext=png", "Cupria škriljac": "https://cdn.egger.com/img/pim/8854511026206/8854511058974/AR_16_9.webp?width=1440&srcext=png", "Cobra bronza": "https://cdn.egger.com/img/pim/8854513877022/8854513909790/AR_16_9.webp?width=1440&srcext=png", "Platno bež": "https://cdn.egger.com/img/pim/8854334636062/8854514565150/AR_16_9.webp?width=1440&srcext=png", "Platno belo": "https://cdn.egger.com/img/pim/8854335422494/8854514761758/AR_16_9.webp?width=1440&srcext=png", "Platno braon": "https://cdn.egger.com/img/pim/8854335815710/8854514860062/AR_16_9.webp?width=1440&srcext=png", "Platno antracit": "https://cdn.egger.com/img/pim/8854336208926/8854514958366/AR_16_9.webp?width=1440&srcext=png", "Četkano zlato": "https://cdn.egger.com/img/pim/8854516039710/8854516072478/AR_16_9.webp?width=1440&srcext=png", "Premium bela": "https://cdn.egger.com/img/pim/8854478520350/8854478553118/AR_16_9.webp?width=1440&srcext=png", "Brilliant žuta": "https://cdn.egger.com/img/pim/8854426157086/8854546710558/AR_16_9.webp?width=1440&srcext=png", "Karat bež": "https://cdn.egger.com/img/pim/8854547005470/8854547038238/AR_16_9.webp?width=1440&srcext=png", "Burgund crvena": "https://cdn.egger.com/img/pim/8854430875678/8854548643870/AR_16_9.webp?width=1440&srcext=png", "Violet": "https://cdn.egger.com/img/pim/8854438739998/8854550249502/AR_16_9.webp?width=1440&srcext=png", "Indigo plava": "https://cdn.egger.com/img/pim/8854443065374/8854552936478/AR_16_9.webp?width=1440&srcext=png", "Šumsko zelena": "https://cdn.egger.com/img/pim/8854444638238/8854553559070/AR_16_9.webp?width=1440&srcext=png", "Tartuf braon": "https://cdn.egger.com/img/pim/8854460366878/8854558408734/AR_16_9.webp?width=1440&srcext=png", "Tamno braon": "https://cdn.egger.com/img/pim/8854465544222/8854560178206/AR_16_9.webp?width=1440&srcext=png", "Oniks siva": "https://cdn.egger.com/img/pim/8854467117086/8854560571422/AR_16_9.webp?width=1440&srcext=png", "Crna": "https://cdn.egger.com/img/pim/8854473015326/8854473048094/AR_16_9.webp?width=1440&srcext=png", "Siena narandžasta": "https://cdn.egger.com/img/pim/8854435594270/8854549463070/AR_16_9.webp?width=1440&srcext=png" // Dodaj još pozadina ovde }; let selectedElement = null; // Selektovani SVG element let currentTarget = null; // Ciljani ID patterna document.querySelectorAll('.svg-element').forEach((element) => { element.addEventListener('click', function (event) { selectedElement = this; currentTarget = this.dataset.target; const dropdown = document.getElementById('dropdown-menu'); // Prikazi dropdown meni na mestu klika //dropdown.style.display = 'block'; /* dropdown.style.top = `${event.clientY}px`; dropdown.style.left = `${event.clientX}px`;*/ /*dropdown.style.top = `${event.clientY}px`; dropdown.style.left = `10px`;*/ if (window.innerWidth { item.addEventListener('click', function () { const imageKey = this.dataset.key; // Uzimamo ključ iz data atributa const imageUrl = backgroundImages[imageKey]; // Uzimamo URL iz centralizovane liste if (imageUrl && currentTarget) { const patternImage = document.querySelector(`#${currentTarget} image`); if (patternImage) { patternImage.setAttribute('href', imageUrl); // Menjamo href pozadinske slike } } // Sakrij dropdown document.getElementById('dropdown-menu').style.display = 'none'; }); }); // Sakrij dropdown klikom van njega document.addEventListener('click', function (event) { const dropdown = document.getElementById('dropdown-menu'); if (!dropdown.contains(event.target) && !event.target.classList.contains('svg-element')) { dropdown.style.display = 'none'; } });
Kuhinja <!-- --> <!---->
Izaberi Boju
<!--
Teksture
-->
<!--
Crvena
Zelena
Plava
Žuta
Magenta
Cijan
Crna
Bela
Ljubičasta
Siva
-->
Tekstura 1
Tekstura 2
Tekstura 3
Tekstura 4
Tekstura 5
Tekstura 6
Tekstura 7
Tekstura 8
Tekstura 9
Tekstura 10
document.addEventListener('DOMContentLoaded', () => { const svg = document.getElementById('custom-kitchen-svg-123'); const optionDropdown = document.getElementById('custom-option-dropdown-123'); const colorDropdown = document.getElementById('custom-color-dropdown-123'); const textureDropdown = document.getElementById('custom-texture-dropdown-123'); const container = document.getElementById('custom-kitchen-container-123'); let currentElement = null; const colors = [ "#F0F8FF", "#FAEBD7", "#00FFFF", "#7FFFD4", "#F0FFFF", "#F5F5DC", "#FFE4C4", "#000000", "#FFEBCD", "#0000FF", "#8A2BE2", "#A52A2A", "#DEB887", "#5F9EA0", "#7FFF00", "#D2691E", "#FF7F50", "#6495ED", "#FFF8DC", "#DC143C", "#00FFFF", "#00008B", "#008B8B", "#B8860B", "#A9A9A9", "#006400", "#BDB76B", "#8B008B", "#556B2F", "#FF8C00" ]; colors.forEach(color => { const colorOption = document.createElement('div'); colorOption.style.display = 'flex'; colorOption.style.alignItems = 'center'; colorOption.style.marginBottom = '5px'; colorOption.innerHTML = `
${color}`; colorDropdown.appendChild(colorOption); }); function lightenColor(color, percent) { const num = parseInt(color.slice(1), 16); const amt = Math.round(2.55 * percent); const R = (num >> 16) + amt; const G = (num >> 8 & 0x00FF) + amt; const B = (num & 0x0000FF) + amt; return `#${(0x1000000 + (R < 255 ? R < 1 ? 0 : R : 255) * 0x10000 + (G < 255 ? G < 1 ? 0 : G : 255) * 0x100 + (B < 255 ? B { if (e.target.tagName !== 'svg') { currentElement = e.target; const containerRect = container.getBoundingClientRect(); const elementRect = currentElement.getBoundingClientRect(); optionDropdown.style.left = `${elementRect.right - containerRect.left + window.scrollX}px`; optionDropdown.style.top = `${elementRect.top - containerRect.top + window.scrollY}px`; optionDropdown.style.display = 'block'; } else { optionDropdown.style.display = 'none'; colorDropdown.style.display = 'none'; textureDropdown.style.display = 'none'; currentElement = null; } }); optionDropdown.addEventListener('click', (e) => { if (e.target.dataset.option) { const option = e.target.dataset.option; optionDropdown.style.display = 'none'; if (option === 'colors') { colorDropdown.style.left = optionDropdown.style.left; colorDropdown.style.top = optionDropdown.style.top; colorDropdown.style.display = 'block'; } else if (option === 'textures') { textureDropdown.style.left = optionDropdown.style.left; textureDropdown.style.top = optionDropdown.style.top; textureDropdown.style.display = 'block'; } } }); function darkenColor(color, percent) { const f = parseInt(color.slice(1), 16); const t = 0; const R = f >> 16; const G = f >> 8 & 0x00FF; const B = f & 0x0000FF; return "#" + (0x1000000 + (Math.round((t - R) * (1 - percent)) + R) * 0x10000 + (Math.round((t - G) * (1 - percent)) + G) * 0x100 + (Math.round((t - B) * (1 - percent)) + B)).toString(16).slice(1); } colorDropdown.addEventListener('click', (e) => { if (e.target.dataset.color) { const color = e.target.dataset.color; if (currentElement) { currentElement.style.fill = color; colorDropdown.style.display = 'none'; // Check if the current element is cabinet3 and update cabinet4 with a lighter color if (currentElement.id === 'custom-cabinet2-123') { const cabinet2obod = document.getElementById('custom-cabinet2-obod'); /*const cabinet3 = document.getElementById('custom-cabinet3-123'); const cabinet3obod = document.getElementById('custom-cabinet3-obod'); const cabinet4 = document.getElementById('custom-cabinet4-123'); const cabinet4obod = document.getElementById('custom-cabinet4-obod'); const cabinet5 = document.getElementById('custom-cabinet5-123'); const cabinet5obod = document.getElementById('custom-cabinet5-obod');*/ if (cabinet2obod) { cabinet2obod.style.fill = lightenColor(color, 30); // Lighten by 70% /*cabinet3.style.fill = lightenColor(color, 1); cabinet3obod.style.fill = lightenColor(color, 30); cabinet4.style.fill = lightenColor(color, 1); cabinet4obod.style.fill = lightenColor(color, 30); cabinet5.style.fill = lightenColor(color, 1); cabinet4obod.style.fill = lightenColor(color, 30);*/ } } if (currentElement.id === 'custom-cabinet3-123') { const cabinet3obod = document.getElementById('custom-cabinet3-obod'); if (cabinet3obod) { cabinet3obod.style.fill = lightenColor(color, 42); // Lighten by 70% } } if (currentElement.id === 'custom-cabinet4-123') { const cabinet4obod = document.getElementById('custom-cabinet4-obod'); if (cabinet4obod) { cabinet4obod.style.fill = lightenColor(color, 42); // Lighten by 70% } } if (currentElement.id === 'custom-cabinet5-123') { const cabinet5obod = document.getElementById('custom-cabinet5-obod'); if (cabinet5obod) { cabinet5obod.style.fill = lightenColor(color, 42); // Lighten by 70% } } if (currentElement.id === 'gornja-ploca') { const gornjaPlocaObod1 = document.getElementById('gornja-ploca-obod-1'); if (gornjaPlocaObod1) { gornjaPlocaObod1.style.fill = lightenColor(color, 42); // Lighten by 70% } } } if (currentElement.id === 'custom-cabinet-frizider' /*|| currentElement.id === 'custom-cabinet6-123'*/) { const gradientId = `gradient-${color.replace('#', '')}`; const svg = document.getElementById('custom-kitchen-svg-123'); let svgDefs = document.querySelector('#custom-kitchen-svg-123 defs'); if (!svgDefs) { svgDefs = document.createElementNS('http://www.w3.org/2000/svg', 'defs'); svg.appendChild(svgDefs); } // Remove existing gradients for this element const oldGradients = svgDefs.querySelectorAll(`linearGradient[id^="gradient-"]`); oldGradients.forEach(grad => svgDefs.removeChild(grad)); const gradient = document.createElementNS('http://www.w3.org/2000/svg', 'linearGradient'); gradient.id = gradientId; gradient.setAttribute('x1', '0%'); gradient.setAttribute('y1', '0%'); gradient.setAttribute('x2', '100%'); gradient.setAttribute('y2', '0%'); const stop1 = document.createElementNS('http://www.w3.org/2000/svg', 'stop'); stop1.setAttribute('offset', '0%'); stop1.setAttribute('stop-color', lightenColor(color, 70)); // Light color const stop2 = document.createElementNS('http://www.w3.org/2000/svg', 'stop'); stop2.setAttribute('offset', '70%'); stop2.setAttribute('stop-color', color); // Original color gradient.appendChild(stop1); gradient.appendChild(stop2); svgDefs.appendChild(gradient); currentElement.style.fill = `url(#${gradientId})`; } else if (currentElement.id === 'bocna-ploca') { currentElement.style.fill = darkenColor(color, 0.2); // Zatamni za 70% } else { currentElement.style.fill = color; } colorDropdown.style.display = 'none'; // Check if the current element is custom-cabinet3-123 and update custom-cabinet4-123 with a lighter color /*if (currentElement.id === 'custom-cabinet3-123') { const cabinet4 = document.getElementById('custom-cabinet4-123'); if (cabinet4) { cabinet4.style.fill = lightenColor(color, 70); // Lighten by 70% } }*/ } }); textureDropdown.addEventListener('click', (e) => { if (e.target.dataset.texture) { const texture = e.target.dataset.texture; if (currentElement) { currentElement.style.fill = texture; textureDropdown.style.display = 'none'; } } }); document.addEventListener('click', (e) => { if (!svg.contains(e.target) && !optionDropdown.contains(e.target) && !colorDropdown.contains(e.target) && !textureDropdown.contains(e.target)) { optionDropdown.style.display = 'none'; colorDropdown.style.display = 'none'; textureDropdown.style.display = 'none'; } }); });

To je le nekaj barv, ki ti pomagajo videti, katera barva se poda k kateri in katera ne. Pripravili ti bomo natančen načrt kuhinje s pravimi barvami in dekorji, ki jih boš lahko videl v živo.