/* UZAMKNUTÉ CSS LEN PRE APLIKÁCIU */ #prompt-builder-app { --bg-body: #ffffff; --bg-canvas: #fafbfc; --border: #e2e8f0; --border-dark: #cbd5e1; --text-main: #0f172a; --text-muted: #64748b; --accent: #000000; --accent-light: #f1f5f9; --node-wire: #0f172a; --glow-color: rgba(37, 99, 235, 0.12); font-family: 'Inter', sans-serif; background-color: var(--bg-body); color: var(--text-main); height: 100vh; width: 100%; margin: 0; border: none; border-radius: 0; display: flex; flex-direction: column; position: relative; overflow: hidden; } #prompt-builder-app * { box-sizing: border-box; margin: 0; padding: 0; } /* --- TIMELINE --- */ #prompt-builder-app .header { padding: 20px 40px 25px 40px; background: var(--bg-body); z-index: 10; border-bottom: 1px solid var(--border); display: flex; justify-content: center; align-items: center; } #prompt-builder-app .timeline { display: flex; align-items: center; justify-content: space-between; max-width: 900px; margin: 0 auto; width: 100%; flex-wrap: nowrap;} #prompt-builder-app .mini-node { width: 22px; height: 22px; border-radius: 50%; background: var(--border-dark); color: transparent; display: flex; align-items: center; justify-content: center; font-size: 9px; transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1); position: relative; flex-shrink: 0; z-index: 2; } #prompt-builder-app .mini-node.active { background: var(--text-main); color: #fff; box-shadow: 0 0 0 4px var(--bg-body), 0 0 0 5px var(--border); } #prompt-builder-app .mini-node.completed { background: var(--text-main); color: #fff; } #prompt-builder-app .mini-line { flex: 1; height: 2px; background: var(--border-dark); transition: background 0.6s ease; margin: 0 10px; z-index: 1; } #prompt-builder-app .mini-line.active { background: var(--text-main); } #prompt-builder-app .mini-label { position: absolute; top: 28px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 600; color: var(--text-muted); white-space: nowrap; text-transform: uppercase; letter-spacing: 0.5px; transition: color 0.6s ease; } #prompt-builder-app .mini-node.active .mini-label { color: var(--text-main); } /* --- CANVAS --- */ #prompt-builder-app .slider-viewport { flex: 1; width: 100%; overflow: hidden; position: relative; background-color: var(--bg-canvas); background-image: radial-gradient(var(--border-dark) 1px, transparent 1px); background-size: 24px 24px; } #prompt-builder-app .slider-track { display: flex; height: 100%; transition: transform 0.9s cubic-bezier(0.77, 0, 0.175, 1); width: 100%; } #prompt-builder-app .slide { min-width: 100%; height: 100%; padding: 20px 40px 140px 40px; overflow-y: auto; display: flex; justify-content: center; align-items: flex-start; scrollbar-width: none; -ms-overflow-style: none; } #prompt-builder-app .slide::-webkit-scrollbar { display: none; } /* --- NODE CARD --- */ #prompt-builder-app .node-card { width: 100%; max-width: 1000px; background: #ffffff; border: 1px solid rgba(37, 99, 235, 0.25); border-radius: 10px; box-shadow: 0 15px 40px var(--glow-color), 0 0 15px rgba(37, 99, 235, 0.05); display: flex; flex-direction: column; position: relative; margin-top: 10px; } #prompt-builder-app .node-header { background: #ffffff; padding: 12px 24px; border-bottom: 1px solid var(--border-dark); border-radius: 8px 8px 0 0; display: flex; align-items: center; justify-content: space-between; position: relative; } #prompt-builder-app .slide-title { font-size: 16px; font-weight: 700; color: var(--text-main); margin: 0; text-transform: uppercase; letter-spacing: 1px;} #prompt-builder-app .step-counter { font-size: 10px; font-weight: 600; color: #2563eb; text-transform: uppercase; background: rgba(37, 99, 235, 0.1); padding: 4px 8px; border-radius: 20px; } #prompt-builder-app .port-in, #prompt-builder-app .port-out { position: absolute; top: 50%; transform: translateY(-50%); width: 12px; height: 12px; background: #ffffff; border: 3px solid var(--node-wire); border-radius: 50%; z-index: 10; } #prompt-builder-app .port-in { left: -7px; } #prompt-builder-app .port-out { right: -7px; background: var(--node-wire); box-shadow: 0 0 0 2px #fff; } #prompt-builder-app .wire-in, #prompt-builder-app .wire-out { position: absolute; top: 50%; transform: translateY(-50%); height: 3px; background: var(--node-wire); z-index: 5; } #prompt-builder-app .wire-in { right: 100%; width: 100vw; } #prompt-builder-app .wire-out { left: 100%; width: 100vw; } #prompt-builder-app .node-body { padding: 20px 24px; } /* --- VLASTNÝ INPUT (PODMET) --- */ #prompt-builder-app .custom-subject-container { margin-top: 10px; padding-top: 10px; border-top: none; } #prompt-builder-app .custom-subject-label { display: block; font-size: 11px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; } #prompt-builder-app .custom-subject-input { width: 100%; padding: 14px 16px; border: 1px solid var(--border-dark); border-radius: 8px; font-family: 'Inter', sans-serif; font-size: 14px; color: var(--text-main); outline: none; transition: 0.2s; background: var(--bg-canvas); box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); } #prompt-builder-app .custom-subject-input:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); } /* --- TABS & TAGS --- */ #prompt-builder-app .l2-tabs-container { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); padding-bottom: 12px; flex-wrap: wrap; } #prompt-builder-app .l2-tab-btn { padding: 6px 14px; border-radius: 6px; border: none; background: transparent; color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.2s; } #prompt-builder-app .l2-tab-btn:hover { background: #e2e8f0; color: var(--text-main); } #prompt-builder-app .l2-tab-btn.active { background: var(--text-main); color: #ffffff; } #prompt-builder-app .l2-content { display: none; animation: pbFadeIn 0.4s ease; } #prompt-builder-app .l2-content.active { display: block; } #prompt-builder-app .l3-tabs-container { display: flex; gap: 8px; margin-bottom: 15px; flex-wrap: wrap; } #prompt-builder-app .l3-tab-btn { padding: 5px 12px; border-radius: 20px; border: 1px solid var(--border-dark); background: #fff; color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: 0.2s; } #prompt-builder-app .l3-tab-btn:hover { border-color: var(--text-main); color: var(--text-main); background: #ffffff; } #prompt-builder-app .l3-tab-btn.active { background: var(--text-main); border-color: var(--text-main); color: #ffffff; font-weight: 600; } #prompt-builder-app .l3-content { display: none; padding: 15px; background: #fafbfc; border: 1px solid var(--border); border-radius: 8px; animation: pbSlideDown 0.4s cubic-bezier(0.16, 1, 0.3, 1); margin-bottom: 10px; } #prompt-builder-app .l3-content.active { display: block; } @keyframes pbFadeIn { from { opacity: 0; } to { opacity: 1; } } @keyframes pbSlideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } } #prompt-builder-app .tags-container { display: flex; flex-wrap: wrap; gap: 8px; } #prompt-builder-app .tag-wrapper { position: relative; } #prompt-builder-app .term-tag { background: #ffffff; border: 1px solid var(--border-dark); border-radius: 4px; padding: 6px 12px; font-size: 12px; color: var(--text-main); font-family: 'Inter', sans-serif; cursor: pointer; transition: 0.2s ease; user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,0.02); } #prompt-builder-app .term-tag:hover { border-color: var(--text-main); transform: translateY(-1px); } #prompt-builder-app .term-tag.selected { background: var(--text-main); color: #fff; border-color: var(--text-main); font-weight: 600; box-shadow: 0 4px 10px rgba(0,0,0,0.1); } /* --- TOOLTIP --- */ #prompt-builder-app .card-tooltip { position: absolute; bottom: 130%; left: 50%; transform: translateX(-50%) translateY(10px); width: 240px; background: #ffffff; border: 1px solid var(--border-dark); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.1); opacity: 0; visibility: hidden; transition: 0.25s cubic-bezier(0.16, 1, 0.3, 1); pointer-events: none; z-index: 100; overflow: hidden; } #prompt-builder-app .tag-wrapper:hover .card-tooltip { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); } #prompt-builder-app .card-tooltip::after { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -6px; border-width: 6px; border-style: solid; border-color: #ffffff transparent transparent transparent; } #prompt-builder-app .card-tooltip::before { content: ''; position: absolute; top: 100%; left: 50%; margin-left: -7px; border-width: 7px; border-style: solid; border-color: var(--border-dark) transparent transparent transparent; } #prompt-builder-app .tooltip-img { width: 100%; height: 120px; background: #f1f5f9; display: flex; align-items: center; justify-content: center; font-size: 10px; color: #94a3b8; } #prompt-builder-app .tooltip-img img { width: 100%; height: 100%; object-fit: cover; } #prompt-builder-app .tooltip-text { padding: 12px; font-size: 11px; line-height: 1.4; color: var(--text-muted); text-align: center; } #prompt-builder-app .tooltip-title { font-weight: 700; color: var(--text-main); margin-bottom: 4px; font-size: 12px; } /* --- NAV TLAČIDLÁ --- */ #prompt-builder-app .step-nav { display: flex; justify-content: space-between; margin-top: 20px; padding-top: 0; border-top: none; } #prompt-builder-app .btn-nav { padding: 8px 16px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; border-radius: 4px; cursor: pointer; transition: 0.2s; border: none; } #prompt-builder-app .btn-prev { background: #fff; color: var(--text-muted); border: 1px solid var(--border-dark); } #prompt-builder-app .btn-prev:hover { background: var(--accent-light); color: var(--text-main); } #prompt-builder-app .btn-next { background: var(--text-main); color: #fff; display: flex; align-items: center; gap: 6px;} #prompt-builder-app .btn-next:hover { background: #333; transform: translateX(3px); } /* --- SPODNÁ KONZOLA --- */ #prompt-builder-app .prompt-console { position: absolute; bottom: 0; left: 0; width: 100%; background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-top: 1px solid var(--border-dark); padding: 15px 20px; z-index: 1000; box-shadow: 0 -4px 20px rgba(0,0,0,0.03); } #prompt-builder-app .console-inner { max-width: 1000px; margin: 0 auto; display: flex; gap: 16px; align-items: center; } #prompt-builder-app .console-textarea { flex: 1; height: 42px; padding: 10px 14px; border: 1px solid var(--border-dark); border-radius: 6px; font-family: ui-monospace, monospace; font-size: 13px; background: #fff; color: var(--text-main); resize: none; outline: none; transition: 0.2s; white-space: nowrap; overflow-x: auto; box-shadow: inset 0 2px 4px rgba(0,0,0,0.02); } #prompt-builder-app .console-textarea:focus { border-color: var(--text-main); } #prompt-builder-app .btn-action { padding: 0 16px; height: 42px; font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; cursor: pointer; border-radius: 6px; border: 1px solid var(--border-dark); background: #fff; transition: 0.2s; } #prompt-builder-app .btn-action:hover { background: var(--accent-light); } #prompt-builder-app .btn-copy { background: var(--text-main); color: #fff; border-color: var(--text-main); } #prompt-builder-app .btn-copy:hover { background: #333; } #prompt-builder-app #loading-message { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-weight: 600; color: var(--text-muted); background: #fff; padding: 10px 20px; border-radius: 20px; border: 1px solid var(--border); box-shadow: 0 4px 10px rgba(0,0,0,0.05); z-index: 50;}
Pripájam sieť nodov...
const csvUrl = 'https://docs.google.com/spreadsheets/d/e/2PACX-1vRvrAkEvWJEDxSsGWT9kJFbBinPJo3-z0jidKrQEWYFOvSBUW0wW8u7D9nxn7zBHMyXpsU8iKzlr3AX/pub?gid=0&single=true&output=csv'; let lexiconData = []; let structure = {}; let mainCategories = []; let currentSlideIndex = 0; let selectedSnippets = new Map(); async function initApp() { try { const response = await fetch(csvUrl + '&t=' + new Date().getTime()); if (!response.ok) throw new Error("Chyba siete."); const csvText = await response.text(); processCSV(csvText); document.getElementById('loading-message').style.display = 'none'; buildUI(); } catch (error) { console.error(error); document.getElementById('loading-message').innerText = "Chyba načítania. Skontrolujte CSV odkaz."; } } initApp(); function processCSV(str) { const arr = []; let quote = false; let row = 0, col = 0; for (let c = 0; c { if (row.length >= 4 && row[0] && row[0].trim() !== "") { const mainCat = row[0].trim(); if (mainCat.toLowerCase() === "main category") return; if (!mainCategories.includes(mainCat)) mainCategories.push(mainCat); lexiconData.push({ mainCategory: mainCat, subCategory: row[1] ? row[1].trim() : "Ostatné", subSubCategory: row[2] ? row[2].trim() : "Možnosti", title: row[3] ? row[3].trim() : "", snippet: row[4] ? row[4].trim() : "", definition: row[5] ? row[5].trim() : "", image: row[6] ? row[6].trim() : "", id: 'term-' + Math.random().toString(36).substr(2, 9) }); } }); lexiconData.forEach(item => { if (!structure[item.mainCategory]) structure[item.mainCategory] = {}; if (!structure[item.mainCategory][item.subCategory]) structure[item.mainCategory][item.subCategory] = {}; if (!structure[item.mainCategory][item.subCategory][item.subSubCategory]) structure[item.mainCategory][item.subCategory][item.subSubCategory] = []; structure[item.mainCategory][item.subCategory][item.subSubCategory].push(item); }); } function buildUI() { buildTimeline(); buildSlides(); updateSlider(); } function buildTimeline() { const timeline = document.getElementById('timeline-container'); let html = ''; mainCategories.forEach((cat, index) => { const isLast = index === mainCategories.length - 1; const cleanLabel = cat.replace(/^[0-9.s]+/, ''); html += `
✓
${cleanLabel}
`; if (!isLast) { html += `
`; } }); timeline.innerHTML = html; } function buildSlides() { const track = document.getElementById('slider-track'); let html = ''; mainCategories.forEach((mainCat, mainIdx) => { const isFirstSlide = mainIdx === 0; const isLastSlide = mainIdx === mainCategories.length - 1; const subCats = structure[mainCat]; html += `
${!isFirstSlide ? '
' : ''} ${!isLastSlide ? '
' : ''}

${mainCat}

Node ${mainIdx + 1}/${mainCategories.length}
`; if (isFirstSlide) { html += ``; } if (!isFirstSlide) { html += `
`; Object.keys(subCats).forEach((subCat, subIdx) => { // 🔻 ZMENA: Zmazané auto-aktívne priraďovanie pre L2 html += ``; }); html += `
`; } Object.keys(subCats).forEach((subCat, subIdx) => { // 🔻 ZMENA: Iba prvý slide má predvolene otvorený obsah const isL2Active = isFirstSlide ? 'active' : ''; html += `
`; const subSubCats = subCats[subCat]; if (!isFirstSlide) { html += `
`; Object.keys(subSubCats).forEach((subSubCat, subSubIdx) => { html += ``; }); html += `
`; } Object.keys(subSubCats).forEach((subSubCat, subSubIdx) => { const items = subSubCats[subSubCat]; // 🔻 ZMENA: Iba prvý slide má predvolene viditeľné tagy. Pre ostatné sa otvoria po kliknutí. const isL3Active = isFirstSlide ? 'active' : ''; html += `
`; items.forEach(item => { const safeSnippet = item.snippet.replace(/'/g, "'").replace(/"/g, '"'); const imgHTML = item.image ? `` : `Bez náhľadu`; html += `
${imgHTML}
${item.title}
${item.definition || 'Kliknutím zapojíte parameter.'}
`; }); html += `
`; }); html += `
`; }); if (isFirstSlide) { html += `
`; } html += `
`; if (!isFirstSlide) html += ``; else html += `
`; if (!isLastSlide) html += ``; else html += ``; html += `
`; }); track.innerHTML = html; } window.switchL2 = function(mainIdx, subIdx, btn) { const nodeBody = document.getElementById(`slide-${mainIdx}`); nodeBody.querySelectorAll('.l2-tab-btn').forEach(b => b.classList.remove('active')); nodeBody.querySelectorAll('.l2-content').forEach(c => c.classList.remove('active')); btn.classList.add('active'); document.getElementById(`l2-content-${mainIdx}-${subIdx}`).classList.add('active'); const activeContent = document.getElementById(`l2-content-${mainIdx}-${subIdx}`); activeContent.querySelectorAll('.l3-tab-btn').forEach(b => b.classList.remove('active')); activeContent.querySelectorAll('.l3-content').forEach(c => c.classList.remove('active')); // Zabezpečíme, že po prepnutí L2 tabu sa automaticky otvorí prvá L3 kategória const firstL3Btn = activeContent.querySelector('.l3-tab-btn'); const firstL3Content = activeContent.querySelector('.l3-content'); if(firstL3Btn) firstL3Btn.classList.add('active'); if(firstL3Content) firstL3Content.classList.add('active'); }; window.switchL3 = function(mainIdx, subIdx, subSubIdx, btn) { const container = document.getElementById(`l2-content-${mainIdx}-${subIdx}`); const contentBox = document.getElementById(`l3-content-${mainIdx}-${subIdx}-${subSubIdx}`); if (btn.classList.contains('active')) { btn.classList.remove('active'); contentBox.classList.remove('active'); return; } container.querySelectorAll('.l3-tab-btn').forEach(b => b.classList.remove('active')); container.querySelectorAll('.l3-content').forEach(c => c.classList.remove('active')); btn.classList.add('active'); contentBox.classList.add('active'); }; window.goNext = function() { if (currentSlideIndex 0) { currentSlideIndex--; updateSlider(); } }; function updateSlider() { document.getElementById('slider-track').style.transform = `translateX(-${currentSlideIndex * 100}%)`; mainCategories.forEach((_, index) => { const node = document.getElementById(`mini-node-${index}`); const line = document.getElementById(`mini-line-${index}`); if (index { btn.innerText = orig; btn.style.background = "var(--text-main)"; btn.style.borderColor = "var(--text-main)"; }, 1500); }; window.resetPrompt = function() { selectedSnippets.clear(); document.querySelectorAll('.term-tag').forEach(c => c.classList.remove('selected')); if(document.getElementById('custom-subject-input')) { document.getElementById('custom-subject-input').value = ''; } updateOutput(); };