UX: Improve FG scan success notification styling

- Changed notification to small popup on right side of screen
- Added smooth slide-in/slide-out animations
- Positioned at top-right (30px from edges)
- Higher z-index (9999) to appear above all content
- Improved shadow and padding for better visibility
- Only affects FG scan page
This commit is contained in:
Quality App Developer
2026-01-27 18:01:52 +02:00
parent 59e82c0209
commit e6ff40184a

View File

@@ -224,23 +224,56 @@ if (shouldClearAfterSubmit === 'true' && cpCodeInput && oc1CodeInput && oc2CodeI
cpCodeInput.focus();
}
// Add visual feedback
// Add visual feedback - small notification on right side
const successIndicator = document.createElement('div');
successIndicator.style.cssText = `
position: fixed;
top: 20px;
right: 20px;
top: 30px;
right: 30px;
background: #4CAF50;
color: white;
padding: 10px 20px;
border-radius: 5px;
z-index: 1000;
box-shadow: 0 2px 10px rgba(0,0,0,0.2);
font-weight: bold;
padding: 12px 20px;
border-radius: 6px;
z-index: 9999;
box-shadow: 0 4px 12px rgba(0,0,0,0.25);
font-weight: 600;
font-size: 14px;
white-space: nowrap;
animation: slideInRight 0.3s ease-out, slideOutRight 0.3s ease-in 2.7s forwards;
`;
successIndicator.textContent = '✅ Scan recorded! Ready for next scan';
document.body.appendChild(successIndicator);
// Add keyframe animation if not already added
if (!document.getElementById('fg-scan-notification-styles')) {
const style = document.createElement('style');
style.id = 'fg-scan-notification-styles';
style.textContent = `
@keyframes slideInRight {
from {
transform: translateX(400px);
opacity: 0;
}
to {
transform: translateX(0);
opacity: 1;
}
}
@keyframes slideOutRight {
from {
transform: translateX(0);
opacity: 1;
}
to {
transform: translateX(400px);
opacity: 0;
}
}
`;
document.head.appendChild(style);
}
// Remove success indicator after 3 seconds
setTimeout(function() {
if (successIndicator.parentNode) {