feat: add hero hover wave animation
This commit is contained in:
@@ -26,4 +26,50 @@
|
|||||||
.pause-on-hover:hover {
|
.pause-on-hover:hover {
|
||||||
animation-play-state: paused;
|
animation-play-state: paused;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@keyframes hero-wave-primary {
|
||||||
|
0%, 49.99% { opacity: 1; }
|
||||||
|
50%, 100% { opacity: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes hero-wave-secondary {
|
||||||
|
0%, 49.99% { opacity: 0; }
|
||||||
|
50%, 100% { opacity: 1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes hero-wave-sway {
|
||||||
|
0%, 100% { transform: rotate(0deg) translateY(0); }
|
||||||
|
25% { transform: rotate(-2deg) translateY(-1px); }
|
||||||
|
50% { transform: rotate(2.5deg) translateY(0); }
|
||||||
|
75% { transform: rotate(-1deg) translateY(-1px); }
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-wave-frame {
|
||||||
|
transform-origin: 70% 88%;
|
||||||
|
will-change: opacity, transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-wave-frame-secondary {
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-wave:hover .hero-wave-frame-primary {
|
||||||
|
animation: hero-wave-primary 520ms steps(1, end) infinite, hero-wave-sway 720ms ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-wave:hover .hero-wave-frame-secondary {
|
||||||
|
animation: hero-wave-secondary 520ms steps(1, end) infinite, hero-wave-sway 720ms ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.hero-wave:hover .hero-wave-frame-primary {
|
||||||
|
animation: none;
|
||||||
|
opacity: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero-wave:hover .hero-wave-frame-secondary {
|
||||||
|
animation: none;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ export function HomeHero({ news }: HomeHeroProps) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="pointer-events-none absolute right-0 bottom-0 hidden h-full w-44 overflow-hidden sm:block">
|
<div className="hero-wave group absolute right-0 bottom-0 hidden h-full w-44 overflow-hidden sm:block">
|
||||||
<Image
|
<Image
|
||||||
src="/images/hero1.png"
|
src="/images/hero1.png"
|
||||||
alt="Poyraz Avsever"
|
alt="Poyraz Avsever"
|
||||||
@@ -96,11 +96,20 @@ export function HomeHero({ news }: HomeHeroProps) {
|
|||||||
height={220}
|
height={220}
|
||||||
sizes="180px"
|
sizes="180px"
|
||||||
priority
|
priority
|
||||||
className="absolute right-0 bottom-0 h-auto w-36 object-contain"
|
className="hero-wave-frame hero-wave-frame-primary absolute right-0 bottom-0 h-auto w-36 object-contain"
|
||||||
|
/>
|
||||||
|
<Image
|
||||||
|
src="/images/hero2.png"
|
||||||
|
alt=""
|
||||||
|
width={220}
|
||||||
|
height={220}
|
||||||
|
sizes="180px"
|
||||||
|
aria-hidden="true"
|
||||||
|
className="hero-wave-frame hero-wave-frame-secondary absolute right-0 bottom-0 h-auto w-36 object-contain"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
className="absolute right-0 bottom-0 h-px w-36 bg-border"
|
className="pointer-events-none absolute right-0 bottom-0 h-px w-36 bg-border"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 201 KiB |
Reference in New Issue
Block a user