Skip to content

Commit e3aef08

Browse files
committed
feat: continuous scroll
1 parent c8d1a60 commit e3aef08

3 files changed

Lines changed: 59 additions & 13 deletions

File tree

epub_browser/assets/annotation.css

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,55 @@
300300
color: white;
301301
}
302302

303-
/* ========== Settings Toggle Row ========== */
304-
/* .setting-toggle-row, .setting-label-text, .toggle-switch, .toggle-slider
305-
are defined in chapter.css and shared across all settings tabs. */
303+
/* ========== Settings Toggle Switch ========== */
304+
305+
.settings-switch {
306+
display: flex;
307+
align-items: center;
308+
gap: 10px;
309+
cursor: pointer;
310+
}
311+
312+
.settings-switch input[type="checkbox"] {
313+
display: none;
314+
}
315+
316+
.switch-slider {
317+
width: 48px;
318+
height: 26px;
319+
background: var(--border);
320+
border-radius: 13px;
321+
position: relative;
322+
transition: background 0.2s;
323+
flex-shrink: 0;
324+
}
325+
326+
.switch-slider::after {
327+
content: '';
328+
position: absolute;
329+
width: 20px;
330+
height: 20px;
331+
background: white;
332+
border-radius: 50%;
333+
top: 3px;
334+
left: 3px;
335+
transition: transform 0.2s;
336+
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
337+
}
338+
339+
.settings-switch input[type="checkbox"]:checked + .switch-slider {
340+
background: var(--button-bg);
341+
}
342+
343+
.settings-switch input[type="checkbox"]:checked + .switch-slider::after {
344+
transform: translateX(22px);
345+
}
346+
347+
.switch-text {
348+
font-size: 0.95rem;
349+
color: var(--text);
350+
font-weight: 500;
351+
}
306352

307353
/* ========== Storage Options ========== */
308354

epub_browser/assets/annotation.js

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1322,13 +1322,11 @@
13221322
tabPanel.id = 'annotation-tab';
13231323
tabPanel.innerHTML = '\
13241324
<div class="settings-group">\
1325-
<div class="setting-toggle-row">\
1326-
<span class="setting-label-text">Enable Annotation</span>\
1327-
<label class="toggle-switch">\
1328-
<input type="checkbox" id="annotationEnabled" ' + (Settings.enabled ? 'checked' : '') + '>\
1329-
<span class="toggle-slider"></span>\
1330-
</label>\
1331-
</div>\
1325+
<label class="settings-switch">\
1326+
<input type="checkbox" id="annotationEnabled" ' + (Settings.enabled ? 'checked' : '') + '>\
1327+
<span class="switch-slider"></span>\
1328+
<span class="switch-text">Enable Annotation</span>\
1329+
</label>\
13321330
</div>\
13331331
<div class="settings-group">\
13341332
<label class="settings-label">Storage Location</label>\

epub_browser/assets/chapter.css

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,9 +1593,11 @@ body {
15931593
font-size: 0.75rem;
15941594
font-weight: 400;
15951595
white-space: normal;
1596-
max-width: 260px;
1597-
text-align: center;
1598-
line-height: 1.4;
1596+
word-break: break-word;
1597+
width: max-content;
1598+
max-width: min(320px, calc(100vw - 40px));
1599+
text-align: left;
1600+
line-height: 1.5;
15991601
z-index: 100;
16001602
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
16011603
}

0 commit comments

Comments
 (0)