vaetas / hugo-footnotes-popup

Pure JavaScript plugin to make your footnotes displayed in a panel. Works with footnotes generated from Markdown in Hugo.
https://www.vaetas.cz/posts/hugo-footnotes-popup/
MIT License
26 stars 3 forks source link

refactor: cleanup code and optimize #1

Closed akinjide closed 5 years ago

vaetas commented 5 years ago

Hello @akinjide I am super thankful for your pull request (my first). I did check your code and it seems far better than mine (but well, this was my first interaction with JS). I also have a few changes to this project that I haven't commited yet so I will look at the request when I have enough time (this weekend I hope) and try to unify our codes.

Closing the popup on scroll is cool. I also implemented it in my local repo but I decided to remove the [x] close button because it seemed unimportant to me. Closing by scrolling or clicking on the popup seems ok. Do you prefer it as it is right now or would it be better to remove it? It would simplify the required HTML code.

I would love to hear your ideas.

akinjide commented 5 years ago

Hey @vaetas

Awesome seeing you've made local changes as well. We should retain both closing by scrolling and close button [x]. Essentially, having several options to dismiss the popup is good. Cheers.

akinjide commented 5 years ago

TBT. The close button [x] adds a cool retro feel.

vaetas commented 5 years ago

@akinjide You are right, the retro feel is nice. I think we could use some form of settings you can adjust to make it suitable for everybody. This plugin could probably handle few more lines of code. (I do have the version without close button on my site linked in repo description, you can have a look.)

What I think could be nice optional feature is showing the popup right next to the footnote reference (either next to the paragraph or above it, similarly to Wikipedia). I was not able to make it work properly so far, but I will take a look on it. This feature, if turned on, could be for example default on desktops.

If you have any thoughts on this too I would love to hear them. (Sorry for the off-topic questions, I am curious what others think about this.)