hover time

This commit is contained in:
Your Name
2025-11-12 10:24:12 -04:00
parent 83bb9d3941
commit 41be0ac443

View File

@@ -241,14 +241,15 @@ export class HamburgerMorphing {
const targetColor = isHovering ? this.options.hover : this.options.foreground;
// Only change color for lines that have the foreground color (not background/cutout colors)
const hoverDuration = ANIMATION_DURATION / 2; // Half the morphing time
if (this.line1.attr('stroke') === this.options.foreground || this.line1.attr('stroke') === this.options.hover) {
this.line1.animate(ANIMATION_DURATION, 0, "now").attr({ stroke: targetColor });
this.line1.animate(hoverDuration, 0, "now").attr({ stroke: targetColor });
}
if (this.line2.attr('stroke') === this.options.foreground || this.line2.attr('stroke') === this.options.hover) {
this.line2.animate(ANIMATION_DURATION, 0, "now").attr({ stroke: targetColor });
this.line2.animate(hoverDuration, 0, "now").attr({ stroke: targetColor });
}
if (this.line3.attr('stroke') === this.options.foreground || this.line3.attr('stroke') === this.options.hover) {
this.line3.animate(ANIMATION_DURATION, 0, "now").attr({ stroke: targetColor });
this.line3.animate(hoverDuration, 0, "now").attr({ stroke: targetColor });
}
}