info stored in a markdown, i can show it to the user and it works good, but i need a way to store the progress of what the user read so when the user come back again can continue reading where he left, as the format is markdown i don't have something like pages to store the number and use that, so, I was thinking in something like using the actual element that is has the focus state, in a copy of all the book delete all the other elements after the one that has the focus state, and use the length of the copy as the progress
how you think i should do it?
I don't know what's the best practice to implement such thing, since there is no page to store the latest state, one thing that came to my mind was using Intersection Observer API, through this API you can set a threshold for how much of the page has been visible to the user, hence knowing which positions to save in local storage then recovering them after next visit.
Hi, thanks for the answer, we have been doing something similar but without the intersection Observer API, i will take a look at this, thanks
Обсуждают сегодня