diff --git a/smartsoltech/web/templates/web/home_modern.html b/smartsoltech/web/templates/web/home_modern.html index bf77275..1d3565e 100644 --- a/smartsoltech/web/templates/web/home_modern.html +++ b/smartsoltech/web/templates/web/home_modern.html @@ -367,10 +367,6 @@
- - - πŸ’Ό ΠŸΠΎΡ€Ρ‚Ρ„ΠΎΠ»ΠΈΠΎ -

Наши Ρ€Π°Π±ΠΎΡ‚Ρ‹

@@ -420,10 +416,6 @@
- - - πŸ“ Π‘Π»ΠΎΠ³ -

ПослСдниС ΡΡ‚Π°Ρ‚ΡŒΠΈ

@@ -468,10 +460,7 @@
- - - πŸ“° Новости - +

ПослСдниС новости

@@ -703,7 +692,7 @@ padding: 8px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3); transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); - min-width: 80px; + min-width: 120px; height: 48px; display: flex; align-items: center; @@ -725,8 +714,7 @@ padding: 0; transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); height: 32px; - position: relative; - min-width: 200px; + width: 100%; } .pill-indicator { @@ -736,12 +724,12 @@ width: 32px; height: 32px; padding: 0; - margin: 0; + margin: 0 2px; color: transparent; font-size: 0; cursor: pointer; transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1); - position: absolute; + position: relative; overflow: hidden; backdrop-filter: blur(5px); display: flex; @@ -749,9 +737,6 @@ justify-content: center; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3); flex-shrink: 0; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); } .pill-indicator::before { @@ -772,15 +757,12 @@ font-weight: 600; padding: 0 16px; border-radius: 16px; - width: 80px; + width: auto; height: 32px; min-width: 80px; box-shadow: 0 5px 15px rgba(255, 255, 255, 0.3); backdrop-filter: blur(10px); - position: relative; - top: auto; - left: auto; - transform: none; + margin: 0 8px; } .pill-indicator.active::before { @@ -939,7 +921,7 @@ document.addEventListener('DOMContentLoaded', function() { } }); - // Анимация внСшнСй pill ΠΈ ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΎΠ½ΠΈΡ€ΠΎΠ²Π°Π½ΠΈΠ΅ ΠΌΠ°Ρ€ΠΊΠ΅Ρ€ΠΎΠ² + // ОбновляСм ΡˆΠΈΡ€ΠΈΠ½Ρƒ внСшнСй пилюли setTimeout(() => { if (outerPill) { const activeIndicator = indicators[index]; @@ -952,55 +934,24 @@ document.addEventListener('DOMContentLoaded', function() { let activePillWidth = 80; // минимальная ΡˆΠΈΡ€ΠΈΠ½Π° Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ элСмСнта if (titleElement && titleElement.textContent) { - // Π€ΠΎΡ€ΠΌΡƒΠ»Π°: Π΄Π»ΠΈΠ½Π° тСкста * 7px + padding (32px) + min-width + // Π€ΠΎΡ€ΠΌΡƒΠ»Π°: Π΄Π»ΠΈΠ½Π° тСкста * 8px + padding (32px) + min-width const textLength = titleElement.textContent.length; - activePillWidth = Math.max(textLength * 7 + 32, 80); + activePillWidth = Math.max(textLength * 8 + 32, 80); } - // УстанавливаСм ΡˆΠΈΡ€ΠΈΠ½Ρƒ Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ элСмСнта для Ρ‚ΠΎΡ‡Π½ΠΎΠ³ΠΎ расчСта - activeIndicator.style.width = activePillWidth + 'px'; + // ΠšΠΎΠ»ΠΈΡ‡Π΅ΡΡ‚Π²ΠΎ Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… ΠΌΠ°Ρ€ΠΊΠ΅Ρ€ΠΎΠ² + const inactiveCount = indicators.length - 1; - // РассчитываСм ΠΏΠΎΠ·ΠΈΡ†ΠΈΠΈ для ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ ΠΌΠ°Ρ€ΠΊΠ΅Ρ€Π° - const fixedGap = 8; // фиксированный ΠΈΠ½Ρ‚Π΅Ρ€Π²Π°Π» ΠΌΠ΅ΠΆΠ΄Ρƒ элСмСнтами - const markerSize = 32; // Ρ€Π°Π·ΠΌΠ΅Ρ€ Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ ΠΌΠ°Ρ€ΠΊΠ΅Ρ€Π° + // Π¨ΠΈΡ€ΠΈΠ½Π° Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… элСмСнтов: 32px ΠΊΠ°ΠΆΠ΄Ρ‹ΠΉ + margin 4px ΠΌΠ΅ΠΆΠ΄Ρƒ Π½ΠΈΠΌΠΈ + const inactiveWidth = inactiveCount * 32 + (inactiveCount > 0 ? inactiveCount * 4 : 0); - indicators.forEach((indicator, i) => { - if (i !== index) { // для Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… ΠΌΠ°Ρ€ΠΊΠ΅Ρ€ΠΎΠ² - let translateX = 0; - - if (i < index) { // ΠΌΠ°Ρ€ΠΊΠ΅Ρ€Ρ‹ слСва ΠΎΡ‚ Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ - // Π‘ΠΌΠ΅Ρ‰Π°Π΅ΠΌ Π²Π»Π΅Π²ΠΎ ΠΎΡ‚ Ρ†Π΅Π½Ρ‚Ρ€Π° Π½Π° ΠΏΠΎΠ»ΠΎΠ²ΠΈΠ½Ρƒ ΡˆΠΈΡ€ΠΈΠ½Ρ‹ Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠΉ пилюли + gap + позиция - const leftOffset = (activePillWidth / 2) + fixedGap + ((index - i - 1) * (markerSize + 4)) + markerSize; - translateX = -leftOffset; - } else { // ΠΌΠ°Ρ€ΠΊΠ΅Ρ€Ρ‹ справа ΠΎΡ‚ Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ - // Π‘ΠΌΠ΅Ρ‰Π°Π΅ΠΌ Π²ΠΏΡ€Π°Π²ΠΎ ΠΎΡ‚ Ρ†Π΅Π½Ρ‚Ρ€Π° Π½Π° ΠΏΠΎΠ»ΠΎΠ²ΠΈΠ½Ρƒ ΡˆΠΈΡ€ΠΈΠ½Ρ‹ Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠΉ пилюли + gap + позиция - const rightOffset = (activePillWidth / 2) + fixedGap + ((i - index - 1) * (markerSize + 4)); - translateX = rightOffset; - } - - indicator.style.transform = `translateX(${translateX}px)`; - indicator.style.transition = 'all 0.4s cubic-bezier(0.23, 1, 0.32, 1)'; - } else { - // Активный элСмСнт остаСтся Π² Ρ†Π΅Π½Ρ‚Ρ€Π΅ - indicator.style.transform = 'translateX(0)'; - } - }); + // Margin Π°ΠΊΡ‚ΠΈΠ²Π½ΠΎΠ³ΠΎ элСмСнта: 16px (8px с ΠΊΠ°ΠΆΠ΄ΠΎΠΉ стороны) + const activeMargin = inactiveCount > 0 ? 16 : 0; - // ОбновляСм ΡˆΠΈΡ€ΠΈΠ½Ρƒ внСшнСй пилюли - const totalMarkers = indicators.length; - const inactiveCount = totalMarkers - 1; + // ΠžΠ±Ρ‰Π°Ρ ΡˆΠΈΡ€ΠΈΠ½Π°: Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹ΠΉ + Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Π΅ + margin + padding ΠΊΠΎΠ½Ρ‚Π΅ΠΉΠ½Π΅Ρ€Π° + const totalWidth = activePillWidth + inactiveWidth + activeMargin + 32; - // ВычисляСм максимальноС смСщСниС для опрСдСлСния ΠΎΠ±Ρ‰Π΅ΠΉ ΡˆΠΈΡ€ΠΈΠ½Ρ‹ - let maxOffset = 0; - if (inactiveCount > 0) { - const maxLeftOffset = (activePillWidth / 2) + fixedGap + ((index) * (markerSize + 4)); - const maxRightOffset = (activePillWidth / 2) + fixedGap + ((totalMarkers - index - 1) * (markerSize + 4)); - maxOffset = Math.max(maxLeftOffset, maxRightOffset); - } - - const totalWidth = Math.max(activePillWidth + (maxOffset * 2) + 32, activePillWidth + 32); - - console.log('Active pill width:', activePillWidth, 'Total width:', totalWidth); + console.log('Active pill width:', activePillWidth, 'Inactive width:', inactiveWidth, 'Total:', totalWidth); outerPill.style.width = totalWidth + 'px'; outerPill.style.transition = 'all 0.4s cubic-bezier(0.23, 1, 0.32, 1)'; @@ -1032,22 +983,14 @@ document.addEventListener('DOMContentLoaded', function() { // Hover эффСкты для Π½Π΅Π°ΠΊΡ‚ΠΈΠ²Π½Ρ‹Ρ… элСмСнтов indicator.addEventListener('mouseenter', function() { if (!this.classList.contains('active')) { - // БохраняСм Ρ‚Π΅ΠΊΡƒΡ‰ΠΈΠΉ transform ΠΈ добавляСм scale - const currentTransform = this.style.transform; - const scaleTransform = currentTransform.includes('translateX') - ? currentTransform.replace(')', ' scale(1.1))') - : 'translate(-50%, -50%) scale(1.1)'; - this.style.transform = scaleTransform; + this.style.transform = 'scale(1.1)'; this.style.background = 'rgba(255, 255, 255, 0.6)'; } }); indicator.addEventListener('mouseleave', function() { if (!this.classList.contains('active')) { - // ВосстанавливаСм transform Π±Π΅Π· scale - const currentTransform = this.style.transform; - const cleanTransform = currentTransform.replace(' scale(1.1)', ''); - this.style.transform = cleanTransform; + this.style.transform = 'scale(1)'; this.style.background = 'rgba(255, 255, 255, 0.4)'; } });