@@ -4995,11 +4995,6 @@ class FastSearchCard extends HTMLElement {
49954995 }
49964996
49974997 showCategoryButtons() {
4998- this.collapsePanel();
4999-
5000- console.log('🔍 BEFORE showCategoryButtons:');
5001- this.debugCategoryButtons();
5002-
50034998 if (this.isMobile()) {
50044999 const searchWrapper = this.shadowRoot.querySelector('.search-panel');
50055000 if (searchWrapper) {
@@ -5008,19 +5003,28 @@ class FastSearchCard extends HTMLElement {
50085003 }
50095004
50105005 const categoryButtons = this.shadowRoot.querySelector('.category-buttons');
5006+ const searchPanel = this.shadowRoot.querySelector('.search-panel');
50115007
5012- // ✅ ERWEITERTE RESET-FUNKTION verwenden
5008+ // ✅ Reset + Vorbereitung
50135009 this.resetAllCategoryStyles();
5014-
5015- // ✅ State setzen
50165010 this.isMenuView = true;
50175011 categoryButtons.classList.add('visible');
50185012
5019- // ✅ Animation sofort starten (kein setTimeout mehr nötig)
5020- console.log('🔍 AFTER reset, BEFORE animation:');
5021- this.debugCategoryButtons();
5013+ // ✅ SYNCHRONISIERT: Panel UND Buttons gleichzeitig animieren
50225014
5023- this.animateRippleEffect(categoryButtons);
5015+ // 1️⃣ Panel sofort kollabieren (ohne Animation)
5016+ this.isPanelExpanded = false;
5017+ searchPanel.classList.remove('expanded');
5018+
5019+ // 2️⃣ Kurze Pause, dann Panel UND Buttons gleichzeitig expandieren/animieren
5020+ setTimeout(() => {
5021+ // Panel expandieren (für milchigen Background)
5022+ this.isPanelExpanded = true;
5023+ searchPanel.classList.add('expanded');
5024+
5025+ // Buttons animieren - GLEICHZEITIG!
5026+ this.animateRippleEffect(categoryButtons);
5027+ }, 50);
50245028 }
50255029
50265030 resetAllCategoryStyles() {
@@ -5098,45 +5102,42 @@ class FastSearchCard extends HTMLElement {
50985102 animateRippleEffect(categoryButtons) {
50995103 const buttons = categoryButtons.querySelectorAll('.category-button');
51005104
5101- // ✅ KRITISCH: Container und Buttons sichtbar machen BEVOR Animation startet
5105+ // ✅ Container und Buttons sofort sichtbar
51025106 categoryButtons.style.opacity = '1';
51035107 categoryButtons.style.transform = 'translateX(0) scale(1)';
51045108 categoryButtons.style.display = 'flex';
51055109
5106- // ✅ Alle Buttons sofort sichtbar machen
51075110 buttons.forEach(button => {
51085111 button.style.opacity = '1';
51095112 button.style.transform = 'none';
51105113 button.style.filter = 'none';
51115114 });
51125115
5113- // ✅ Kurze Pause, dann Animation starten
5116+ // ✅ Schnellere, elegantere Animation
51145117 setTimeout(() => {
5115- // Jetzt können wir die Animation starten
51165118 buttons.forEach((button, index) => {
5117- // Animation von sichtbar zu animiert zu final
51185119 button.animate([
51195120 {
51205121 opacity: 1,
51215122 transform: 'translateY(0) scale(1) rotate(0deg)',
51225123 filter: 'blur(0px)'
51235124 },
51245125 {
5125- opacity: 0.7 ,
5126- transform: 'translateY(-8px ) scale(1.15 ) rotate(3deg )',
5126+ opacity: 0.8 ,
5127+ transform: 'translateY(-5px ) scale(1.1 ) rotate(2deg )',
51275128 filter: 'blur(0px)',
5128- offset: 0.3
5129+ offset: 0.4
51295130 },
51305131 {
51315132 opacity: 1,
51325133 transform: 'translateY(0) scale(1) rotate(0deg)',
51335134 filter: 'blur(0px)'
51345135 }
51355136 ], {
5136- duration: 450,
5137+ duration: 300, // ← Schneller!
51375138 easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
5138- delay: index * 60,
5139- fill: 'none' // ← WICHTIG: keine permanenten Styles!
5139+ delay: index * 40, // ← Weniger Delay
5140+ fill: 'none'
51405141 });
51415142 });
51425143 }, 10);
@@ -5223,7 +5224,6 @@ class FastSearchCard extends HTMLElement {
52235224 }
52245225
52255226 hideCategoryButtons() {
5226- // Mobile: Search-Wrapper wieder anzeigen
52275227 if (this.isMobile()) {
52285228 const searchWrapper = this.shadowRoot.querySelector('.search-panel');
52295229 if (searchWrapper) {
@@ -5234,8 +5234,13 @@ class FastSearchCard extends HTMLElement {
52345234 const categoryButtons = this.shadowRoot.querySelector('.category-buttons');
52355235 if (!this.isMenuView) return;
52365236
5237- // 🌊 REVERSE RIPPLE ANIMATION
5237+ // ✅ Animation starten
52385238 this.animateReverseRipple(categoryButtons);
5239+
5240+ // ✅ Nach Animation: Panel kollabieren
5241+ setTimeout(() => {
5242+ this.collapsePanel();
5243+ }, 500); // Nach Button-Animation
52395244 }
52405245
52415246 animateReverseRipple(categoryButtons) {
0 commit comments