Spaces:
Runtime error
Runtime error
LE Quoc Dat
commited on
Commit
·
99e180d
1
Parent(s):
3ba429a
Refactor mode toggle and language selection UI interactions
Browse files- static/css/styles.css +1 -5
- templates/index.html +6 -10
static/css/styles.css
CHANGED
@@ -213,12 +213,8 @@ body {
|
|
213 |
}
|
214 |
|
215 |
#flashcards {
|
216 |
-
border: 1px solid #ddd;
|
217 |
-
padding: 10px;
|
218 |
margin-top: 10px;
|
219 |
-
|
220 |
-
border-radius: 3px;
|
221 |
-
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
222 |
}
|
223 |
|
224 |
.flashcard {
|
|
|
213 |
}
|
214 |
|
215 |
#flashcards {
|
|
|
|
|
216 |
margin-top: 10px;
|
217 |
+
width: 100%;
|
|
|
|
|
218 |
}
|
219 |
|
220 |
.flashcard {
|
templates/index.html
CHANGED
@@ -38,16 +38,16 @@
|
|
38 |
<textarea id="system-prompt" placeholder="Enter system prompt for flashcard generation"></textarea>
|
39 |
<textarea id="explain-prompt" placeholder="Enter system prompt for explanation" style="display: none;"></textarea>
|
40 |
<textarea id="language-prompt" placeholder="Enter system prompt for language mode"></textarea>
|
|
|
|
|
|
|
|
|
41 |
</div>
|
42 |
<div id="mode-toggle">
|
43 |
<button class="mode-btn selected" data-mode="flashcard">Flashcard</button>
|
44 |
<button class="mode-btn" data-mode="explain">Explain</button>
|
45 |
<button class="mode-btn" data-mode="language">Language</button>
|
46 |
</div>
|
47 |
-
<div id="language-buttons" style="display: none; margin-top: 10px;">
|
48 |
-
<button class="mode-btn" data-language="English">English</button>
|
49 |
-
<button class="mode-btn" data-language="French">French</button>
|
50 |
-
</div>
|
51 |
<button id="submit-btn" style="display: block;">Generate</button>
|
52 |
<div id="flashcards"></div>
|
53 |
<div class="dropdown" id="collection-dropdown">
|
@@ -821,14 +821,10 @@
|
|
821 |
document.getElementById('explain-prompt').style.display = mode === 'explain' ? 'block' : 'none';
|
822 |
document.getElementById('language-prompt').style.display = mode === 'language' ? 'block' : 'none';
|
823 |
submitBtn.style.display = mode === 'language' ? 'none' : 'block';
|
824 |
-
submitBtn.textContent = mode === 'flashcard' ? 'Generate Flashcards' : 'Generate Explanation';
|
825 |
|
826 |
-
|
827 |
-
const savedLanguage = loadLanguageChoice();
|
828 |
-
setLanguageButton(savedLanguage);
|
829 |
-
}
|
830 |
|
831 |
-
// Update
|
832 |
updateAddToCollectionButtonText();
|
833 |
updateExportButtonVisibility();
|
834 |
});
|
|
|
38 |
<textarea id="system-prompt" placeholder="Enter system prompt for flashcard generation"></textarea>
|
39 |
<textarea id="explain-prompt" placeholder="Enter system prompt for explanation" style="display: none;"></textarea>
|
40 |
<textarea id="language-prompt" placeholder="Enter system prompt for language mode"></textarea>
|
41 |
+
<div id="language-buttons" style="display: none; margin-top: 10px;">
|
42 |
+
<button class="mode-btn" data-language="English">English</button>
|
43 |
+
<button class="mode-btn" data-language="French">French</button>
|
44 |
+
</div>
|
45 |
</div>
|
46 |
<div id="mode-toggle">
|
47 |
<button class="mode-btn selected" data-mode="flashcard">Flashcard</button>
|
48 |
<button class="mode-btn" data-mode="explain">Explain</button>
|
49 |
<button class="mode-btn" data-mode="language">Language</button>
|
50 |
</div>
|
|
|
|
|
|
|
|
|
51 |
<button id="submit-btn" style="display: block;">Generate</button>
|
52 |
<div id="flashcards"></div>
|
53 |
<div class="dropdown" id="collection-dropdown">
|
|
|
821 |
document.getElementById('explain-prompt').style.display = mode === 'explain' ? 'block' : 'none';
|
822 |
document.getElementById('language-prompt').style.display = mode === 'language' ? 'block' : 'none';
|
823 |
submitBtn.style.display = mode === 'language' ? 'none' : 'block';
|
|
|
824 |
|
825 |
+
// The settings panel will not auto–open now. Users must open it manually via the settings icon.
|
|
|
|
|
|
|
826 |
|
827 |
+
// Update the collection button text and export button visibility as before
|
828 |
updateAddToCollectionButtonText();
|
829 |
updateExportButtonVisibility();
|
830 |
});
|