@ginhotaru282/reader 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -0
- package/.next/app-path-routes-manifest.json +15 -0
- package/.next/build-manifest.json +20 -0
- package/.next/package.json +1 -0
- package/.next/prerender-manifest.json +114 -0
- package/.next/required-server-files.json +334 -0
- package/.next/routes-manifest.json +149 -0
- package/.next/server/app/(reader)/[id]/page/app-paths-manifest.json +3 -0
- package/.next/server/app/(reader)/[id]/page/build-manifest.json +16 -0
- package/.next/server/app/(reader)/[id]/page/next-font-manifest.json +15 -0
- package/.next/server/app/(reader)/[id]/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/(reader)/[id]/page/server-reference-manifest.json +4 -0
- package/.next/server/app/(reader)/[id]/page.js +16 -0
- package/.next/server/app/(reader)/[id]/page.js.map +5 -0
- package/.next/server/app/(reader)/[id]/page.js.nft.json +1 -0
- package/.next/server/app/(reader)/[id]/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_global-error/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_global-error/page/build-manifest.json +16 -0
- package/.next/server/app/_global-error/page/next-font-manifest.json +6 -0
- package/.next/server/app/_global-error/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_global-error/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_global-error/page.js +9 -0
- package/.next/server/app/_global-error/page.js.map +5 -0
- package/.next/server/app/_global-error/page.js.nft.json +1 -0
- package/.next/server/app/_global-error/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_global-error.html +1 -0
- package/.next/server/app/_global-error.meta +15 -0
- package/.next/server/app/_global-error.rsc +14 -0
- package/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_full.segment.rsc +14 -0
- package/.next/server/app/_global-error.segments/_head.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_index.segment.rsc +5 -0
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -0
- package/.next/server/app/_not-found/page/app-paths-manifest.json +3 -0
- package/.next/server/app/_not-found/page/build-manifest.json +16 -0
- package/.next/server/app/_not-found/page/next-font-manifest.json +11 -0
- package/.next/server/app/_not-found/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/_not-found/page/server-reference-manifest.json +4 -0
- package/.next/server/app/_not-found/page.js +13 -0
- package/.next/server/app/_not-found/page.js.map +5 -0
- package/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/.next/server/app/_not-found/page_client-reference-manifest.js +3 -0
- package/.next/server/app/_not-found.html +1 -0
- package/.next/server/app/_not-found.meta +16 -0
- package/.next/server/app/_not-found.rsc +16 -0
- package/.next/server/app/_not-found.segments/_full.segment.rsc +16 -0
- package/.next/server/app/_not-found.segments/_head.segment.rsc +6 -0
- package/.next/server/app/_not-found.segments/_index.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +5 -0
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route/build-manifest.json +9 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route.js +6 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route.js.map +5 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route.js.nft.json +1 -0
- package/.next/server/app/api/bookmark/[id]/toggle/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/chapter/[id]/audio/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/chapter/[id]/audio/route/build-manifest.json +9 -0
- package/.next/server/app/api/chapter/[id]/audio/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/chapter/[id]/audio/route.js +6 -0
- package/.next/server/app/api/chapter/[id]/audio/route.js.map +5 -0
- package/.next/server/app/api/chapter/[id]/audio/route.js.nft.json +1 -0
- package/.next/server/app/api/chapter/[id]/audio/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route/build-manifest.json +9 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route.js +6 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route.js.map +5 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route.js.nft.json +1 -0
- package/.next/server/app/api/chapter/[id]/audio-status/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/chapter/[id]/unlock/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/chapter/[id]/unlock/route/build-manifest.json +9 -0
- package/.next/server/app/api/chapter/[id]/unlock/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/chapter/[id]/unlock/route.js +6 -0
- package/.next/server/app/api/chapter/[id]/unlock/route.js.map +5 -0
- package/.next/server/app/api/chapter/[id]/unlock/route.js.nft.json +1 -0
- package/.next/server/app/api/chapter/[id]/unlock/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/comment/story/[id]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/comment/story/[id]/route/build-manifest.json +9 -0
- package/.next/server/app/api/comment/story/[id]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/comment/story/[id]/route.js +6 -0
- package/.next/server/app/api/comment/story/[id]/route.js.map +5 -0
- package/.next/server/app/api/comment/story/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/comment/story/[id]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/reading-progress/[storyId]/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/reading-progress/[storyId]/route/build-manifest.json +9 -0
- package/.next/server/app/api/reading-progress/[storyId]/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/reading-progress/[storyId]/route.js +6 -0
- package/.next/server/app/api/reading-progress/[storyId]/route.js.map +5 -0
- package/.next/server/app/api/reading-progress/[storyId]/route.js.nft.json +1 -0
- package/.next/server/app/api/reading-progress/[storyId]/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/reading-progress/sync/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/reading-progress/sync/route/build-manifest.json +9 -0
- package/.next/server/app/api/reading-progress/sync/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/reading-progress/sync/route.js +6 -0
- package/.next/server/app/api/reading-progress/sync/route.js.map +5 -0
- package/.next/server/app/api/reading-progress/sync/route.js.nft.json +1 -0
- package/.next/server/app/api/reading-progress/sync/route_client-reference-manifest.js +3 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route/app-paths-manifest.json +3 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route/build-manifest.json +9 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route/server-reference-manifest.json +4 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route.js +6 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route.js.map +5 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route.js.nft.json +1 -0
- package/.next/server/app/api/story/[id]/combo-unlock/route_client-reference-manifest.js +3 -0
- package/.next/server/app/icon.png/route/app-paths-manifest.json +3 -0
- package/.next/server/app/icon.png/route/build-manifest.json +9 -0
- package/.next/server/app/icon.png/route.js +7 -0
- package/.next/server/app/icon.png/route.js.map +5 -0
- package/.next/server/app/icon.png/route.js.nft.json +1 -0
- package/.next/server/app/icon.png.body +0 -0
- package/.next/server/app/icon.png.meta +1 -0
- package/.next/server/app/index.html +1 -0
- package/.next/server/app/index.meta +14 -0
- package/.next/server/app/index.rsc +16 -0
- package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -0
- package/.next/server/app/index.segments/_full.segment.rsc +16 -0
- package/.next/server/app/index.segments/_head.segment.rsc +6 -0
- package/.next/server/app/index.segments/_index.segment.rsc +5 -0
- package/.next/server/app/index.segments/_tree.segment.rsc +4 -0
- package/.next/server/app/page/app-paths-manifest.json +3 -0
- package/.next/server/app/page/build-manifest.json +16 -0
- package/.next/server/app/page/next-font-manifest.json +11 -0
- package/.next/server/app/page/react-loadable-manifest.json +1 -0
- package/.next/server/app/page/server-reference-manifest.json +4 -0
- package/.next/server/app/page.js +14 -0
- package/.next/server/app/page.js.map +5 -0
- package/.next/server/app/page.js.nft.json +1 -0
- package/.next/server/app/page_client-reference-manifest.js +3 -0
- package/.next/server/app-paths-manifest.json +15 -0
- package/.next/server/chunks/[externals]_next_dist_0iuj5m_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0ewmt7_._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0m1sn3r._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0rthafo._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0u0sxpl._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__0xuaoik._.js +15 -0
- package/.next/server/chunks/[root-of-the-server]__0yuh9-6._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__10dmsr8._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ohu1lu._.js +3 -0
- package/.next/server/chunks/[root-of-the-server]__1ux8_la._.js +3 -0
- package/.next/server/chunks/[turbopack]_runtime.js +903 -0
- package/.next/server/chunks/_next-internal_server_app_api_bookmark_[id]_toggle_route_actions_0midgng.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_chapter_[id]_audio-status_route_actions_137h21m.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_chapter_[id]_audio_route_actions_1ursqip.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_chapter_[id]_unlock_route_actions_02wqhh1.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_comment_story_[id]_route_actions_0-k0u9j.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_reading-progress_[storyId]_route_actions_1wu6t2e.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_reading-progress_sync_route_actions_0bmsea-.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_api_story_[id]_combo-unlock_route_actions_1s8x_jq.js +3 -0
- package/.next/server/chunks/_next-internal_server_app_icon_png_route_actions_1-lsc8h.js +3 -0
- package/.next/server/chunks/node_modules_next_dist_esm_build_templates_app-route_0nojrj_.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__01629yw._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__05n80pl._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0uw2vno._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__0ybcdc2._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1-g8gmo._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__13bnu2t._.js +6 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1dky4g0._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1gdndpr._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1gux7cw._.js +3 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1t3wpve._.js +33 -0
- package/.next/server/chunks/ssr/[root-of-the-server]__1vfpvus._.js +21 -0
- package/.next/server/chunks/ssr/[turbopack]_runtime.js +903 -0
- package/.next/server/chunks/ssr/_1dkuh1k._.js +8 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_(reader)_[id]_page_actions_1j9t8xe.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__global-error_page_actions_0zi5s8-.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app__not-found_page_actions_0pt47yr.js +3 -0
- package/.next/server/chunks/ssr/_next-internal_server_app_page_actions_0hhsz1j.js +3 -0
- package/.next/server/chunks/ssr/node_modules_0h91jdk._.js +33 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0bw_x_7._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_0opsz1q._.js +6 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_0wpq8j3._.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_forbidden_0symwr9.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_global-error_0-o-goa.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_client_components_builtin_unauthorized_0l_sp0x.js +3 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_01b_3bz.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_05derss.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_0p62q26.js +4 -0
- package/.next/server/chunks/ssr/node_modules_next_dist_esm_build_templates_app-page_19--w_z.js +4 -0
- package/.next/server/functions-config-manifest.json +4 -0
- package/.next/server/middleware-build-manifest.js +20 -0
- package/.next/server/middleware-manifest.json +6 -0
- package/.next/server/next-font-manifest.js +1 -0
- package/.next/server/next-font-manifest.json +23 -0
- package/.next/server/pages/404.html +1 -0
- package/.next/server/pages/500.html +1 -0
- package/.next/server/pages-manifest.json +4 -0
- package/.next/server/prefetch-hints.json +1 -0
- package/.next/server/server-reference-manifest.js +1 -0
- package/.next/server/server-reference-manifest.json +5 -0
- package/.next/static/-r4Xo_1sB1eCBTgmD6W1a/_buildManifest.js +1 -0
- package/.next/static/-r4Xo_1sB1eCBTgmD6W1a/_clientMiddlewareManifest.js +1 -0
- package/.next/static/-r4Xo_1sB1eCBTgmD6W1a/_ssgManifest.js +1 -0
- package/.next/static/chunks/01dkdyukbdpqq.js +1 -0
- package/.next/static/chunks/05-c3ty_6dwfk.js +1 -0
- package/.next/static/chunks/0cz1d0mv5g_q7.js +1 -0
- package/.next/static/chunks/0w6_crw430jrp.css +3 -0
- package/.next/static/chunks/14mrh2-p_w84d.js +1 -0
- package/.next/static/chunks/1s4bwihthhw_5.css +4 -0
- package/.next/static/chunks/1tlb4p-7tvb4-.js +1 -0
- package/.next/static/chunks/25o46h8mdjlrg.js +1 -0
- package/.next/static/chunks/2wkjp1bvz-w78.js +5 -0
- package/.next/static/chunks/turbopack-1my_pp40jfqxc.js +1 -0
- package/.next/static/media/0b1dc8ddaa74ba49-s.0e__wj8580tc5.woff2 +0 -0
- package/.next/static/media/1a099d89ee94ee96-s.35a5cae5tspm2.woff2 +0 -0
- package/.next/static/media/4fa387ec64143e14-s.2tuy5pz7dlieh.woff2 +0 -0
- package/.next/static/media/507a47c1876d4ec2-s.2qdkzeru_ecot.woff2 +0 -0
- package/.next/static/media/53b9e256198e5412-s.390ncx5urfkfu.woff2 +0 -0
- package/.next/static/media/5ce348bf30bf5439-s.31988l_ccedte.woff2 +0 -0
- package/.next/static/media/6306c77e7c8268e4-s.2dbetqa9o8jxf.woff2 +0 -0
- package/.next/static/media/7178b3e590c64307-s.21jp631_3pja2.woff2 +0 -0
- package/.next/static/media/71fbf9c08529c2a5-s.2fpqrm51ez0iq.woff2 +0 -0
- package/.next/static/media/797e433ab948586e-s.p.0r6juujl39pe6.woff2 +0 -0
- package/.next/static/media/7d817b4c03b0c5f1-s.1uyisp29ctx0d.woff2 +0 -0
- package/.next/static/media/8a480f0b521d4e75-s.1qq4vpdcun5oj.woff2 +0 -0
- package/.next/static/media/8c2eb9ceedecfc8e-s.p.23aeddxv5enbo.woff2 +0 -0
- package/.next/static/media/ac34884600cd8d5d-s.2936i88_6qsfd.woff2 +0 -0
- package/.next/static/media/bbc41e54d2fcbd21-s.1rgnod-3esatf.woff2 +0 -0
- package/.next/static/media/caa3a2e1cccd8315-s.p.0wgildi0cnwt9.woff2 +0 -0
- package/.next/static/media/e1ccd2766b08c828-s.p.15gdzqknx46iu.woff2 +0 -0
- package/.next/static/media/e629b5bc06499d58-s.p.10u7vx61f1ie7.woff2 +0 -0
- package/.next/static/media/e7150917543fc9da-s.0mybutugvu-lq.woff2 +0 -0
- package/.next/static/media/e9457141811d41ae-s.02frcczqg7k-8.woff2 +0 -0
- package/.next/static/media/fba5a26ea33df6a3-s.p.18rizl4rsrl42.woff2 +0 -0
- package/.next/static/media/fef07dbb0973bf53-s.3p2_lha1f2xer.woff2 +0 -0
- package/.next/static/media/icon.189nugia0w7di.png +0 -0
- package/package.json +3 -1
- package/server.js +38 -0
- package/.dockerignore +0 -5
- package/.gitattributes +0 -2
- package/Dockerfile +0 -26
- package/README.md +0 -36
- package/eslint.config.mjs +0 -18
- package/next.config.ts +0 -8
- package/postcss.config.mjs +0 -7
- package/scripts/obfuscate-build.mjs +0 -77
- package/src/app/(reader)/[id]/page.tsx +0 -40
- package/src/app/(reader)/layout.tsx +0 -38
- package/src/app/api/bookmark/[id]/toggle/route.ts +0 -41
- package/src/app/api/chapter/[id]/audio/route.ts +0 -37
- package/src/app/api/chapter/[id]/audio-status/route.ts +0 -36
- package/src/app/api/chapter/[id]/unlock/route.ts +0 -49
- package/src/app/api/comment/story/[id]/route.ts +0 -48
- package/src/app/api/reading-progress/[storyId]/route.ts +0 -26
- package/src/app/api/reading-progress/sync/route.ts +0 -38
- package/src/app/api/story/[id]/combo-unlock/route.ts +0 -47
- package/src/app/globals.css +0 -26
- package/src/app/icon.png +0 -0
- package/src/app/layout.tsx +0 -35
- package/src/app/page.tsx +0 -3
- package/src/components/ssr/Skeleton/index.module.css +0 -22
- package/src/components/ssr/Skeleton/index.tsx +0 -38
- package/src/modules/reader/ReaderView.tsx +0 -48
- package/src/modules/reader/api/backend-data.ts +0 -231
- package/src/modules/reader/api/client-audio-api.ts +0 -33
- package/src/modules/reader/api/client-bookmark-api.ts +0 -21
- package/src/modules/reader/api/client-comment-api.ts +0 -31
- package/src/modules/reader/api/client-progress-api.ts +0 -36
- package/src/modules/reader/api/client-purchase-api.ts +0 -64
- package/src/modules/reader/api/get-reader-page-data.ts +0 -48
- package/src/modules/reader/api/types.ts +0 -47
- package/src/modules/reader/components/AudioPlayerBar.tsx +0 -299
- package/src/modules/reader/components/AutoScrollDrawer.tsx +0 -58
- package/src/modules/reader/components/ChapterBottomNav.tsx +0 -16
- package/src/modules/reader/components/ChapterContent.tsx +0 -43
- package/src/modules/reader/components/ChapterListDrawer.tsx +0 -84
- package/src/modules/reader/components/ChapterNav.tsx +0 -20
- package/src/modules/reader/components/ChapterSelect.tsx +0 -24
- package/src/modules/reader/components/ChapterWatermark.tsx +0 -53
- package/src/modules/reader/components/CommentSection.tsx +0 -156
- package/src/modules/reader/components/LockedChapterGate.tsx +0 -37
- package/src/modules/reader/components/MobileDock.tsx +0 -62
- package/src/modules/reader/components/NavButton.tsx +0 -22
- package/src/modules/reader/components/ReaderBreadcrumbs.tsx +0 -20
- package/src/modules/reader/components/ReaderChrome.tsx +0 -206
- package/src/modules/reader/components/ReaderToolbar.tsx +0 -52
- package/src/modules/reader/components/ReaderTopbar.tsx +0 -31
- package/src/modules/reader/components/SettingsPanel.tsx +0 -158
- package/src/modules/reader/components/Toast.tsx +0 -15
- package/src/modules/reader/constants/index.ts +0 -22
- package/src/modules/reader/hooks/useAudioPlayer.ts +0 -633
- package/src/modules/reader/hooks/useAutoScroll.ts +0 -31
- package/src/modules/reader/hooks/useBookmark.ts +0 -32
- package/src/modules/reader/hooks/useComments.ts +0 -86
- package/src/modules/reader/hooks/useContentProtection.ts +0 -81
- package/src/modules/reader/hooks/useDrawers.ts +0 -27
- package/src/modules/reader/hooks/useFullscreen.ts +0 -24
- package/src/modules/reader/hooks/usePrefs.ts +0 -66
- package/src/modules/reader/hooks/useReaderView.ts +0 -190
- package/src/modules/reader/hooks/useReadingProgress.ts +0 -95
- package/src/modules/reader/hooks/useScrollVisibility.ts +0 -44
- package/src/modules/reader/hooks/useToast.ts +0 -19
- package/src/modules/reader/hooks/useUnlock.ts +0 -59
- package/src/modules/reader/styles/reader.module.css +0 -1986
- package/src/modules/reader/types.ts +0 -145
- package/src/modules/reader/utils/affiliate.ts +0 -43
- package/src/modules/reader/utils/chapter-label.ts +0 -8
- package/src/modules/reader/utils/format-date.ts +0 -10
- package/src/modules/reader/utils/obfuscate-content.ts +0 -70
- package/src/modules/reader/utils/silent-wav.ts +0 -33
- package/src/modules/reader/utils/tiktok-tts.ts +0 -251
- package/src/modules/reader/utils/word-svg.ts +0 -132
- package/tsconfig.json +0 -34
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
export type Comment = {
|
|
2
|
-
id: string;
|
|
3
|
-
displayName: string;
|
|
4
|
-
avatarUrl: string | null;
|
|
5
|
-
content: string;
|
|
6
|
-
createdAt: string;
|
|
7
|
-
replies: Comment[];
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type Chapter = {
|
|
11
|
-
id: string;
|
|
12
|
-
chapterNumber: number;
|
|
13
|
-
title: string;
|
|
14
|
-
content: string;
|
|
15
|
-
type: string;
|
|
16
|
-
priceGold: number;
|
|
17
|
-
isLocked: boolean;
|
|
18
|
-
prevChapterId: string | null;
|
|
19
|
-
nextChapterId: string | null;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export type ChapterMeta = Omit<Chapter, "content">;
|
|
23
|
-
|
|
24
|
-
export function toChapterMeta(chapter: Chapter): ChapterMeta {
|
|
25
|
-
return {
|
|
26
|
-
id: chapter.id,
|
|
27
|
-
chapterNumber: chapter.chapterNumber,
|
|
28
|
-
title: chapter.title,
|
|
29
|
-
type: chapter.type,
|
|
30
|
-
priceGold: chapter.priceGold,
|
|
31
|
-
isLocked: chapter.isLocked,
|
|
32
|
-
prevChapterId: chapter.prevChapterId,
|
|
33
|
-
nextChapterId: chapter.nextChapterId,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export type Story = {
|
|
38
|
-
id: string;
|
|
39
|
-
slug: string;
|
|
40
|
-
title: string;
|
|
41
|
-
status: "ongoing" | "completed";
|
|
42
|
-
comboPriceGold: number | null;
|
|
43
|
-
isComboUnlocked: boolean;
|
|
44
|
-
totalVipChaptersPrice: number;
|
|
45
|
-
description: string | null;
|
|
46
|
-
genres: string[];
|
|
47
|
-
};
|
|
@@ -1,299 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import styles from "../styles/reader.module.css";
|
|
4
|
-
import type { useAudioPlayer } from "../hooks/useAudioPlayer";
|
|
5
|
-
|
|
6
|
-
function formatTime(time: number) {
|
|
7
|
-
if (Number.isNaN(time)) return "0:00";
|
|
8
|
-
const m = Math.floor(time / 60);
|
|
9
|
-
const s = Math.floor(time % 60);
|
|
10
|
-
return `${m}:${s < 10 ? "0" : ""}${s}`;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export type AudioPlayerBarProps = {
|
|
14
|
-
chapterLabel: string;
|
|
15
|
-
player: ReturnType<typeof useAudioPlayer>;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export function AudioPlayerBar({ chapterLabel, player }: AudioPlayerBarProps) {
|
|
19
|
-
const {
|
|
20
|
-
selectedVoice,
|
|
21
|
-
handleVoiceChange,
|
|
22
|
-
voices,
|
|
23
|
-
audioStatus,
|
|
24
|
-
isPlaying,
|
|
25
|
-
currentTime,
|
|
26
|
-
duration,
|
|
27
|
-
volume,
|
|
28
|
-
setVolume,
|
|
29
|
-
isMuted,
|
|
30
|
-
setIsMuted,
|
|
31
|
-
playbackRate,
|
|
32
|
-
setPlaybackRate,
|
|
33
|
-
currentParagraphIndex,
|
|
34
|
-
paragraphCount,
|
|
35
|
-
isGeneratingParagraph,
|
|
36
|
-
localProgress,
|
|
37
|
-
setLocalProgress,
|
|
38
|
-
continuousPlay,
|
|
39
|
-
setContinuousPlay,
|
|
40
|
-
isPlayerDisabled,
|
|
41
|
-
audioRef1,
|
|
42
|
-
audioRef2,
|
|
43
|
-
togglePlay,
|
|
44
|
-
handlePrevParagraph,
|
|
45
|
-
handleNextParagraph,
|
|
46
|
-
jumpToProgress,
|
|
47
|
-
handleTimeUpdate,
|
|
48
|
-
handleLoadedMetadata,
|
|
49
|
-
handleEnded,
|
|
50
|
-
handlePlay,
|
|
51
|
-
handlePause,
|
|
52
|
-
setPlayerOpen,
|
|
53
|
-
playerOpen,
|
|
54
|
-
} = player;
|
|
55
|
-
|
|
56
|
-
const isStudio = selectedVoice === "server";
|
|
57
|
-
|
|
58
|
-
return (
|
|
59
|
-
<div className={styles.bottomPlayerContainer}>
|
|
60
|
-
<div className={`${styles.bottomPlayerBar} ${playerOpen ? "" : styles.bottomPlayerBarHidden}`}>
|
|
61
|
-
<audio
|
|
62
|
-
ref={audioRef1}
|
|
63
|
-
hidden
|
|
64
|
-
onTimeUpdate={() => handleTimeUpdate(1)}
|
|
65
|
-
onLoadedMetadata={() => handleLoadedMetadata(1)}
|
|
66
|
-
onEnded={() => handleEnded(1)}
|
|
67
|
-
onPlay={() => handlePlay(1)}
|
|
68
|
-
onPause={() => handlePause(1)}
|
|
69
|
-
/>
|
|
70
|
-
<audio
|
|
71
|
-
ref={audioRef2}
|
|
72
|
-
hidden
|
|
73
|
-
onTimeUpdate={() => handleTimeUpdate(2)}
|
|
74
|
-
onLoadedMetadata={() => handleLoadedMetadata(2)}
|
|
75
|
-
onEnded={() => handleEnded(2)}
|
|
76
|
-
onPlay={() => handlePlay(2)}
|
|
77
|
-
onPause={() => handlePause(2)}
|
|
78
|
-
/>
|
|
79
|
-
|
|
80
|
-
<div className={styles.playerRow1}>
|
|
81
|
-
<div className={styles.playerLeft}>
|
|
82
|
-
<div className={styles.playerIconCircle}>
|
|
83
|
-
<span className="material-icons-round">headphones</span>
|
|
84
|
-
</div>
|
|
85
|
-
<div className={styles.playerInfoTexts}>
|
|
86
|
-
<span className={styles.playerChapTitle}>
|
|
87
|
-
{chapterLabel}
|
|
88
|
-
{!isStudio && paragraphCount > 0 && (
|
|
89
|
-
<span className={styles.segmentIndicator}>
|
|
90
|
-
Đoạn {currentParagraphIndex + 1}/{paragraphCount}
|
|
91
|
-
</span>
|
|
92
|
-
)}
|
|
93
|
-
</span>
|
|
94
|
-
<span className={styles.playerSubtitle}>
|
|
95
|
-
{isGeneratingParagraph
|
|
96
|
-
? "Đang tạo âm thanh đoạn..."
|
|
97
|
-
: isStudio && (audioStatus === "generating" || audioStatus === "loading")
|
|
98
|
-
? "Đang tải âm thanh chương..."
|
|
99
|
-
: audioStatus === "failed" || audioStatus === "error"
|
|
100
|
-
? "Lỗi tải audio"
|
|
101
|
-
: !isStudio
|
|
102
|
-
? voices[selectedVoice] || "Giọng đọc"
|
|
103
|
-
: "Giọng Studio"}
|
|
104
|
-
</span>
|
|
105
|
-
</div>
|
|
106
|
-
</div>
|
|
107
|
-
|
|
108
|
-
<div className={styles.playerControlsRow}>
|
|
109
|
-
{isStudio ? (
|
|
110
|
-
<>
|
|
111
|
-
<button
|
|
112
|
-
className={styles.playerControlBtn}
|
|
113
|
-
disabled={isPlayerDisabled}
|
|
114
|
-
style={{ opacity: isPlayerDisabled ? 0.5 : 1 }}
|
|
115
|
-
onClick={() => {
|
|
116
|
-
if (audioRef1.current) audioRef1.current.currentTime = Math.max(0, audioRef1.current.currentTime - 10);
|
|
117
|
-
}}
|
|
118
|
-
>
|
|
119
|
-
<span className="material-icons-round">replay_10</span>
|
|
120
|
-
</button>
|
|
121
|
-
|
|
122
|
-
<button
|
|
123
|
-
className={styles.playerPlayBtn}
|
|
124
|
-
onClick={togglePlay}
|
|
125
|
-
disabled={isPlayerDisabled}
|
|
126
|
-
style={{ opacity: isPlayerDisabled ? 0.6 : 1 }}
|
|
127
|
-
>
|
|
128
|
-
{audioStatus === "generating" || audioStatus === "loading" ? (
|
|
129
|
-
<span className={`material-icons-round ${styles.spin}`} style={{ fontSize: 24 }}>
|
|
130
|
-
sync
|
|
131
|
-
</span>
|
|
132
|
-
) : (
|
|
133
|
-
<span className="material-icons-round" style={{ fontSize: 24 }}>
|
|
134
|
-
{isPlaying ? "pause" : "play_arrow"}
|
|
135
|
-
</span>
|
|
136
|
-
)}
|
|
137
|
-
</button>
|
|
138
|
-
|
|
139
|
-
<button
|
|
140
|
-
className={styles.playerControlBtn}
|
|
141
|
-
disabled={isPlayerDisabled}
|
|
142
|
-
style={{ opacity: isPlayerDisabled ? 0.5 : 1 }}
|
|
143
|
-
onClick={() => {
|
|
144
|
-
if (audioRef1.current) {
|
|
145
|
-
audioRef1.current.currentTime = Math.min(duration, audioRef1.current.currentTime + 10);
|
|
146
|
-
}
|
|
147
|
-
}}
|
|
148
|
-
>
|
|
149
|
-
<span className="material-icons-round">forward_10</span>
|
|
150
|
-
</button>
|
|
151
|
-
</>
|
|
152
|
-
) : (
|
|
153
|
-
<>
|
|
154
|
-
<button
|
|
155
|
-
className={styles.playerControlBtn}
|
|
156
|
-
disabled={currentParagraphIndex === 0 || paragraphCount === 0}
|
|
157
|
-
style={{ opacity: currentParagraphIndex === 0 ? 0.5 : 1 }}
|
|
158
|
-
onClick={handlePrevParagraph}
|
|
159
|
-
title="Đoạn trước"
|
|
160
|
-
>
|
|
161
|
-
<span className="material-icons-round">skip_previous</span>
|
|
162
|
-
</button>
|
|
163
|
-
|
|
164
|
-
<button
|
|
165
|
-
className={styles.playerPlayBtn}
|
|
166
|
-
onClick={togglePlay}
|
|
167
|
-
disabled={paragraphCount === 0}
|
|
168
|
-
style={{ opacity: paragraphCount === 0 ? 0.6 : 1 }}
|
|
169
|
-
>
|
|
170
|
-
{isGeneratingParagraph ? (
|
|
171
|
-
<span className={`material-icons-round ${styles.spin}`} style={{ fontSize: 24 }}>
|
|
172
|
-
sync
|
|
173
|
-
</span>
|
|
174
|
-
) : (
|
|
175
|
-
<span className="material-icons-round" style={{ fontSize: 24 }}>
|
|
176
|
-
{isPlaying ? "pause" : "play_arrow"}
|
|
177
|
-
</span>
|
|
178
|
-
)}
|
|
179
|
-
</button>
|
|
180
|
-
|
|
181
|
-
<button
|
|
182
|
-
className={styles.playerControlBtn}
|
|
183
|
-
disabled={currentParagraphIndex === paragraphCount - 1 || paragraphCount === 0}
|
|
184
|
-
style={{ opacity: currentParagraphIndex === paragraphCount - 1 ? 0.5 : 1 }}
|
|
185
|
-
onClick={handleNextParagraph}
|
|
186
|
-
title="Đoạn sau"
|
|
187
|
-
>
|
|
188
|
-
<span className="material-icons-round">skip_next</span>
|
|
189
|
-
</button>
|
|
190
|
-
</>
|
|
191
|
-
)}
|
|
192
|
-
</div>
|
|
193
|
-
|
|
194
|
-
<div className={styles.playerRight}>
|
|
195
|
-
<div className={styles.playerVolumeWrap}>
|
|
196
|
-
<button className={styles.playerControlBtn} disabled={isPlayerDisabled} onClick={() => setIsMuted((prev) => !prev)}>
|
|
197
|
-
<span className="material-icons-round">{isMuted ? "volume_off" : "volume_up"}</span>
|
|
198
|
-
</button>
|
|
199
|
-
<input
|
|
200
|
-
type="range"
|
|
201
|
-
className={styles.playerVolumeSlider}
|
|
202
|
-
min="0"
|
|
203
|
-
max="1"
|
|
204
|
-
step="0.05"
|
|
205
|
-
disabled={isPlayerDisabled}
|
|
206
|
-
value={isMuted ? 0 : volume}
|
|
207
|
-
onChange={(e) => {
|
|
208
|
-
const vol = Number(e.target.value);
|
|
209
|
-
setVolume(vol);
|
|
210
|
-
setIsMuted(vol === 0);
|
|
211
|
-
}}
|
|
212
|
-
/>
|
|
213
|
-
</div>
|
|
214
|
-
|
|
215
|
-
<button
|
|
216
|
-
className={styles.playerSpeedBtn}
|
|
217
|
-
disabled={isPlayerDisabled}
|
|
218
|
-
onClick={() => {
|
|
219
|
-
const nextSpeed = playbackRate === 1 ? 1.25 : playbackRate === 1.25 ? 1.5 : playbackRate === 1.5 ? 2.0 : 1.0;
|
|
220
|
-
setPlaybackRate(nextSpeed);
|
|
221
|
-
}}
|
|
222
|
-
>
|
|
223
|
-
{playbackRate}x
|
|
224
|
-
</button>
|
|
225
|
-
|
|
226
|
-
<button
|
|
227
|
-
className={`${styles.playerContinuousBtn} ${continuousPlay ? styles.activeContinuous : ""}`}
|
|
228
|
-
onClick={() => setContinuousPlay((prev) => !prev)}
|
|
229
|
-
title={continuousPlay ? "Đang bật tự động chuyển chương" : "Đang tắt tự động chuyển chương"}
|
|
230
|
-
>
|
|
231
|
-
<span className="material-icons-round" style={{ fontSize: "18px" }}>
|
|
232
|
-
{continuousPlay ? "sync" : "sync_disabled"}
|
|
233
|
-
</span>
|
|
234
|
-
<span className={styles.continuousText}>Tự Động Chuyển Chương</span>
|
|
235
|
-
</button>
|
|
236
|
-
|
|
237
|
-
<select className={styles.voiceSelect} value={selectedVoice} onChange={(e) => handleVoiceChange(e.target.value)}>
|
|
238
|
-
<option value="BV074_streaming">🔊 Nữ Audio</option>
|
|
239
|
-
<option value="BV421_vivn_streaming">🔊 Nữ Hoạt Hình</option>
|
|
240
|
-
<option value="BV075_streaming">🔊 Nam Review</option>
|
|
241
|
-
<option value="vi_female_huong">🔊 Nữ Review</option>
|
|
242
|
-
</select>
|
|
243
|
-
|
|
244
|
-
<button className={styles.playerControlBtn} onClick={() => setPlayerOpen(false)}>
|
|
245
|
-
<span className="material-icons-round">close</span>
|
|
246
|
-
</button>
|
|
247
|
-
</div>
|
|
248
|
-
</div>
|
|
249
|
-
|
|
250
|
-
<div className={styles.playerProgressRow}>
|
|
251
|
-
{isStudio ? (
|
|
252
|
-
<>
|
|
253
|
-
<span className={styles.playerTime}>{formatTime(currentTime)}</span>
|
|
254
|
-
<input
|
|
255
|
-
type="range"
|
|
256
|
-
className={styles.playerSlider}
|
|
257
|
-
min="0"
|
|
258
|
-
max={duration || 100}
|
|
259
|
-
value={currentTime}
|
|
260
|
-
disabled={isPlayerDisabled}
|
|
261
|
-
onChange={(e) => {
|
|
262
|
-
if (audioRef1.current) {
|
|
263
|
-
audioRef1.current.currentTime = Number(e.target.value);
|
|
264
|
-
}
|
|
265
|
-
}}
|
|
266
|
-
/>
|
|
267
|
-
<span className={styles.playerTime}>{formatTime(duration)}</span>
|
|
268
|
-
</>
|
|
269
|
-
) : (
|
|
270
|
-
<>
|
|
271
|
-
<span className={styles.playerTime} style={{ minWidth: "54px" }}>
|
|
272
|
-
Đoạn {currentParagraphIndex + 1}
|
|
273
|
-
</span>
|
|
274
|
-
<input
|
|
275
|
-
type="range"
|
|
276
|
-
className={styles.playerSlider}
|
|
277
|
-
min="0"
|
|
278
|
-
max={paragraphCount}
|
|
279
|
-
step="0.01"
|
|
280
|
-
value={localProgress !== null ? localProgress : currentParagraphIndex + (duration ? currentTime / duration : 0)}
|
|
281
|
-
disabled={paragraphCount === 0}
|
|
282
|
-
onChange={(e) => setLocalProgress(Number(e.target.value))}
|
|
283
|
-
onMouseUp={() => {
|
|
284
|
-
if (localProgress !== null) jumpToProgress(localProgress);
|
|
285
|
-
}}
|
|
286
|
-
onTouchEnd={() => {
|
|
287
|
-
if (localProgress !== null) jumpToProgress(localProgress);
|
|
288
|
-
}}
|
|
289
|
-
/>
|
|
290
|
-
<span className={styles.playerTime} style={{ minWidth: "54px", textAlign: "right" }}>
|
|
291
|
-
{paragraphCount} đoạn
|
|
292
|
-
</span>
|
|
293
|
-
</>
|
|
294
|
-
)}
|
|
295
|
-
</div>
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
);
|
|
299
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import styles from "../styles/reader.module.css";
|
|
2
|
-
import type { AutoScrollDrawerProps } from "../types";
|
|
3
|
-
|
|
4
|
-
export function AutoScrollDrawer({
|
|
5
|
-
open,
|
|
6
|
-
onClose,
|
|
7
|
-
isAutoScrolling,
|
|
8
|
-
scrollSpeed,
|
|
9
|
-
onChangeSpeed,
|
|
10
|
-
onStart,
|
|
11
|
-
onStop,
|
|
12
|
-
}: AutoScrollDrawerProps) {
|
|
13
|
-
return (
|
|
14
|
-
<div className={`${styles.readerModalOverlay} ${open ? styles.open : ""}`} onClick={onClose}>
|
|
15
|
-
<div className={styles.scrollDrawer} onClick={(e) => e.stopPropagation()}>
|
|
16
|
-
<div className={styles.drawerHeader}>
|
|
17
|
-
<h3>Cuộn tự động</h3>
|
|
18
|
-
<button className={styles.drawerCloseBtn} onClick={onClose}>
|
|
19
|
-
<span className="material-icons-round">close</span>
|
|
20
|
-
</button>
|
|
21
|
-
</div>
|
|
22
|
-
<div className={styles.drawerBody}>
|
|
23
|
-
<div className={styles.scrollStatus}>
|
|
24
|
-
<span className={styles.statusDot} style={{ background: isAutoScrolling ? "#10b981" : "#71717a" }} />
|
|
25
|
-
<span>{isAutoScrolling ? "Đang cuộn" : "Sẵn sàng"}</span>
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
<div className={styles.scrollSpeedControl}>
|
|
29
|
-
<label>Tốc độ cuộn: {scrollSpeed.toFixed(1)}x</label>
|
|
30
|
-
<input
|
|
31
|
-
type="range"
|
|
32
|
-
min="0.5"
|
|
33
|
-
max="5"
|
|
34
|
-
step="0.5"
|
|
35
|
-
value={scrollSpeed}
|
|
36
|
-
onChange={(e) => onChangeSpeed(Number(e.target.value))}
|
|
37
|
-
className={styles.drawerSlider}
|
|
38
|
-
/>
|
|
39
|
-
<div className={styles.sliderLabels}>
|
|
40
|
-
<span>Chậm</span>
|
|
41
|
-
<span>Vừa</span>
|
|
42
|
-
<span>Nhanh</span>
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
45
|
-
|
|
46
|
-
<div className={styles.drawerActions}>
|
|
47
|
-
<button className={styles.btnStartScroll} onClick={onStart} disabled={isAutoScrolling}>
|
|
48
|
-
<span className="material-icons-round">play_arrow</span> Bắt đầu
|
|
49
|
-
</button>
|
|
50
|
-
<button className={styles.btnStopScroll} onClick={onStop} disabled={!isAutoScrolling}>
|
|
51
|
-
<span className="material-icons-round">pause</span> Dừng
|
|
52
|
-
</button>
|
|
53
|
-
</div>
|
|
54
|
-
</div>
|
|
55
|
-
</div>
|
|
56
|
-
</div>
|
|
57
|
-
);
|
|
58
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import styles from "../styles/reader.module.css";
|
|
2
|
-
import type { ChapterBottomNavProps } from "../types";
|
|
3
|
-
import { NavButton } from "./NavButton";
|
|
4
|
-
|
|
5
|
-
export function ChapterBottomNav({ chapter }: ChapterBottomNavProps) {
|
|
6
|
-
return (
|
|
7
|
-
<div className={styles.navBottom}>
|
|
8
|
-
<NavButton href={chapter.prevChapterId} variant="ghost">
|
|
9
|
-
<span className="material-icons-round">chevron_left</span> Chương trước
|
|
10
|
-
</NavButton>
|
|
11
|
-
<NavButton href={chapter.nextChapterId} variant="primary">
|
|
12
|
-
Chương sau <span className="material-icons-round">chevron_right</span>
|
|
13
|
-
</NavButton>
|
|
14
|
-
</div>
|
|
15
|
-
);
|
|
16
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import styles from "../styles/reader.module.css";
|
|
4
|
-
import type { ChapterContentProps } from "../types";
|
|
5
|
-
|
|
6
|
-
export function ChapterContent({
|
|
7
|
-
renderedParagraphs,
|
|
8
|
-
highlightedIndex,
|
|
9
|
-
clickable,
|
|
10
|
-
onParagraphClick,
|
|
11
|
-
}: ChapterContentProps) {
|
|
12
|
-
return (
|
|
13
|
-
<article className={styles.content}>
|
|
14
|
-
{renderedParagraphs.map((segments, idx) => (
|
|
15
|
-
<p
|
|
16
|
-
key={idx}
|
|
17
|
-
className={idx === highlightedIndex ? styles.highlightedParagraph : ""}
|
|
18
|
-
style={{ cursor: clickable ? "pointer" : "default" }}
|
|
19
|
-
onClick={() => {
|
|
20
|
-
if (clickable) onParagraphClick(idx);
|
|
21
|
-
}}
|
|
22
|
-
>
|
|
23
|
-
{segments.map((seg, i) =>
|
|
24
|
-
seg.type === "text" ? (
|
|
25
|
-
<span key={i}>{seg.value}</span>
|
|
26
|
-
) : (
|
|
27
|
-
<span key={i}>
|
|
28
|
-
<span
|
|
29
|
-
className={styles.obfWordLora}
|
|
30
|
-
dangerouslySetInnerHTML={{ __html: seg.lora }}
|
|
31
|
-
/>
|
|
32
|
-
<span
|
|
33
|
-
className={styles.obfWordJakarta}
|
|
34
|
-
dangerouslySetInnerHTML={{ __html: seg.jakarta }}
|
|
35
|
-
/>
|
|
36
|
-
</span>
|
|
37
|
-
)
|
|
38
|
-
)}
|
|
39
|
-
</p>
|
|
40
|
-
))}
|
|
41
|
-
</article>
|
|
42
|
-
);
|
|
43
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useEffect, useRef } from "react";
|
|
4
|
-
import styles from "../styles/reader.module.css";
|
|
5
|
-
import type { ChapterListDrawerProps } from "../types";
|
|
6
|
-
|
|
7
|
-
export function ChapterListDrawer({
|
|
8
|
-
open,
|
|
9
|
-
onClose,
|
|
10
|
-
chapter,
|
|
11
|
-
allChapters,
|
|
12
|
-
onSelect,
|
|
13
|
-
}: ChapterListDrawerProps) {
|
|
14
|
-
const gridRef = useRef<HTMLDivElement>(null);
|
|
15
|
-
const touchStartYRef = useRef(0);
|
|
16
|
-
|
|
17
|
-
useEffect(() => {
|
|
18
|
-
if (!open) return;
|
|
19
|
-
const scrollToActive = () => {
|
|
20
|
-
const grid = gridRef.current;
|
|
21
|
-
const activeBtn = grid?.querySelector(`.${styles.drawerChapterActive}`);
|
|
22
|
-
if (activeBtn && grid) {
|
|
23
|
-
const btnRect = activeBtn.getBoundingClientRect();
|
|
24
|
-
const gridRect = grid.getBoundingClientRect();
|
|
25
|
-
grid.scrollTop = grid.scrollTop + (btnRect.top - gridRect.top);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
const timers = [50, 150, 450].map((ms) => setTimeout(scrollToActive, ms));
|
|
29
|
-
return () => timers.forEach(clearTimeout);
|
|
30
|
-
}, [open, chapter.id]);
|
|
31
|
-
|
|
32
|
-
const handleOverlayTouchStart = (e: React.TouchEvent) => {
|
|
33
|
-
if (e.touches.length > 0) touchStartYRef.current = e.touches[0].clientY;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const handleOverlayTouchMove = (e: React.TouchEvent) => {
|
|
37
|
-
if (gridRef.current?.contains(e.target as Node)) return;
|
|
38
|
-
if (e.touches.length > 0 && gridRef.current) {
|
|
39
|
-
const currentY = e.touches[0].clientY;
|
|
40
|
-
gridRef.current.scrollTop -= currentY - touchStartYRef.current;
|
|
41
|
-
touchStartYRef.current = currentY;
|
|
42
|
-
if (e.cancelable) e.preventDefault();
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div
|
|
48
|
-
className={`${styles.readerModalOverlay} ${open ? styles.open : ""}`}
|
|
49
|
-
onClick={onClose}
|
|
50
|
-
onTouchStart={handleOverlayTouchStart}
|
|
51
|
-
onTouchMove={handleOverlayTouchMove}
|
|
52
|
-
>
|
|
53
|
-
<div className={styles.chapterDrawer} onClick={(e) => e.stopPropagation()}>
|
|
54
|
-
<div className={styles.drawerHeader}>
|
|
55
|
-
<h3>Danh sách chương</h3>
|
|
56
|
-
<button className={styles.drawerCloseBtn} onClick={onClose}>
|
|
57
|
-
<span className="material-icons-round">close</span>
|
|
58
|
-
</button>
|
|
59
|
-
</div>
|
|
60
|
-
<div className={styles.drawerGrid} ref={gridRef}>
|
|
61
|
-
{allChapters.map((ch) => (
|
|
62
|
-
<button
|
|
63
|
-
key={ch.id}
|
|
64
|
-
className={`${styles.drawerChapterBtn} ${ch.id === chapter.id ? styles.drawerChapterActive : ""}`}
|
|
65
|
-
onClick={() => onSelect(ch.id)}
|
|
66
|
-
>
|
|
67
|
-
<span style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 }}>
|
|
68
|
-
{ch.title}
|
|
69
|
-
</span>
|
|
70
|
-
{ch.type === "vip" && (
|
|
71
|
-
<span className={styles.drawerVipBadge}>
|
|
72
|
-
<span className="material-icons-round" style={{ fontSize: 11, marginRight: 2, verticalAlign: "middle" }}>
|
|
73
|
-
star
|
|
74
|
-
</span>
|
|
75
|
-
VIP
|
|
76
|
-
</span>
|
|
77
|
-
)}
|
|
78
|
-
</button>
|
|
79
|
-
))}
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
</div>
|
|
83
|
-
);
|
|
84
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import styles from "../styles/reader.module.css";
|
|
2
|
-
import type { ChapterNavProps } from "../types";
|
|
3
|
-
import { NavButton } from "./NavButton";
|
|
4
|
-
import { ChapterSelect } from "./ChapterSelect";
|
|
5
|
-
|
|
6
|
-
export function ChapterNav({ chapter, allChapters }: ChapterNavProps) {
|
|
7
|
-
return (
|
|
8
|
-
<div className={styles.navTop}>
|
|
9
|
-
<NavButton href={chapter.prevChapterId} variant="ghost">
|
|
10
|
-
<span className="material-icons-round">chevron_left</span> Chương trước
|
|
11
|
-
</NavButton>
|
|
12
|
-
|
|
13
|
-
<ChapterSelect chapter={chapter} allChapters={allChapters} />
|
|
14
|
-
|
|
15
|
-
<NavButton href={chapter.nextChapterId} variant="ghost">
|
|
16
|
-
Chương sau <span className="material-icons-round">chevron_right</span>
|
|
17
|
-
</NavButton>
|
|
18
|
-
</div>
|
|
19
|
-
);
|
|
20
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useRouter } from "next/navigation";
|
|
4
|
-
import styles from "../styles/reader.module.css";
|
|
5
|
-
import type { ChapterSelectProps } from "../types";
|
|
6
|
-
|
|
7
|
-
export function ChapterSelect({ chapter, allChapters }: ChapterSelectProps) {
|
|
8
|
-
const router = useRouter();
|
|
9
|
-
return (
|
|
10
|
-
<div className={styles.chapterSelectWrap}>
|
|
11
|
-
<select
|
|
12
|
-
value={chapter.id}
|
|
13
|
-
onChange={(e) => router.push(`/${e.target.value}`)}
|
|
14
|
-
className={styles.chapterSelect}
|
|
15
|
-
>
|
|
16
|
-
{allChapters.map((ch) => (
|
|
17
|
-
<option key={ch.id} value={ch.id}>
|
|
18
|
-
{ch.title}
|
|
19
|
-
</option>
|
|
20
|
-
))}
|
|
21
|
-
</select>
|
|
22
|
-
</div>
|
|
23
|
-
);
|
|
24
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import { useMemo } from "react";
|
|
4
|
-
import type { CSSProperties } from "react";
|
|
5
|
-
import styles from "../styles/reader.module.css";
|
|
6
|
-
import type { ChapterWatermarkProps } from "../types";
|
|
7
|
-
|
|
8
|
-
const TILE_WIDTH = 360;
|
|
9
|
-
const TILE_HEIGHT = 260;
|
|
10
|
-
const BRAND_LABEL = "TẠP HÓA TRUYỆN HAY";
|
|
11
|
-
|
|
12
|
-
function escapeXml(value: string): string {
|
|
13
|
-
return value
|
|
14
|
-
.replace(/&/g, "&")
|
|
15
|
-
.replace(/</g, "<")
|
|
16
|
-
.replace(/>/g, ">")
|
|
17
|
-
.replace(/"/g, """)
|
|
18
|
-
.replace(/'/g, "'");
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Lớp pattern mờ đè lên nội dung mọi chương (VIP lẫn miễn phí): dệt cả tên thương hiệu
|
|
23
|
-
* lẫn username người đang đọc (nếu đã đăng nhập), nhằm phá vỡ đường nét chữ khi bị chụp
|
|
24
|
-
* màn hình / crawl ảnh rồi chạy OCR lại — đồng thời để lại dấu vết user nếu ảnh rò rỉ.
|
|
25
|
-
* Mắt người đọc bình thường (chữ liền mạch, tương phản cao) không bị ảnh hưởng nhiều.
|
|
26
|
-
* Không liên quan tới useContentProtection (chặn copy/devtools) hay obfuscateChapterContent
|
|
27
|
-
* (phá DOM text scraping) — đây là lớp chống OCR + watermark trên ảnh chụp.
|
|
28
|
-
*/
|
|
29
|
-
export function ChapterWatermark({ theme, viewer }: ChapterWatermarkProps) {
|
|
30
|
-
const backgroundImage = useMemo(() => {
|
|
31
|
-
const label = viewer ? `${BRAND_LABEL} · ${viewer.username}` : BRAND_LABEL;
|
|
32
|
-
const fill = theme === "dark" ? "rgba(255,61,136,0.10)" : "rgba(255,61,136,0.12)";
|
|
33
|
-
|
|
34
|
-
const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${TILE_WIDTH}" height="${TILE_HEIGHT}">
|
|
35
|
-
<text x="${TILE_WIDTH / 2}" y="${TILE_HEIGHT / 2}" transform="rotate(-28 ${TILE_WIDTH / 2} ${TILE_HEIGHT / 2})" font-size="14" font-family="sans-serif" font-weight="700" letter-spacing="3" fill="${fill}" text-anchor="middle">${escapeXml(label)}</text>
|
|
36
|
-
</svg>`;
|
|
37
|
-
|
|
38
|
-
return `url("data:image/svg+xml,${encodeURIComponent(svg)}")`;
|
|
39
|
-
}, [theme, viewer]);
|
|
40
|
-
|
|
41
|
-
return (
|
|
42
|
-
<div
|
|
43
|
-
aria-hidden="true"
|
|
44
|
-
className={styles.watermarkLayer}
|
|
45
|
-
style={
|
|
46
|
-
{
|
|
47
|
-
backgroundImage,
|
|
48
|
-
backgroundSize: `${TILE_WIDTH}px ${TILE_HEIGHT}px`,
|
|
49
|
-
} as CSSProperties
|
|
50
|
-
}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|