I was sooooo surprised and happy to have found your comment on my video.
Originally, I wanted to share it with you here via Discourse but later my priorities changed. It is also great to hear that you keep on improving the UI.
I have another feedback to share. It is a feature that I am using on my website. I call it a Clever Navbar.
This „Clever Navbar“ is actually my idea. I am a little bit of a front-end devoloper. It is just 20 lines of code. I you decided to use it, your developers should be able to find the code on my Pandita.cz website. They will know how to find there.
Borek
P.S. I have also used your translations of and translated your suttas to the Czech language. The audio version is on YouTube already. It is just cool.
I have a few more notes. When I was creating my website I was researching UI a lot. You are probably aware of some of these features but I will mention them. Perhaps it will help.
usually 63-75 characters are recommended per line
eventually I decided to use black font on white background
At the end of each line, the eyes of the user are moving from right to left, they have to find the new line below. Therefore, I am using a grey area on both of the sides. I think that it helps with this process. Actually, any PDF document in my PC browser is displayed in a similar way: black font on white background with a grey area on both of the sides.
Thanks, that’s nifty. Little details like this are always harder than they look! I’m still not happy with the implementation on SC: previously it was too sensitive, now I think it’s too insensitive.
I tried out your implementation. It’s nice! I wonder if it would be better to add a time component? At the moment the nav bar disappears if you scroll up 250px. But sometimes you’re just scrolling gradually up. What if it were 250/1 second?
You’re most welcome to have a look at SC’s source code and see if you can improve it. TBH, I have tried tweaking the parameters and just can’t seem to get it right. So we kind of moved on.
The relevant file is here:
And PR is here:
Nice, thanks!
I deliberately made the default a little wider than this on SC. Why? Because when I see people using their computers, especially laptops, I often see then with multiple toolbars at the top and the bottom of the screen, and the actual website window taking maybe 2/3s of the screen height. Which on a 13" laptop is not much! Personally I get rid of everything except the narrowest toolbars at the top that I can.
Anyway, given that many users have only a few inches of vertical space available, I wanted to ensure that they could still have a reasonable chunk of text on screen. This is even more useful when there is root/translation line by line.
You can always narrow the window if you like!
Hmm, I’m not sure. I never really found it a problem, i’d like to see some studies on this.
I am so sorry not have replied sooner. I was not around SC Discuss & Discover and only now did I discover your response to my post.
This discovery of mine is even more surprising because you have replied the day I have posted. I feel so embarassed. I pretty sure I was checking the post for some time but I do not remember finding you reply here. But it was here, I can see it now. Sometimes, I am so clumsy.
I see you left a few notes for me. I will try to reply later.
As for the scroll, yes it could be changed. I understand, sometime people read and slowly they are scrolling up. In that case, they do not want the navbar to appear. Adding one more condition to the script (for example, we could delete the scroll change every second) would propably solve this problem.
A few months ago, I wrote a newer version of this clever navigation bar. It is quite easy to understand now. If your developers are interested, I would be happy if they decided to use it. It is available here.
As for the UI, I like reading black text on white background + have the side of the text in grey background. But that is just subjective. I am not aware of any studies supporting this design pattern. But it reminds me of MICROSOFT WORD and OPEN OFFICE. They do use it.
One thing am wondering, I have heard that sometimes these elements create a lot of processing overhead, as they are constantly listening for the position. Is this correct? Do you know the performance implications of your solution?
As for the performance, I do not have much experience with it. I am still new to development so this is a question for a more senior developer.
But my guess would be that it should be ok. This is only vanilla javascript. The performance issues are usually caused by big images or using external libraries that the website is using.
I have also tried to test the speed of my website. I am using the new clever navbar code there.
But https://pagespeed.web.dev is telling me that there is a problem on mobile. But it hard to say what the problem is. Propably not the “clever navbar” code.
It’s a tricky one to test, I saw an article on it some time ago, I’ll see if I can find it. Basically it won’t show as a problem with normal testing, but events are being constantly triggered. Maybe try examining it in the browser tools?
Just now I tested the script with console.time and console.timeEnd. This is where I have found the instructions.
This is the result that I see in the console.
default: 0.89697265625 ms
That is the additional burden of my clever navigation script.
What you have in your mind is propably this part.
Window.onscroll = function () {}
So yes, javascript is constantly listening for any change in scroll. But that is normal. Similirly, javascript is constantly listening for “click” events.
I think I understand. Sutta central is a big app and you do not want to place additional burden on it.