Improve mobile responsiveness and accessibility

Enhanced CSS for better mobile experience: added media queries for various screen sizes, improved touch targets, font sizes, and QR code scaling. Updated index.html with mobile meta tags and icons. Added accessibility features for reduced motion.
This commit is contained in:
Michal Vrba
2025-12-19 15:49:40 +01:00
parent db1ebefcf5
commit 5d1b535f82
3 changed files with 388 additions and 5 deletions
+271 -3
View File
@@ -45,6 +45,7 @@
-webkit-text-fill-color: transparent;
background-clip: text;
margin: 0 0 8px 0;
line-height: 1.2;
}
.qrpay-subtitle {
@@ -52,6 +53,7 @@
font-size: 1.1rem;
margin: 0;
font-weight: 400;
line-height: 1.4;
}
/* Form Styles */
@@ -81,6 +83,8 @@
font-size: 1rem;
transition: all 0.3s ease;
background: #ffffff;
width: 100%;
box-sizing: border-box;
}
.form-control:focus {
@@ -120,6 +124,8 @@
justify-content: center;
gap: 8px;
box-shadow: 0 4px 12px rgba(45, 90, 39, 0.3);
width: 100%;
min-height: 56px;
}
.btn-generate:hover:not(:disabled) {
@@ -168,12 +174,14 @@
font-weight: 700;
color: #2d5a27;
margin: 0 0 8px 0;
line-height: 1.2;
}
.qrcode-header p {
color: #6b7280;
font-size: 1.1rem;
margin: 0;
line-height: 1.4;
}
.qrcode-display {
@@ -188,6 +196,9 @@
width: 280px;
height: 280px;
border-radius: 8px;
max-width: 100%;
height: auto;
aspect-ratio: 1;
}
/* Payment Details */
@@ -213,6 +224,7 @@
.detail-label {
font-weight: 600;
color: #374151;
white-space: nowrap;
}
.detail-value {
@@ -239,6 +251,7 @@
justify-content: center;
gap: 8px;
width: 100%;
min-height: 56px;
}
.btn-back:hover {
@@ -280,39 +293,145 @@
}
}
/* Responsive Design */
/* Enhanced Responsive Design */
/* Large tablets and small desktops */
@media (max-width: 768px) {
.qrpay-container {
padding: 16px;
align-items: flex-start;
padding-top: 32px;
}
.qrpay-card,
.qrcode-container {
padding: 32px;
border-radius: 20px;
}
.qrpay-title {
font-size: 2.25rem;
}
.qrcode-display img {
width: 260px;
height: 260px;
}
.form-control {
font-size: 16px; /* Prevents zoom on iOS */
}
}
/* Portrait tablets and large phones */
@media (max-width: 640px) {
.qrpay-container {
padding: 12px;
min-height: auto;
padding-top: 20px;
padding-bottom: 20px;
}
.qrpay-card,
.qrcode-container {
padding: 24px;
margin: 16px;
border-radius: 16px;
margin: 0;
}
.qrpay-header {
margin-bottom: 32px;
}
.qrpay-logo img {
width: 70px;
height: 70px;
}
.qrpay-title {
font-size: 2rem;
}
.qrpay-subtitle {
font-size: 1rem;
}
.qrcode-header h2 {
font-size: 1.75rem;
}
.qrcode-header p {
font-size: 1rem;
}
.qrcode-display {
padding: 20px;
margin-bottom: 24px;
}
.qrcode-display img {
width: 240px;
height: 240px;
}
.payment-details {
padding: 20px;
margin-bottom: 24px;
}
.detail-row {
flex-direction: column;
align-items: flex-start;
gap: 4px;
padding: 16px 0;
}
.detail-label {
font-size: 0.9rem;
}
.detail-value {
max-width: 100%;
text-align: left;
font-size: 0.95rem;
font-weight: 600;
}
.form-group {
gap: 6px;
}
.form-label {
font-size: 0.9rem;
}
.btn-generate,
.btn-back {
padding: 16px 24px;
font-size: 1rem;
}
}
/* Mobile phones in portrait */
@media (max-width: 480px) {
.qrpay-container {
padding: 12px;
padding: 8px;
padding-top: 16px;
padding-bottom: 16px;
}
.qrpay-card,
.qrcode-container {
padding: 20px;
border-radius: 12px;
}
.qrpay-header {
margin-bottom: 24px;
}
.qrpay-logo {
margin-bottom: 16px;
}
.qrpay-logo img {
@@ -324,8 +443,157 @@
font-size: 1.75rem;
}
.qrpay-subtitle {
font-size: 0.95rem;
}
.qrcode-header {
margin-bottom: 24px;
}
.qrcode-header h2 {
font-size: 1.5rem;
}
.qrcode-header p {
font-size: 0.95rem;
}
.qrcode-display {
padding: 16px;
margin-bottom: 20px;
}
.qrcode-display img {
width: 200px;
height: 200px;
}
.payment-details {
padding: 16px;
margin-bottom: 20px;
}
.detail-row {
padding: 12px 0;
}
.qrpay-form {
gap: 20px;
}
.form-control {
padding: 14px 16px;
font-size: 16px;
}
.btn-generate,
.btn-back {
padding: 14px 20px;
min-height: 52px;
}
}
/* Very small phones */
@media (max-width: 360px) {
.qrpay-container {
padding: 4px;
padding-top: 12px;
padding-bottom: 12px;
}
.qrpay-card,
.qrcode-container {
padding: 16px;
}
.qrpay-title {
font-size: 1.5rem;
}
.qrcode-display img {
width: 180px;
height: 180px;
}
.form-control {
padding: 12px 14px;
}
}
/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
.qrpay-container {
align-items: flex-start;
padding-top: 16px;
padding-bottom: 16px;
}
.qrpay-header {
margin-bottom: 20px;
}
.qrpay-logo img {
width: 50px;
height: 50px;
}
.qrpay-title {
font-size: 1.5rem;
}
.qrcode-header {
margin-bottom: 20px;
}
.qrcode-display {
margin-bottom: 20px;
}
.qrcode-display img {
width: 160px;
height: 160px;
}
.payment-details {
margin-bottom: 20px;
}
}
/* Touch improvements for mobile */
@media (max-width: 768px) {
.btn-generate:hover,
.btn-back:hover {
transform: none; /* Disable hover transforms on mobile */
}
.form-control:focus {
transform: none; /* Disable focus transforms on mobile for better UX */
}
/* Larger touch targets */
.btn-generate,
.btn-back {
min-height: 48px; /* WCAG recommended minimum touch target */
}
}
/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
.qrpay-card,
.qrcode-container {
animation: none;
}
.validation-message {
animation: none;
}
.spinner {
animation: none;
}
* {
transition: none !important;
}
}