bibliotype
bibliotype copied to clipboard
Remembering the reader's place
Hi Craig,
I've enjoyed playing with Bibliotype the last few days. I was working on a project teaching people how to do advanced typesetting on the web, and BT is the perfect baseline. It resolves all the nebulous questions about fonts and sizes and provides a structure for exploring what I want to talk about, like typesetting annotations, critical apparatus, and structured hypertext.
I've added a bit of js that helps keep the reader's place.
- When you read some, close the window, and come back later, it remembers where you left off. This is appropriate for long-form reading and annoying in other cases.
- When you change the font size, it intelligently keeps your place. Prior to this change, if you were halfway through an article and changed to a larger font size, it lost your place and put you only a quarter of the way through.
Thanks again!
-Adam
Hi Asolove — this looks awesome! I pulled to my local machine for testing but it looks like it's not quite remembering the right position. It sort of hops up a few pixels on each page reload. And it's not quite the same location on font-size changes either .. any ideas?
Yes, appears the iPad changes the body's height from reflowing content even after the dom is rendered. I've committed a fix that helps that in the case of reloading the page. When it comes to switching font sizes, ultimately using the page scroll percentage is a hack that won't ever be precise.
I think the right thing to do is add in something like the NYT has where each paragraph is assigned a unique, linkable id anchor. Then we could just grab the top on-screen dom element and keep that at the top of the window when reloading or changing font sizes. Is that something that belongs in Bibliotype or as a separate addition?
Good question ... I think the paragraph numbering would have to happen in JS. If the numbering is dynamically generated on load, I think it could be a very good anchor point for maintaining position on size changes and reloads.
And sure, I think that would be a worthwhile addition to the library.