add dont ask again
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
Some checks failed
Deploy static content to Pages / deploy (push) Has been cancelled
This commit is contained in:
13
app.js
13
app.js
@@ -120,7 +120,8 @@ function renderTemplate(templateId) {
|
||||
width: 1.5,
|
||||
height: 25,
|
||||
displayValue: false,
|
||||
margin: 0
|
||||
margin: 0,
|
||||
background: 'transparent'
|
||||
});
|
||||
} catch (e) {
|
||||
console.error('Barcode generation failed:', e);
|
||||
@@ -289,9 +290,19 @@ function showSnackbar(message, type = '') {
|
||||
function setupDisclaimer() {
|
||||
const modal = document.getElementById('disclaimerModal');
|
||||
const closeBtn = document.getElementById('disclaimerClose');
|
||||
const dontAskCheckbox = document.getElementById('dontAskAgain');
|
||||
|
||||
// Check if user previously chose "don't ask again"
|
||||
if (localStorage.getItem('disclaimerAccepted') === 'true') {
|
||||
modal.classList.add('hidden');
|
||||
return;
|
||||
}
|
||||
|
||||
if (closeBtn && modal) {
|
||||
closeBtn.addEventListener('click', () => {
|
||||
if (dontAskCheckbox && dontAskCheckbox.checked) {
|
||||
localStorage.setItem('disclaimerAccepted', 'true');
|
||||
}
|
||||
modal.classList.add('hidden');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
<h2>Legal Disclaimer</h2>
|
||||
<p>For legal reasons, this is a <strong>joke</strong>.</p>
|
||||
<p class="modal-sub">This tool is for educational and entertainment purposes only. Do not use generated stickers for any official or fraudulent purposes.</p>
|
||||
<label class="checkbox-label">
|
||||
<input type="checkbox" id="dontAskAgain">
|
||||
<span>Don't show this again</span>
|
||||
</label>
|
||||
<button id="disclaimerClose" class="btn btn-primary">I Understand</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
18
styles.css
18
styles.css
@@ -73,6 +73,24 @@
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.modal .checkbox-label {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
margin-bottom: 16px;
|
||||
font-size: 0.875rem;
|
||||
cursor: pointer;
|
||||
color: var(--md-sys-color-on-surface-variant, #49454F);
|
||||
}
|
||||
|
||||
.modal .checkbox-label input[type="checkbox"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
cursor: pointer;
|
||||
accent-color: var(--md-sys-color-primary, #1976D2);
|
||||
}
|
||||
|
||||
.modal .btn {
|
||||
min-width: 160px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user