animotionjs / animotion

🪄 Create beautiful presentations with Svelte
https://animotion.pages.dev
MIT License
1.38k stars 41 forks source link

Feature request: Code block highlighting on init #48

Closed isaacharrisholt closed 2 weeks ago

isaacharrisholt commented 2 weeks ago

Hey! Love Animotion, and have started using it for all my YouTube videos.

I'd love to be able to highlight lines <Code> element on render, rather than having to call an action myself. Sometimes I want a specific line highlighted when I get to a slide, without the animation playing. I was thinking something like this:

<Code
  {...props}
  highlighted="1"
/>

It could take the same format as selectLines currently does, but just ensure they're highlighted by default.

Thanks!

mattcroat commented 2 weeks ago

I think that sounds great, but it requires more thought, since it would also make sense that you could highlight tokens.

Unfortunately, I don't see myself using it, so I lack the motivation, but I might reconsider it when I have more time.