feat(reader): autonomous Wikipedia import and reading with media, tables and settings
This commit is contained in:
1 parent
52db766b23
commit
dee9b8d10b
9 files changed
+1659
-24
No files matched your search
@@ -3603,6 +3603,408 @@ body.drawer-open {
|
||||
}
|
||||
}
|
||||
|
||||
/* ==========================================================================
|
||||
Wikipedia Articles Section & Settings Modal
|
||||
========================================================================== */
|
||||
|
||||
.wiki-section {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.wiki-header {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.wiki-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.wiki-icon-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
font-size: 24px;
|
||||
background: rgba(168, 85, 247, 0.12);
|
||||
border: 1px solid rgba(168, 85, 247, 0.28);
|
||||
border-radius: var(--radius-md);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.wiki-heading {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: var(--text-main);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.wiki-action-box {
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 20px 24px;
|
||||
margin-bottom: 24px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
|
||||
.wiki-primary-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.wiki-read-btn {
|
||||
padding: 10px 24px;
|
||||
font-weight: 700;
|
||||
font-size: 15px;
|
||||
background: linear-gradient(135deg, #6366f1, #8b5cf6);
|
||||
border: none;
|
||||
box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.wiki-read-btn:hover {
|
||||
background: linear-gradient(135deg, #4f46e5, #7c3aed);
|
||||
transform: translateY(-1px);
|
||||
box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
|
||||
}
|
||||
|
||||
.wiki-settings-btn {
|
||||
padding: 10px 18px;
|
||||
font-weight: 600;
|
||||
border-color: rgba(168, 85, 247, 0.35);
|
||||
color: var(--text-main);
|
||||
}
|
||||
|
||||
.wiki-settings-btn:hover {
|
||||
background: rgba(168, 85, 247, 0.12);
|
||||
border-color: #a855f7;
|
||||
color: #c084fc;
|
||||
}
|
||||
|
||||
.wiki-badges-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.wiki-badges-label {
|
||||
color: var(--text-dim);
|
||||
font-size: 12px;
|
||||
text-transform: uppercase;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.05em;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.wiki-badge-chip {
|
||||
background: rgba(168, 85, 247, 0.12);
|
||||
color: #c084fc;
|
||||
border: 1px solid rgba(168, 85, 247, 0.28);
|
||||
border-radius: var(--radius-full);
|
||||
padding: 4px 12px;
|
||||
font-weight: 500;
|
||||
font-size: 12px;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.wiki-fetch-status {
|
||||
margin-top: 14px;
|
||||
padding: 10px 16px;
|
||||
font-size: 13.5px;
|
||||
border-radius: var(--radius-md);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.wiki-status-loading {
|
||||
background: rgba(99, 102, 241, 0.12);
|
||||
color: #818cf8;
|
||||
border: 1px solid rgba(99, 102, 241, 0.3);
|
||||
}
|
||||
|
||||
.wiki-status-success {
|
||||
background: rgba(34, 197, 94, 0.12);
|
||||
color: #4ade80;
|
||||
border: 1px solid rgba(34, 197, 94, 0.25);
|
||||
}
|
||||
|
||||
.wiki-status-error {
|
||||
background: rgba(239, 68, 68, 0.12);
|
||||
color: #f87171;
|
||||
border: 1px solid rgba(239, 68, 68, 0.25);
|
||||
}
|
||||
|
||||
.wiki-empty-state {
|
||||
padding: 36px 20px;
|
||||
background: var(--bg-surface);
|
||||
border: 1px dashed var(--border-color);
|
||||
border-radius: var(--radius-lg);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
/* Card styling for Wikipedia and thumbnails */
|
||||
.wiki-card {
|
||||
border-color: rgba(168, 85, 247, 0.22);
|
||||
}
|
||||
|
||||
.wiki-card:hover {
|
||||
border-color: rgba(168, 85, 247, 0.55);
|
||||
box-shadow: 0 8px 24px rgba(168, 85, 247, 0.15);
|
||||
}
|
||||
|
||||
.wiki-cover-icon {
|
||||
background: rgba(168, 85, 247, 0.12);
|
||||
border-color: rgba(168, 85, 247, 0.3);
|
||||
color: #c084fc;
|
||||
}
|
||||
|
||||
.badge-wiki {
|
||||
background: rgba(168, 85, 247, 0.18);
|
||||
color: #c084fc;
|
||||
border: 1px solid rgba(168, 85, 247, 0.35);
|
||||
}
|
||||
|
||||
.wiki-progress-fill {
|
||||
background: linear-gradient(90deg, #7c3aed, #a855f7);
|
||||
}
|
||||
|
||||
.book-cover-img-wrap {
|
||||
width: 52px;
|
||||
height: 64px;
|
||||
border-radius: var(--radius-sm);
|
||||
overflow: hidden;
|
||||
flex-shrink: 0;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
border: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.book-cover-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.badge-time {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 3px;
|
||||
background: rgba(255, 255, 255, 0.06);
|
||||
color: var(--text-dim);
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
padding: 2px 7px;
|
||||
border-radius: var(--radius-sm);
|
||||
border: 1px solid rgba(255, 255, 255, 0.08);
|
||||
}
|
||||
|
||||
/* Wikipedia Settings Modal */
|
||||
.wiki-modal-window {
|
||||
max-width: 620px;
|
||||
width: 95%;
|
||||
}
|
||||
|
||||
.wiki-modal-body {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 22px;
|
||||
}
|
||||
|
||||
.wiki-setting-group {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.wiki-group-label {
|
||||
font-size: 13.5px;
|
||||
font-weight: 700;
|
||||
color: var(--text-main);
|
||||
letter-spacing: 0.02em;
|
||||
}
|
||||
|
||||
.wiki-radio-cards {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.wiki-radio-card {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 12px;
|
||||
padding: 14px 16px;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-md);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.wiki-radio-card:hover {
|
||||
border-color: rgba(168, 85, 247, 0.4);
|
||||
background: rgba(168, 85, 247, 0.04);
|
||||
}
|
||||
|
||||
.wiki-radio-card:has(input:checked) {
|
||||
border-color: #a855f7;
|
||||
background: rgba(168, 85, 247, 0.1);
|
||||
box-shadow: 0 0 0 1px #a855f7;
|
||||
}
|
||||
|
||||
.wiki-radio-card input[type="radio"] {
|
||||
margin-top: 3px;
|
||||
accent-color: #a855f7;
|
||||
}
|
||||
|
||||
.wiki-radio-card-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 5px;
|
||||
}
|
||||
|
||||
.wiki-card-title-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.wiki-card-desc {
|
||||
font-size: 12px;
|
||||
color: var(--text-dim);
|
||||
line-height: 1.45;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.badge-level-pill {
|
||||
font-size: 10.5px;
|
||||
font-weight: 700;
|
||||
padding: 1px 7px;
|
||||
border-radius: var(--radius-full);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
.badge-level-a2 {
|
||||
background: rgba(34, 197, 94, 0.2);
|
||||
color: #4ade80;
|
||||
border: 1px solid rgba(34, 197, 94, 0.35);
|
||||
}
|
||||
|
||||
.badge-level-b2 {
|
||||
background: rgba(59, 130, 246, 0.2);
|
||||
color: #60a5fa;
|
||||
border: 1px solid rgba(59, 130, 246, 0.35);
|
||||
}
|
||||
|
||||
.wiki-time-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.wiki-time-pill {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.wiki-time-pill input[type="radio"] {
|
||||
position: absolute;
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.wiki-pill-text {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
padding: 10px 8px;
|
||||
background: var(--bg-input);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-md);
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--text-main);
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.wiki-pill-text small {
|
||||
font-size: 11px;
|
||||
font-weight: normal;
|
||||
margin-top: 2px;
|
||||
}
|
||||
|
||||
.wiki-time-pill:hover .wiki-pill-text {
|
||||
border-color: rgba(168, 85, 247, 0.4);
|
||||
}
|
||||
|
||||
.wiki-time-pill input[type="radio"]:checked + .wiki-pill-text {
|
||||
border-color: #a855f7;
|
||||
background: rgba(168, 85, 247, 0.12);
|
||||
color: #c084fc;
|
||||
box-shadow: 0 0 0 1px #a855f7;
|
||||
}
|
||||
|
||||
.wiki-select {
|
||||
width: 100%;
|
||||
padding: 10px 14px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.wiki-direct-import-group {
|
||||
border-top: 1px dashed var(--border-color);
|
||||
padding-top: 18px;
|
||||
}
|
||||
|
||||
.wiki-custom-input-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.wiki-custom-input {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.wiki-custom-fetch-btn {
|
||||
white-space: nowrap;
|
||||
padding: 0 18px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.wiki-radio-cards {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.wiki-custom-input-wrap {
|
||||
flex-direction: column;
|
||||
}
|
||||
.wiki-custom-fetch-btn {
|
||||
width: 100%;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Reader Interface */
|
||||
.reader-interface {
|
||||
background-color: var(--bg-surface);
|
||||
@@ -4273,6 +4675,48 @@ body.drawer-open {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
/* Figures and Media (Images, Diagrams, Animated GIFs, SVGs) */
|
||||
.reader-figure {
|
||||
margin: 28px auto;
|
||||
padding: 14px;
|
||||
background: var(--bg-surface);
|
||||
border: 1px solid var(--border-color);
|
||||
border-radius: var(--radius-lg);
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
max-width: 95%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.reader-figure-img {
|
||||
max-width: 100%;
|
||||
max-height: 480px;
|
||||
width: auto;
|
||||
height: auto;
|
||||
border-radius: var(--radius-md);
|
||||
object-fit: contain;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.reader-figcaption {
|
||||
margin-top: 12px;
|
||||
padding-top: 10px;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.08);
|
||||
font-size: 13.5px;
|
||||
line-height: 1.55;
|
||||
color: var(--text-dim);
|
||||
text-align: center;
|
||||
max-width: 90%;
|
||||
font-style: italic;
|
||||
user-select: text;
|
||||
}
|
||||
|
||||
.reader-figcaption .reader-word {
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
.reader-content-body p[style*="text-align: center"],
|
||||
.reader-content-body p.text-center {
|
||||
text-indent: 0 !important;
|
||||
|
||||
Reference in new issue
Block a user