mirror of
https://github.com/ajurna/cbwebreader.git
synced 2026-11-02 18:46:53 +00:00
**Add continuous reading mode and enhance accessibility in TheComicReader**
- Introduced a continuous reading mode ("scroll"), allowing users to read without pagination.
- Implemented a toggle in the UI to switch between "paged" and "continuous" modes, with preferences saved in `localStorage`.
- Enhanced keyboard navigation by throttling repeated actions and ignoring irrelevant keypresses during form interactions.
- Integrated `IntersectionObserver` to handle lazy-loading of images and dynamically extending rendered content in continuous mode.
- Updated tests to validate both reading modes, ensuring proper state management and observer handling.
- Adjusted animations and transitions for smoother visual feedback in both modes, respecting users' motion-reduction preferences.
This commit is contained in:
1 parent
494b64621e
commit
80566e657e
6 files changed
+647
-92
No files matched your search
@@ -14,6 +14,12 @@ function get_user_from_storage(){
|
||||
}
|
||||
}
|
||||
|
||||
// Reading mode is a preference rather than part of the session, so it is kept on its own.
|
||||
function get_reader_mode_from_storage(){
|
||||
const mode = localStorage.getItem('reader_mode')
|
||||
return mode === 'scroll' ? 'scroll' : 'paged'
|
||||
}
|
||||
|
||||
function session_expired_query(next){
|
||||
return {
|
||||
name: 'login',
|
||||
@@ -28,6 +34,7 @@ export default createStore({
|
||||
state: {
|
||||
filters: {},
|
||||
user: get_user_from_storage(),
|
||||
reader_mode: get_reader_mode_from_storage(),
|
||||
classifications: [
|
||||
{label: 'G', value: '0'},
|
||||
{label: 'PG', value: '1'},
|
||||
@@ -57,6 +64,13 @@ export default createStore({
|
||||
localStorage.setItem('u', JSON.stringify(userData));
|
||||
state.user = userData
|
||||
},
|
||||
setReaderMode(state, mode){
|
||||
if (mode !== 'paged' && mode !== 'scroll') {
|
||||
return
|
||||
}
|
||||
localStorage.setItem('reader_mode', mode);
|
||||
state.reader_mode = mode
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
obtainToken(context, {username, password}){
|
||||
|
||||
Reference in new issue
Block a user