Skip to content

Commit 3f570c5

Browse files
committed
Added help about V1, V2, V3
(cherry picked from commit 0306721)
1 parent eac71a2 commit 3f570c5

File tree

3 files changed

+74
-0
lines changed

3 files changed

+74
-0
lines changed

assets/script.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,40 @@ const fileButtonLex = document.getElementById('file-button-lex')
2222
const fileButton = document.getElementById('file-button')
2323
const dopSettings = document.getElementById('dop-settings-label')
2424

25+
// Help system
26+
const helpSection = document.querySelector('.help-section');
27+
const helpTitle = document.getElementById('help-title');
28+
const helpText = document.getElementById('help-text');
29+
30+
function showHelp(title, text) {
31+
helpTitle.textContent = title;
32+
helpText.textContent = text;
33+
helpSection.classList.add('show');
34+
}
35+
36+
function hideHelp() {
37+
helpSection.classList.remove('show');
38+
}
39+
40+
// Add help text for period replacement modes
41+
document.getElementById('pointstype').addEventListener('click', () => {
42+
const mode = document.getElementById('pointstype').textContent;
43+
const helpTexts = {
44+
'V1': 'Replaces all periods in the text with the selected character.',
45+
'V2': 'Preserves periods at line endings, but replaces all other periods with the selected character.',
46+
'V3': 'Preserves periods at line endings, and replaces only periods followed by spaces with the selected character plus a space.'
47+
};
48+
showHelp('Period Replacement Mode: ' + mode, helpTexts[mode]);
49+
});
50+
51+
// Hide help when clicking outside
52+
document.addEventListener('click', (e) => {
53+
if (!e.target.closest('.help-section') &&
54+
!e.target.closest('#pointstype')) {
55+
hideHelp();
56+
}
57+
});
58+
2559
saveButton.addEventListener('click', e => start())
2660
dopSettings.addEventListener('click', e => change_dopSettings())
2761
//save_alloneButton.addEventListener('click', e => start_allone())

assets/styles.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,4 +229,36 @@ rowspace {
229229
#is-lexx {
230230
color: inherit;
231231
text-decoration: none;
232+
}
233+
234+
.help-section {
235+
position: fixed;
236+
bottom: 0;
237+
left: 0;
238+
right: 0;
239+
background-color: #333;
240+
padding: 1rem;
241+
transform: translateY(100%);
242+
transition: transform 0.3s ease-in-out;
243+
}
244+
245+
.help-section.show {
246+
transform: translateY(0);
247+
}
248+
249+
.help-content {
250+
max-width: 800px;
251+
margin: 0 auto;
252+
color: #fff;
253+
}
254+
255+
.help-content h3 {
256+
margin: 0 0 0.5rem 0;
257+
color: #bbb;
258+
}
259+
260+
.help-content p {
261+
margin: 0;
262+
font-size: 1rem;
263+
line-height: 1.4;
232264
}

index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,14 @@
367367
<br>
368368
<label id="stat-label"><output id="stat-info"></output> <output style="float: right;" id="stat-str">0 / 0</output></label>
369369
</section>
370+
371+
<section class="help-section">
372+
<div id="help-content" class="help-content">
373+
<h3 id="help-title"></h3>
374+
<p id="help-text"></p>
375+
</div>
376+
</section>
377+
370378
<script src="./assets/jszip.min.js"></script>
371379
<script src="./assets/texts_converter.js"></script>
372380
<script src="./assets/processing_file.js"></script>

0 commit comments

Comments
 (0)