NoraH1to / yue

Lightweight web reader, easy to use, clean interface, focused on reading
https://yue.norah1to.com
MIT License
26 stars 6 forks source link

[Feature] Support href in epub #11

Open NogiNonoka opened 9 months ago

NogiNonoka commented 9 months ago

Feature

If there are hrefs in the epub, such as toc, annotations, I can't click and jump to the target location based on the epub href. I found css property pointer-events: none; from epub-reader-content, i think this properties may cause hrefs in epub will not effective.

I am a front-end newbie and now learning about epubjs with your wiki. Thanks a lot for you wikis and blogs. I found the same problem as your Yue's reading page. I try to add a control panel for the reader, but it will prevent the event listener for the epub contents. I wonder is there a good solution to support href in epub?

Feature (Chinese Version)

epub-reader-content 继承的 css 属性 pointer-events: none; 导致阅读时 epub 内置的跳转链接无法生效。可能会影响书籍内置目录、注释的跳转。

我是个前端新手最近在学习使用 epubjs,阅读了您的博客学到了很多,非常感谢! 在使用 epubjs 的过程中,我遇到类似的问题,控制栏的div捕获到event后会导致epubjs的iframe页面中的跳转链接无法触发,想知道是否有什么方案能使epub中的链接生效?

NoraH1to commented 8 months ago

Initially, to get a unified gesture experience, I added invisible elements to the top level of the viewport as a "Gesture Layer" to proxy gestures, and used hammerjs for gesture recognition.

Now that I've found some suitable ways to forward iframe events to the outer layer, I'm going to try passing events for the epub view in 2.0 update to get the full epub reading experience.

NoraH1to commented 8 months ago

Iwonder is there a good solution to support href in epub?

If you need to release epub events, the pointer-events: none property and the gesture layer can be removed, and you need to set snp to true when you initialize the epub to enable the gesture functionality built into epubjs (a terrible experience)