| Форум » Флуд » Общение » Поговорим о... |
| Поговорим о... |
Среда, Сегодня, 12:15
# 31
гггг
Прикрепления:
6637554.txt
(31.4 Kb)
|
Среда, Сегодня, 12:18
# 32
Найдено интервалов категорий пород: 11
GeoScan_2.58.html:13315 Результат извлечения категорий пород: (10) ['100635: 0-1.6 - VI', '100636: 1.6-17 - VIII; 17-85 - IX', '100637: 85-89.5 - V', '100638: 89.5-90 - IX', '100639: 90-98.8 - V', '100640: 98.8-110.7 - VI', '100641: 110.7-117.9 - VII', '100642: 117.9-126.3 - V', '100643: 126.3-136.1 - V', '100644: 136.1-138 - V'] GeoScan_2.58.html:4534 Всего интервалов документирования в файле: 10 📊 Категория из интервала: 0-1.6м → VI GeoScan_2.58.html:8681 📊 Категория из интервала: 1.6-85м → VIII GeoScan_2.58.html:8681 📊 Категория из интервала: 85-89.5м → V GeoScan_2.58.html:8681 📊 Категория из интервала: 89.5-90м → IX GeoScan_2.58.html:8681 📊 Категория из интервала: 90-98.8м → V GeoScan_2.58.html:8681 📊 Категория из интервала: 98.8-110.7м → VI GeoScan_2.58.html:8681 📊 Категория из интервала: 110.7-117.9м → VII GeoScan_2.58.html:8681 📊 Категория из интервала: 117.9-126.3м → V GeoScan_2.58.html:8681 📊 Категория из интервала: 126.3-136.1м → V GeoScan_2.58.html:8681 📊 Категория из интервала: 136.1-138м → V GeoScan_2.58.html:8690 📊 ИТОГО КАТЕГОРИЙ ПОРОД: 10 (10) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}] 0 : {from: 0, to: 1.6, category: 'VI'} 1 : {from: 1.6, to: 85, category: 'VIII'} 2 : {from: 85, to: 89.5, category: 'V'} 3 : {from: 89.5, to: 90, category: 'IX'} 4 : {from: 90, to: 98.8, category: 'V'} 5 : {from: 98.8, to: 110.7, category: 'VI'} 6 : {from: 110.7, to: 117.9, category: 'VII'} 7 : {from: 117.9, to: 126.3, category: 'V'} 8 : {from: 126.3, to: 136.1, category: 'V'} 9 : {from: 136.1, to: 138, category: 'V'} |
Среда, Сегодня, 12:24
# 33
34534535
Прикрепления:
5717964.txt
(33.7 Kb)
|
Среда, Сегодня, 12:56
# 34
// ОТРИСОВЫВАЕМ ИНТЕРВАЛЫ С ДОКУМЕНТИРОВАНИЕМ
mergedGeology.forEach((geo, index) => { const top = geo.from * scale + topReserve; const height = (geo.to - geo.from) * scale; if (height > 0) { const convertedStratigraphy = convertStratigraphyText(geo.stratigraphy || 'Не указано'); const decodedStratigraphy = decodeStratigraphyForDisplay(convertedStratigraphy); // ОСНОВНОЙ КОНТЕЙНЕР const geologyElement = document.createElement('div'); geologyElement.className = 'geology-interval documented'; geologyElement.setAttribute('data-interval-index', index); geologyElement.setAttribute('data-from', geo.from); geologyElement.setAttribute('data-to', geo.to); geologyElement.style.cssText = ` position: absolute; top: ${top}px; left: 100px; width: ${columnWidth}px; height: ${height}px; background: transparent; z-index: 20; pointer-events: none; `; // ВИЗУАЛЬНЫЙ ЭЛЕМЕНТ const visualElement = document.createElement('div'); // ИСПРАВЛЕННЫЙ ВЫЗОВ - передаем объект с оригинальной стратиграфией const backgroundColor = getStratigraphyBackground({ stratigraphy: geo.stratigraphy, originalStratigraphy: geo.originalStratigraphy }); visualElement.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: ${backgroundColor}; border-left: 2px solid rgba(0,0,0,0.5); border-right: 2px solid rgba(0,0,0,0.5); z-index: 21; pointer-events: none; `; // ГРАНИЦЫ МЕЖДУ ИНТЕРВАЛАМИ if (index > 0) { const topBorder = document.createElement('div'); topBorder.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: #000000; z-index: 24; pointer-events: none; `; visualElement.appendChild(topBorder); } const bottomBorder = document.createElement('div'); bottomBorder.style.cssText = ` position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; background: #000000; z-index: 24; pointer-events: none; `; visualElement.appendChild(bottomBorder); // ГЕОЛОГИЧЕСКИЙ КРАП if (geo.lithology && geo.lithology !== 'Не указано' && geo.lcode) { const patternOverlay = document.createElement('div'); const patternSize = getPatternSize(); const fileName = window.LITHOLOGY_PATTERNS && window.LITHOLOGY_PATTERNS[geo.lcode]; if (fileName) { const patternUrl = `litology/${fileName}`; patternOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url("${patternUrl}"); background-repeat: repeat; background-size: ${patternSize.width}px ${patternSize.height}px; background-position: 0 0; opacity: 0.7; z-index: 22; pointer-events: none; `; const preloadImage = new Image(); preloadImage.src = patternUrl; visualElement.appendChild(patternOverlay); } } // ИНДЕКС СТРАТИГРАФИИ - УЛУЧШЕННЫЙ ВИД if (decodedStratigraphy && decodedStratigraphy !== 'Не указано' && height > 10) { const stratigraphyLabel = document.createElement('div'); // ИСПРАВЛЕННЫЙ ВЫЗОВ - для текста тоже используем правильный цвет фона const bgColor = getStratigraphyBackground({ stratigraphy: geo.stratigraphy, originalStratigraphy: geo.originalStratigraphy }); const isDarkBackground = isColorDark(bgColor); const textColor = isDarkBackground ? '#ffffff' : '#000000'; stratigraphyLabel.style.cssText = ` position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: ${textColor}; font-size: ${Math.min(11, height / 2)}px; font-weight: 800; white-space: nowrap; background: ${bgColor}; padding: 3px 6px; border-radius: 0px; pointer-events: none; z-index: 23; max-width: ${columnWidth - 4}px; overflow: hidden; text-overflow: ellipsis; text-shadow: 1px 1px 2px rgba(0,0,0,0.3); text-align: center; font-family: 'GeoindexA', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; border: none; box-shadow: none; letter-spacing: 0.5px; `; stratigraphyLabel.textContent = decodedStratigraphy; visualElement.appendChild(stratigraphyLabel); } // КЛИКАБЕЛЬНЫЙ ОВЕРЛЕЙ (только для интервалов с документированием) const clickableOverlay = document.createElement('div'); clickableOverlay.className = 'geology-clickable-overlay'; clickableOverlay.setAttribute('data-interval-index', index); clickableOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 35; cursor: pointer; transition: all 0.3s ease; `; // Обработчики событий clickableOverlay.addEventListener('click', function(e) { e.stopPropagation(); e.preventDefault(); if (window.currentSelectedInterval) { window.currentSelectedInterval.style.boxShadow = ''; window.currentSelectedInterval.style.background = 'transparent'; window.currentSelectedInterval.style.border = 'none'; } this.style.boxShadow = '0 0 0 2px #e74c3c, inset 0 0 0 1px rgba(231, 76, 60, 0.3)'; this.style.background = 'rgba(231, 76, 60, 0.1)'; this.style.border = '1px dashed #e74c3c'; window.currentSelectedInterval = this; const intervalIndex = parseInt(this.getAttribute('data-interval-index')); highlightCard(intervalIndex); }); clickableOverlay.addEventListener('mouseenter', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'rgba(231, 76, 60, 0.05)'; this.style.border = '1px dashed #e74c3c'; } }); clickableOverlay.addEventListener('mouseleave', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'transparent'; this.style.border = 'none'; } }); geologyElement.appendChild(visualElement); geologyElement.appendChild(clickableOverlay); drawingContainer.appendChild(geologyElement); allGeologyElements.push(geologyElement); } }); window.geologyElements = allGeologyElements; } Добавлено (2026-04-29, 12:56) |
Среда, Сегодня, 13:04
# 35
3453453453
Прикрепления:
3358705.txt
(34.8 Kb)
|
Среда, Сегодня, 13:12
# 36
// ==================== ОТРИСОВКА ГЕОЛОГИИ (УЛУЧШЕННАЯ) ====================
const geologyBlocks = []; mergedGeology.forEach((geo, index) => { const top = geo.from * scale + topReserve; const height = (geo.to - geo.from) * scale; if (height > 0.5 && top <= contentHeight) { // Конвертируем стратиграфию const convertedStratigraphy = convertStratigraphyText(geo.stratigraphy || 'Не указано'); const decodedStratigraphy = decodeStratigraphyForDisplay(convertedStratigraphy); // ОСНОВНОЙ КОНТЕЙНЕР const geologyElement = document.createElement('div'); geologyElement.className = 'geology-interval documented'; geologyElement.setAttribute('data-interval-index', index); geologyElement.setAttribute('data-from', geo.from); geologyElement.setAttribute('data-to', geo.to); geologyElement.style.cssText = ` position: absolute; top: ${top}px; left: 0; width: 100%; height: ${Math.min(height, contentHeight - top)}px; background: transparent; z-index: 20; pointer-events: none; `; // ВИЗУАЛЬНЫЙ ЭЛЕМЕНТ const visualElement = document.createElement('div'); const backgroundColor = getStratigraphyBackground({ stratigraphy: geo.stratigraphy, originalStratigraphy: geo.originalStratigraphy }); visualElement.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: ${backgroundColor}; border-left: 2px solid rgba(0,0,0,0.5); border-right: 2px solid rgba(0,0,0,0.5); z-index: 21; pointer-events: none; `; // ТОЛЬКО НИЖНЯЯ ГРАНИЦА (убрали верхнюю) const bottomBorder = document.createElement('div'); bottomBorder.style.cssText = ` position: absolute; bottom: 0; left: 0; width: 100%; height: 1px; background: #000000; z-index: 24; pointer-events: none; `; visualElement.appendChild(bottomBorder); // ГЕОЛОГИЧЕСКИЙ КРАП if (geo.lithology && geo.lithology !== 'Не указано' && geo.lcode) { const patternOverlay = document.createElement('div'); const patternSize = getPatternSize(scale); const fileName = window.LITHOLOGY_PATTERNS && window.LITHOLOGY_PATTERNS[geo.lcode]; if (fileName) { const patternUrl = `litology/${fileName}`; patternOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-image: url("${patternUrl}"); background-repeat: repeat; background-size: ${patternSize.width}px ${patternSize.height}px; background-position: 0 0; opacity: 0.5; z-index: 22; pointer-events: none; `; visualElement.appendChild(patternOverlay); } } // ИНДЕКС СТРАТИГРАФИИ - ТОЛЬКО ЕСЛИ ЕСТЬ МЕСТО (HEIGHT > 12px) if (decodedStratigraphy && decodedStratigraphy !== 'Не указано' && decodedStratigraphy !== '—' && height > 12) { const stratigraphyLabel = document.createElement('div'); const bgColor = getStratigraphyBackground({ stratigraphy: geo.stratigraphy, originalStratigraphy: geo.originalStratigraphy }); const isDarkBackground = isColorDark(bgColor); const textColor = isDarkBackground ? '#ffffff' : '#000000'; // АДАПТИВНЫЙ РАЗМЕР ШРИФТА let fontSize = Math.min(11, height / 2.5); fontSize = Math.max(8, fontSize); stratigraphyLabel.style.cssText = ` position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); color: ${textColor}; font-size: ${fontSize}px; font-weight: 800; white-space: nowrap; background: ${bgColor}; padding: 2px 4px; border-radius: 2px; pointer-events: none; z-index: 23; max-width: ${columnWidth - 8}px; overflow: hidden; text-overflow: ellipsis; text-shadow: 0.5px 0.5px 0px rgba(0,0,0,0.2); text-align: center; font-family: 'GeoindexA', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; border: none; box-shadow: none; letter-spacing: 0.3px; `; stratigraphyLabel.textContent = decodedStratigraphy; visualElement.appendChild(stratigraphyLabel); } // КЛИКАБЕЛЬНЫЙ ОВЕРЛЕЙ const clickableOverlay = document.createElement('div'); clickableOverlay.className = 'geology-clickable-overlay'; clickableOverlay.setAttribute('data-interval-index', index); clickableOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 35; cursor: pointer; transition: all 0.2s ease; `; clickableOverlay.addEventListener('click', function(e) { e.stopPropagation(); e.preventDefault(); if (window.currentSelectedInterval) { window.currentSelectedInterval.style.boxShadow = ''; window.currentSelectedInterval.style.background = 'transparent'; window.currentSelectedInterval.style.border = 'none'; } this.style.boxShadow = '0 0 0 2px #e74c3c, inset 0 0 0 1px rgba(231, 76, 60, 0.3)'; this.style.background = 'rgba(231, 76, 60, 0.1)'; this.style.border = '1px dashed #e74c3c'; window.currentSelectedInterval = this; const intervalIndex = parseInt(this.getAttribute('data-interval-index')); highlightGeologyBlock(intervalIndex, geologyBlocks); if (window.geologyCards && window.geologyCards[intervalIndex]) { window.geologyCards[intervalIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }); window.geologyCards[intervalIndex].click(); } }); clickableOverlay.addEventListener('mouseenter', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'rgba(231, 76, 60, 0.05)'; this.style.border = '1px dashed #e74c3c'; } }); clickableOverlay.addEventListener('mouseleave', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'transparent'; this.style.border = 'none'; } }); geologyElement.appendChild(visualElement); geologyElement.appendChild(clickableOverlay); coreBody.appendChild(geologyElement); geologyBlocks.push(geologyElement); } }); |
Среда, Сегодня, 13:16
# 37
// КЛИКАБЕЛЬНЫЙ ОВЕРЛЕЙ
const clickableOverlay = document.createElement('div'); clickableOverlay.className = 'geology-clickable-overlay'; clickableOverlay.setAttribute('data-interval-index', index); clickableOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 35; cursor: pointer; transition: all 0.2s ease; `; clickableOverlay.addEventListener('click', function(e) { e.stopPropagation(); e.preventDefault(); // Снимаем выделение с предыдущего if (window.currentSelectedInterval) { window.currentSelectedInterval.style.outline = ''; window.currentSelectedInterval.style.backgroundColor = ''; } // Выделяем текущий - МИНИМАЛЬНО, БЕЗ РАЗРЫВОВ this.style.outline = '2px solid #e74c3c'; this.style.backgroundColor = 'rgba(231, 76, 60, 0.08)'; window.currentSelectedInterval = this; const intervalIndex = parseInt(this.getAttribute('data-interval-index')); highlightGeologyBlock(intervalIndex, geologyBlocks); if (window.geologyCards && window.geologyCards[intervalIndex]) { window.geologyCards[intervalIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }); window.geologyCards[intervalIndex].click(); } }); clickableOverlay.addEventListener('mouseenter', function() { if (this !== window.currentSelectedInterval) { this.style.backgroundColor = 'rgba(231, 76, 60, 0.04)'; } }); clickableOverlay.addEventListener('mouseleave', function() { if (this !== window.currentSelectedInterval) { this.style.backgroundColor = ''; } }); |
Среда, Сегодня, 13:20
# 38
// КЛИКАБЕЛЬНЫЙ ОВЕРЛЕЙ
const clickableOverlay = document.createElement('div'); clickableOverlay.className = 'geology-clickable-overlay'; clickableOverlay.setAttribute('data-interval-index', index); clickableOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 35; cursor: pointer; `; clickableOverlay.addEventListener('click', function(e) { e.stopPropagation(); e.preventDefault(); // Снимаем выделение с предыдущего if (window.currentSelectedInterval) { window.currentSelectedInterval.style.background = 'transparent'; } // Выделяем текущий - ТОЛЬКО ЦВЕТ ФОНА, БЕЗ БОРДЕРОВ this.style.background = 'rgba(231, 76, 60, 0.12)'; window.currentSelectedInterval = this; const intervalIndex = parseInt(this.getAttribute('data-interval-index')); highlightGeologyBlock(intervalIndex, geologyBlocks); if (window.geologyCards && window.geologyCards[intervalIndex]) { window.geologyCards[intervalIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }); window.geologyCards[intervalIndex].click(); } }); clickableOverlay.addEventListener('mouseenter', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'rgba(231, 76, 60, 0.06)'; } }); clickableOverlay.addEventListener('mouseleave', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'transparent'; } }); |
Среда, Сегодня, 13:24
# 39
Понял, проблема в функции `highlightGeologyBlock` - она также добавляет стили к блокам. Нужно исправить и её.
Вот **полностью исправленная функция `highlightGeologyBlock`** (убираем все бордеры и тени): ```javascript function highlightGeologyBlock(index, blocks) { blocks.forEach((block, i) => { if (i === index) { // Только легкий фон, никаких бордеров и теней block.style.backgroundColor = 'rgba(231, 76, 60, 0.08)'; } else { block.style.backgroundColor = ''; } }); // Выделяем карточку справа if (window.geologyCards) { document.querySelectorAll('.geology-card').forEach((card, i) => { if (i === index) { card.style.background = '#fff7ed'; card.style.borderLeft = '4px solid #e74c3c'; } else { card.style.background = 'white'; card.style.borderLeft = '4px solid #e9ecef'; } }); } } ``` А также в обработчике клика уберите лишние стили: ```javascript // КЛИКАБЕЛЬНЫЙ ОВЕРЛЕЙ const clickableOverlay = document.createElement('div'); clickableOverlay.className = 'geology-clickable-overlay'; clickableOverlay.setAttribute('data-interval-index', index); clickableOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent; z-index: 35; cursor: pointer; `; clickableOverlay.addEventListener('click', function(e) { e.stopPropagation(); e.preventDefault(); // Снимаем выделение с предыдущего if (window.currentSelectedInterval) { window.currentSelectedInterval.style.background = 'transparent'; } // Выделяем текущий - ТОЛЬКО ЦВЕТ ФОНА this.style.background = 'rgba(231, 76, 60, 0.12)'; window.currentSelectedInterval = this; const intervalIndex = parseInt(this.getAttribute('data-interval-index')); highlightGeologyBlock(intervalIndex, geologyBlocks); if (window.geologyCards && window.geologyCards[intervalIndex]) { window.geologyCards[intervalIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }); window.geologyCards[intervalIndex].click(); } }); clickableOverlay.addEventListener('mouseenter', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'rgba(231, 76, 60, 0.05)'; } }); clickableOverlay.addEventListener('mouseleave', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'transparent'; } }); ``` **Что исправлено:** 1. В `highlightGeologyBlock` убраны `border`, `boxShadow`, `outline` - теперь только `backgroundColor` 2. В обработчике клика убраны все лишние стили 3. Выделение теперь только через полупрозрачный красный фон Теперь никаких разрывов между интервалами при клике не будет. |
Среда, Сегодня, 13:26
# 40
Понял, нужно полностью убрать все эффекты. Проблема может быть в CSS-классах или в inherited стилях. Давайте сделаем полный сброс стилей для clickableOverlay:
```javascript // КЛИКАБЕЛЬНЫЙ ОВЕРЛЕЙ const clickableOverlay = document.createElement('div'); clickableOverlay.className = 'geology-clickable-overlay'; clickableOverlay.setAttribute('data-interval-index', index); clickableOverlay.style.cssText = ` position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: transparent !important; z-index: 35; cursor: pointer; outline: none !important; border: none !important; box-shadow: none !important; text-shadow: none !important; transition: none !important; `; clickableOverlay.addEventListener('click', function(e) { e.stopPropagation(); e.preventDefault(); // Снимаем выделение с предыдущего if (window.currentSelectedInterval) { window.currentSelectedInterval.style.background = 'transparent'; window.currentSelectedInterval.style.outline = 'none'; window.currentSelectedInterval.style.boxShadow = 'none'; } // Только цвет фона, ничего больше this.style.background = 'rgba(231, 76, 60, 0.1)'; window.currentSelectedInterval = this; const intervalIndex = parseInt(this.getAttribute('data-interval-index')); highlightGeologyBlock(intervalIndex, geologyBlocks); if (window.geologyCards && window.geologyCards[intervalIndex]) { window.geologyCards[intervalIndex].scrollIntoView({ behavior: 'smooth', block: 'center' }); window.geologyCards[intervalIndex].click(); } }); clickableOverlay.addEventListener('mouseenter', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'rgba(231, 76, 60, 0.05)'; } }); clickableOverlay.addEventListener('mouseleave', function() { if (this !== window.currentSelectedInterval) { this.style.background = 'transparent'; } }); ``` И обновленная `highlightGeologyBlock`: ```javascript function highlightGeologyBlock(index, blocks) { blocks.forEach((block, i) => { if (i === index) { block.style.backgroundColor = 'rgba(231, 76, 60, 0.08)'; block.style.boxShadow = 'none'; block.style.outline = 'none'; block.style.border = 'none'; } else { block.style.backgroundColor = ''; block.style.boxShadow = ''; block.style.outline = ''; block.style.border = ''; } }); if (window.geologyCards) { document.querySelectorAll('.geology-card').forEach((card, i) => { if (i === index) { card.style.background = '#fff7ed'; card.style.borderLeft = '4px solid #e74c3c'; } else { card.style.background = 'white'; card.style.borderLeft = '4px solid #e9ecef'; } }); } } ``` **Что добавлено:** - `!important` для полного сброса стилей - `outline: none` и `box-shadow: none` - `transition: none` чтобы не было анимации Теперь никаких теней и разрывов быть не должно. |
| |||


