kmenu icon indicating copy to clipboard operation
kmenu copied to clipboard

[FEATURE] Animation between option items

Open heymartinadams opened this issue 1 year ago • 8 comments

The animation is lovely. It just needs to be a bit faster, a bit snappier, especially for command menus that have a longer list of items. Is there any way we can set it ourselves?

Current animation:

https://github.com/harshhhdev/kmenu/assets/11673745/407c89b0-1ab7-4ef2-8212-ca4cad78c901

Example of snappier animation: (Linear)

https://github.com/harshhhdev/kmenu/assets/11673745/ced81bae-18f4-43b3-9be4-64ee3ff3564d

heymartinadams avatar Jan 23 '24 18:01 heymartinadams

Interesting why it overlaps the menu items when it's going down? I'll take a look.

haaarshsingh avatar Jan 25 '24 03:01 haaarshsingh

@heymartinadams do you prefer the select animation by yourself?

haaarshsingh avatar Jan 25 '24 04:01 haaarshsingh

I wonder if the animation could either be made faster, or perhaps turned off?

On an aside — not related to this issue: another reason my example looks a bit glitchy is because I have added custom colors, and they seem to take a bit to load, right as the animation shifts. See here for a still frame: CleanShot 2024-01-24 at 21 13 40@2x

heymartinadams avatar Jan 25 '24 05:01 heymartinadams

@heymartinadams I'm working on an API rewrite for the colors right now. I think it's much easier for people to just customize the colors themselves in a CSS file as opposed to passing them into the menu.

haaarshsingh avatar Jan 25 '24 17:01 haaarshsingh

💯 agreed. That’s what we’re doing.

heymartinadams avatar Jan 26 '24 00:01 heymartinadams

Awesome! Has using the colors in CSS as opposed to passing them onto the menu fixed this issue? I'll still work on something which gives an optino to turn off the animation, so someone can even pass it in if they have like prefers-reduced-motion or something.

haaarshsingh avatar Jan 27 '24 16:01 haaarshsingh

Modified style like this, for example.

<style>{`
.category_header { height: 1rem; margin: 0.8rem 0.5rem 0.4rem; font-weight: 500; font-size: 0.75rem; }
.command {
  color: ${!appDarkMode ? 'rgb(var(--colors-primary))' : 'rgb(var(--colors-primary-dark))'} !important;
}
.command, .selected { height: 2.4rem; margin: 0; border-radius: 0.25rem; }
`}</style>

heymartinadams avatar Jan 29 '24 15:01 heymartinadams

Yeah, you won't have to worry about doing weird stuff like this once the new update comes out. Some big things comin' your way.

haaarshsingh avatar Feb 01 '24 07:02 haaarshsingh