Spaces:
Runtime error
Runtime error
:root { | |
--primary-color: #3498db; | |
--secondary-color: #2c3e50; | |
--background-color: #ecf0f1; | |
--text-color: #34495e; | |
--highlight-color: #e74c3c; | |
--button-min-width: 80px; | |
--button-height: 30px; | |
--button-font-size: 12px; | |
--bg-primary: #ecf0f1; | |
--bg-secondary: #ffffff; | |
--text-primary: #34495e; | |
--text-secondary: #2c3e50; | |
--border-color: #ddd; | |
--flashcard-bg: #ffffff; | |
--highlight-bg: rgba(52, 152, 219, 0.3); | |
--modal-bg: rgba(0, 0, 0, 0.4); | |
--modal-content-bg: #fefefe; | |
} | |
body { | |
font-family: 'Roboto', Arial, sans-serif; | |
margin: 0; | |
padding: 0; | |
display: flex; | |
flex-direction: column; | |
height: 100vh; | |
overflow: hidden; | |
background-color: var(--bg-primary); | |
color: var(--text-primary); | |
font-size: 80%; | |
transition: background-color 0.3s ease, color 0.3s ease; | |
} | |
#top-bar { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 15px; | |
background-color: var(--bg-secondary); | |
color: var(--text-primary); | |
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); | |
backdrop-filter: blur(5px); | |
} | |
#file-input { | |
color: transparent; | |
} | |
#file-input::before { | |
content: 'Choose PDF'; | |
display: inline-block; | |
min-width: var(--button-min-width); | |
height: var(--button-height); | |
padding: 0 15px; | |
font-size: var(--button-font-size); | |
background: var(--secondary-color); | |
color: white; | |
border-radius: 3px; | |
cursor: pointer; | |
display: inline-flex; | |
align-items: center; | |
justify-content: center; | |
} | |
#page-navigation { | |
display: flex; | |
align-items: center; | |
} | |
#current-page { | |
margin-right: 15px; | |
font-weight: bold; | |
} | |
#page-input { | |
width: 60px; | |
margin-right: 10px; | |
padding: 5px; | |
border: none; | |
border-radius: 3px; | |
} | |
#left-panel { | |
flex-grow: 1; | |
width: 70%; | |
overflow-y: auto; | |
padding: 20px; | |
box-sizing: border-box; | |
height: 100vh; | |
} | |
#right-panel { | |
transform: scale(1); | |
transform-origin: top right; | |
width: 30%; | |
height: 100vh; | |
position: fixed; | |
right: 0; | |
top: 0; | |
padding: 10px; | |
box-sizing: border-box; | |
overflow-y: auto; | |
background-color: var(--bg-secondary); | |
box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1); | |
color: var(--text-primary); | |
transition: background-color 0.3s ease, color 0.3s ease; | |
} | |
#file-input, | |
#mode-toggle, | |
#top-controls { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
margin-bottom: 15px; | |
} | |
#settings-icon { | |
cursor: pointer; | |
font-size: 24px; | |
line-height: 1; | |
} | |
.mode-btn { | |
flex: 1; | |
padding: 5px; | |
border: 1px solid var(--text-secondary); | |
background-color: var(--bg-secondary); | |
color: var(--text-primary); | |
cursor: pointer; | |
transition: all 0.3s ease; | |
} | |
.mode-btn:not(:last-child) { | |
margin-right: 5px; | |
} | |
.mode-btn.selected { | |
background-color: var(--text-secondary); | |
color: var(--bg-secondary); | |
transform: scale(1.05); | |
} | |
.mode-btn:hover:not(.selected) { | |
background-color: var(--bg-primary); | |
} | |
#page-navigation { | |
display: flex; | |
align-items: center; | |
} | |
#page-input { | |
width: 60px; | |
margin-right: 10px; | |
padding: 5px; | |
border: 1px solid #ddd; | |
border-radius: 3px; | |
} | |
#settings-panel { | |
margin-top: 15px; | |
background-color: var(--bg-secondary); | |
border-color: var(--border-color); | |
} | |
#api-key-input, | |
#model-select { | |
margin-bottom: 15px; | |
width: 100%; | |
padding: 8px; | |
border: 1px solid var(--border-color); | |
border-radius: 3px; | |
background-color: var(--bg-secondary); | |
color: var(--text-primary); | |
} | |
#pdf-viewer { | |
border: 1px solid var(--border-color); | |
background-color: var(--bg-secondary); | |
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); | |
} | |
.page { | |
position: relative; | |
margin-bottom: 20px; | |
} | |
.text-layer { | |
position: absolute; | |
left: 0; | |
top: 0; | |
right: 0; | |
bottom: 0; | |
overflow: hidden; | |
opacity: 0.7; | |
line-height: 1.0; | |
} | |
.text-layer > span { | |
color: transparent; | |
position: absolute; | |
white-space: pre; | |
cursor: text; | |
transform-origin: 0% 0%; | |
} | |
::selection { | |
background: var(--highlight-bg); | |
} | |
.highlight { | |
background-color: rgba(255, 255, 0, 0.4); | |
} | |
#system-prompt, #explain-prompt, #language-prompt { | |
width: 100%; | |
height: 150px; | |
margin-bottom: 15px; | |
padding: 10px; | |
border: 1px solid var(--border-color); | |
border-radius: 3px; | |
resize: vertical; | |
background-color: var(--bg-secondary); | |
color: var(--text-primary); | |
} | |
#explain-prompt, #language-prompt { | |
display: none; | |
} | |
#flashcards { | |
margin-top: 10px; | |
width: 100%; | |
} | |
.flashcard { | |
margin-bottom: 8px; | |
padding: 10px; | |
border: 1px solid var(--border-color); | |
background-color: var(--flashcard-bg); | |
border-radius: 3px; | |
transition: box-shadow 0.3s ease; | |
font-size: 1em; | |
color: var(--text-primary); | |
} | |
.flashcard:hover { | |
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); | |
} | |
.dark-mode .flashcard { | |
border-color: var(--text-secondary); | |
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); | |
} | |
.explanation-content { | |
white-space: pre-wrap; | |
text-align: left; | |
margin-bottom: 15px; | |
} | |
.explanation-content br { | |
display: block; | |
margin-bottom: 5px; | |
} | |
.remove-btn { | |
float: right; | |
background-color: var(--highlight-color); | |
color: white; | |
border: none; | |
padding: 5px 10px; | |
border-radius: 3px; | |
cursor: pointer; | |
transition: background-color 0.3s ease; | |
} | |
.remove-btn:hover { | |
background-color: #c0392b; | |
} | |
.dark-mode .remove-btn { | |
background-color: #e74c3c; | |
opacity: 0.9; | |
} | |
.dark-mode .remove-btn:hover { | |
opacity: 1; | |
} | |
/* Modal styles */ | |
.modal { | |
display: none; | |
position: fixed; | |
z-index: 1000; | |
left: 0; | |
top: 0; | |
width: 100%; | |
height: 100%; | |
overflow: auto; | |
background-color: var(--modal-bg); | |
} | |
.modal-content { | |
background-color: var(--modal-content-bg); | |
margin: 5% auto; | |
padding: 20px; | |
border: 1px solid #888; | |
width: 80%; | |
max-width: 800px; | |
max-height: 80vh; | |
overflow-y: auto; | |
color: var(--text-primary); | |
} | |
.close { | |
color: #aaa; | |
float: right; | |
font-size: 28px; | |
font-weight: bold; | |
} | |
.close:hover, | |
.close:focus { | |
color: black; | |
text-decoration: none; | |
cursor: pointer; | |
} | |
/* Markdown styles */ | |
#explanationModalContent { | |
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji; | |
font-size: 16px; | |
line-height: 1.8; | |
word-wrap: break-word; | |
} | |
#explanationModalContent h1, | |
#explanationModalContent h2, | |
#explanationModalContent h3, | |
#explanationModalContent h4, | |
#explanationModalContent h5, | |
#explanationModalContent h6 { | |
margin-top: 24px; | |
margin-bottom: 16px; | |
font-weight: 600; | |
line-height: 1.25; | |
} | |
#explanationModalContent h1 { font-size: 32px; } | |
#explanationModalContent h2 { font-size: 24px; } | |
#explanationModalContent h3 { font-size: 20px; } | |
#explanationModalContent h4 { font-size: 16px; } | |
#explanationModalContent h5 { font-size: 14px; } | |
#explanationModalContent h6 { font-size: 13px; } | |
#explanationModalContent p { | |
margin-top: 0; | |
margin-bottom: 16px; | |
} | |
#explanationModalContent code { | |
padding: 0.2em 0.4em; | |
margin: 0; | |
font-size: 14px; | |
background-color: rgba(27,31,35,0.05); | |
border-radius: 3px; | |
} | |
#explanationModalContent pre { | |
padding: 16px; | |
overflow: auto; | |
font-size: 85%; | |
line-height: 1.45; | |
background-color: #f6f8fa; | |
border-radius: 3px; | |
} | |
#explanationModalContent ul, | |
#explanationModalContent ol { | |
padding-left: 2em; | |
margin-top: 0; | |
margin-bottom: 16px; | |
} | |
#explanationModalContent img { | |
max-width: 100%; | |
box-sizing: content-box; | |
background-color: #fff; | |
} | |
#explanationModalContent blockquote { | |
padding: 0 1em; | |
color: #6a737d; | |
border-left: 0.25em solid #dfe2e5; | |
margin: 0 0 16px 0; | |
} | |
/* Button styles */ | |
.mode-btn, | |
#go-to-page-btn, | |
#submit-btn, | |
#add-to-collection-btn, | |
#clear-collection-btn, | |
#export-csv-btn { | |
min-width: var(--button-min-width); | |
height: var(--button-height); | |
padding: 0 15px; | |
font-size: var(--button-font-size); | |
white-space: nowrap; | |
overflow: hidden; | |
text-overflow: ellipsis; | |
display: inline-flex; | |
align-items: center; | |
justify-content: center; | |
} | |
#go-to-page-btn, | |
#zoom-in-btn, | |
#zoom-out-btn { | |
background-color: var(--secondary-color); | |
color: white; | |
border: none; | |
border-radius: 3px; | |
cursor: pointer; | |
transition: background-color 0.3s ease; | |
margin-right: 5px; | |
} | |
#go-to-page-btn:hover, | |
#zoom-in-btn:hover, | |
#zoom-out-btn:hover { | |
background-color: #34495e; | |
} | |
#zoom-in-btn, | |
#zoom-out-btn { | |
width: 30px; | |
height: 30px; | |
font-size: 18px; | |
line-height: 1; | |
padding: 0; | |
} | |
#submit-btn { | |
width: 100%; | |
margin-bottom: 15px; | |
background-color: var(--primary-color); | |
color: white; | |
border: none; | |
border-radius: 3px; | |
cursor: pointer; | |
transition: background-color 0.3s ease; | |
} | |
#submit-btn:hover { | |
background-color: #2980b9; | |
} | |
#add-to-collection-btn, | |
#clear-collection-btn, | |
#export-csv-btn { | |
width: 100%; | |
margin-bottom: 10px; | |
background-color: var(--secondary-color); | |
color: white; | |
border: none; | |
border-radius: 3px; | |
cursor: pointer; | |
transition: background-color 0.3s ease; | |
} | |
#add-to-collection-btn:hover, | |
#clear-collection-btn:hover, | |
#export-csv-btn:hover { | |
background-color: #34495e; | |
} | |
/* Media query for small screens and high zoom levels */ | |
@media screen and (max-width: 768px), screen and (min-resolution: 2dppx) { | |
#top-bar { | |
flex-wrap: wrap; | |
} | |
#file-input, | |
#mode-toggle, | |
#page-navigation { | |
width: 100%; | |
margin-bottom: 10px; | |
} | |
#right-panel { | |
width: 100%; | |
position: static; | |
height: auto; | |
} | |
#left-panel { | |
width: 100%; | |
} | |
} | |
/* Add these new styles at the end of the file */ | |
.api-settings { | |
margin-bottom: 15px; | |
padding: 10px; | |
background: #f5f5f5; | |
border-radius: 5px; | |
} | |
.model-group { | |
margin-bottom: 10px; | |
} | |
#model-select { | |
width: 100%; | |
padding: 8px; | |
margin-bottom: 10px; | |
border: 1px solid #ddd; | |
border-radius: 4px; | |
} | |
#custom-model-inputs { | |
margin-top: 10px; | |
} | |
#custom-model-inputs input { | |
width: 100%; | |
padding: 8px; | |
margin-bottom: 5px; | |
border: 1px solid #ddd; | |
border-radius: 4px; | |
} | |
.default-api-key input { | |
width: 100%; | |
padding: 8px; | |
border: 1px solid #ddd; | |
border-radius: 4px; | |
} | |
#recent-files { | |
margin-top: 20px; | |
padding: 15px; | |
background-color: var(--bg-secondary); | |
border-radius: 5px; | |
border: 1px solid var(--border-color); | |
} | |
#recent-files h3 { | |
margin: 0 0 15px 0; | |
color: var(--text-primary); | |
font-size: 1.1em; | |
} | |
#file-list { | |
list-style: none; | |
padding: 0; | |
margin: 0; | |
} | |
#file-list li { | |
margin-bottom: 10px; | |
padding: 8px; | |
background-color: var(--flashcard-bg); | |
border-radius: 4px; | |
border: 1px solid var(--border-color); | |
transition: all 0.2s ease; | |
} | |
#file-list li:hover { | |
background-color: var(--bg-primary); | |
transform: translateX(5px); | |
} | |
#file-list a { | |
text-decoration: none; | |
color: var(--primary-color); | |
display: block; | |
width: 100%; | |
} | |
.dark-mode #file-list a { | |
color: #5dade2; /* Lighter blue for better visibility in dark mode */ | |
} | |
.dark-mode #file-list li:hover { | |
border-color: var(--text-secondary); | |
} | |
/* Date styling in recent files */ | |
#file-list .file-date { | |
color: var(--text-secondary); | |
font-size: 0.9em; | |
margin-left: 5px; | |
} | |
/* Dropdown styles for collection actions */ | |
.dropdown { | |
position: relative; | |
display: block; | |
margin-bottom: 15px; | |
width: 100%; | |
} | |
.dropbtn { | |
background-color: var(--secondary-color); | |
color: white; | |
padding: 12px 20px; | |
font-size: 14px; | |
border: none; | |
cursor: pointer; | |
border-radius: 5px; | |
width: 100%; | |
display: flex; | |
align-items: center; | |
justify-content: space-between; | |
transition: all 0.3s ease; | |
box-shadow: 0 2px 4px rgba(0,0,0,0.1); | |
} | |
/* Add a down arrow to the button */ | |
.dropbtn::after { | |
content: '▼'; | |
font-size: 10px; | |
margin-left: 8px; | |
transition: transform 0.3s ease; | |
} | |
/* Rotate arrow when dropdown is open */ | |
.dropbtn.active::after { | |
transform: rotate(180deg); | |
} | |
.dropbtn:hover { | |
background-color: #34495e; | |
box-shadow: 0 4px 8px rgba(0,0,0,0.2); | |
} | |
.dropdown-content { | |
display: none; | |
position: absolute; | |
background-color: white; | |
min-width: 100%; | |
box-shadow: 0 4px 12px rgba(0,0,0,0.15); | |
z-index: 1001; | |
border-radius: 5px; | |
margin-top: 5px; | |
border: 1px solid rgba(0,0,0,0.1); | |
overflow: hidden; | |
animation: dropdownFade 0.3s ease; | |
} | |
@keyframes dropdownFade { | |
from { | |
opacity: 0; | |
transform: translateY(-10px); | |
} | |
to { | |
opacity: 1; | |
transform: translateY(0); | |
} | |
} | |
.dropdown-content a { | |
color: var(--text-color); | |
padding: 12px 20px; | |
text-decoration: none; | |
display: block; | |
border-bottom: 1px solid rgba(0,0,0,0.05); | |
transition: all 0.2s ease; | |
font-size: 14px; | |
} | |
.dropdown-content a:last-child { | |
border-bottom: none; | |
} | |
.dropdown-content a:hover { | |
background-color: #f8f9fa; | |
padding-left: 25px; | |
color: var(--primary-color); | |
} | |
/* Class to show the dropdown */ | |
.show { | |
display: block; | |
} | |
/* Dark mode colors */ | |
.dark-mode { | |
--bg-primary: #1a1a1a; | |
--bg-secondary: #2d2d2d; | |
--text-primary: #ffffff; | |
--text-secondary: #e0e0e0; | |
--border-color: #404040; | |
--flashcard-bg: #333333; | |
--highlight-bg: rgba(52, 152, 219, 0.5); | |
--modal-bg: rgba(0, 0, 0, 0.7); | |
--modal-content-bg: #2d2d2d; | |
} | |
/* Add dark mode toggle button styles */ | |
#dark-mode-toggle { | |
cursor: pointer; | |
font-size: 24px; | |
margin: 0 15px; | |
transition: transform 0.3s ease; | |
} | |
#dark-mode-toggle:hover { | |
transform: scale(1.1); | |
} | |
/* Dark mode specific adjustments for the dropdown */ | |
.dark-mode .dropdown-content { | |
background-color: var(--bg-secondary); | |
border-color: var(--border-color); | |
} | |
.dark-mode .dropdown-content a { | |
color: var(--text-primary); | |
border-bottom-color: var(--border-color); | |
} | |
.dark-mode .dropdown-content a:hover { | |
background-color: var(--bg-primary); | |
} | |
/* Add this rule to invert PDF canvas colors when dark mode is on */ | |
.dark-mode #pdf-viewer canvas { | |
filter: invert(1) hue-rotate(180deg); | |
} | |