bbc / peaks.js

JavaScript UI component for interacting with audio waveforms
https://waveform.prototyping.bbc.co.uk
GNU Lesser General Public License v3.0
3.2k stars 279 forks source link

Playhead text customization #508

Closed amber-huo closed 11 months ago

amber-huo commented 1 year ago

507

This adds two options for customizing playhead text:

chrisn commented 12 months ago

Thank you! With the padding option, could this apply to both the left and right of the text, at the moment it looks to be only on the right. What do you think?

Another thing I would suggest is rename the playheadBkgrdColor as playheadBackgroudColor, so it's not abbreviated.

amber-huo commented 12 months ago

Thank you! With the padding option, could this apply to both the left and right of the text, at the moment it looks to be only on the right. What do you think?

Another thing I would suggest is rename the playheadBkgrdColor as playheadBackgroudColor, so it's not abbreviated.

Sure, took both your suggestions.

chrisn commented 12 months ago

Thank you! I'm just doing some testing. There are a couple of other minor things I'd like to consider. One is, when the playhead is close to the right-hand edge of the view, the playhead text moves to the left of the playhead, so ideally this would also take into account the padding. The other is that there's a really small gap between the playhead and the padding, would it look better if we could remove this?

amber-huo commented 12 months ago

Ok, I adjusted for padding when the text moves to the left, and removed the gap. The padding has a default of 2 so the text should look the same as before when there is no custom background or padding set.

chrisn commented 11 months ago

This looks great, thank you!

chrisn commented 11 months ago

The only final things are to add some documentation and a few really minor nitpicks on the code. Would you prefer if I do those, or should I suggest changes?

amber-huo commented 11 months ago

I'm cool if you go ahead and do those! Thanks.