@@ -1147,6 +1147,7 @@ class FastSearchCard extends HTMLElement {
11471147
11481148
11491149
1150+
11501151 .icon-video {
11511152 position: absolute;
11521153 top: 0;
@@ -1156,8 +1157,19 @@ class FastSearchCard extends HTMLElement {
11561157 object-fit: cover;
11571158 border-radius: 20px;
11581159 z-index: 2;
1159- opacity: 0; /* Startet unsichtbar */
1160- transition: none; /* Keine CSS-Transition, da wir Web Animations nutzen */
1160+ opacity: 0;
1161+ animation: videoFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
1162+ }
1163+
1164+ @keyframes videoFadeIn {
1165+ from {
1166+ opacity: 0;
1167+ transform: scale(0.95);
1168+ }
1169+ to {
1170+ opacity: 1;
1171+ transform: scale(1);
1172+ }
11611173 }
11621174
11631175 .icon-video[autoplay] {
@@ -8136,44 +8148,13 @@ class FastSearchCard extends HTMLElement {
81368148
81378149 // Nur bei echter URL-Änderung updaten
81388150 if (newVideoUrl && currentSrc && !currentSrc.includes(newVideoUrl.split('/').pop())) {
8139- // Fade-out → Update → Fade-in
8140- videoElement.animate([
8141- { opacity: 1 },
8142- { opacity: 0 }
8143- ], {
8144- duration: 300,
8145- easing: 'ease-out'
8146- }).onfinish = () => {
8147- videoElement.src = newVideoUrl;
8148- videoElement.load();
8149-
8150- // Fade-in nach erfolgreichem Laden
8151- videoElement.addEventListener('canplay', () => {
8152- videoElement.animate([
8153- { opacity: 0, transform: 'scale(0.95)' },
8154- { opacity: 1, transform: 'scale(1)' }
8155- ], {
8156- duration: 600,
8157- easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
8158- fill: 'forwards'
8159- });
8160- }, { once: true });
8161-
8162- videoElement.onended = function() {
8163- this.pause();
8164- this.currentTime = this.duration - 0.1;
8165- };
8151+ videoElement.src = newVideoUrl;
8152+ videoElement.load();
8153+
8154+ videoElement.onended = function() {
8155+ this.pause();
8156+ this.currentTime = this.duration - 0.1;
81668157 };
8167- } else if (videoElement.style.opacity === '0' || !videoElement.style.opacity) {
8168- // Erstes Laden - direkte Fade-in Animation
8169- videoElement.animate([
8170- { opacity: 0, transform: 'scale(0.95)' },
8171- { opacity: 1, transform: 'scale(1)' }
8172- ], {
8173- duration: 600,
8174- easing: 'cubic-bezier(0.16, 1, 0.3, 1)',
8175- fill: 'forwards'
8176- });
81778158 }
81788159 }
81798160
0 commit comments