reposnsive design

Enhance responsive design and mobile usability

Major CSS overhaul for improved responsiveness and accessibility:
- Add .main-container for full viewport coverage
- Refactor Home.razor.css with extensive media queries for tablet, desktop, mobile, and print
- Improve input, button, and feature section layouts
- Add word-break/overflow handling for long text
- Support high-DPI, reduced motion, and print styles
- Update app.css for better font rendering, touch targets, and mobile performance
These changes ensure a more user-friendly experience across all devices.
This commit is contained in:
Michal Vrba
2025-12-14 12:44:00 +01:00
parent 695a0424bc
commit 1013e3e133
3 changed files with 396 additions and 41 deletions
+8
View File
@@ -3,3 +3,11 @@
<div class="main-container">
@Body
</div>
<style>
.main-container {
width: 100%;
min-height: 100vh;
min-height: 100dvh;
}
</style>
+314 -34
View File
@@ -1,3 +1,29 @@
/* Page Background and Container */
.page-background {
background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #1e88e5 100%);
min-height: 100vh;
min-height: 100dvh; /* Dynamic viewport height for mobile */
padding: 20px 10px 40px 10px; /* Add bottom padding for scroll space */
display: block; /* Changed from flex to block for better scroll behavior */
position: relative;
overflow-x: hidden;
overflow-y: auto;
width: 100%;
}
/* Music notes positioning */
.music-notes {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
height: 100dvh;
pointer-events: none;
z-index: 1;
overflow: hidden;
}
.hero-section {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
@@ -7,7 +33,12 @@
text-align: center;
max-width: 600px;
width: 100%;
margin: 0 auto;
margin: 20px auto; /* Center horizontally */
position: relative;
z-index: 10;
/* Ensure content can expand vertically */
min-height: auto;
max-height: none;
}
.logo-container {
@@ -31,6 +62,7 @@
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
line-height: 1.2;
}
.app-subtitle {
@@ -38,6 +70,7 @@
color: #718096;
margin: 0 0 30px 0;
font-weight: 400;
line-height: 1.4;
}
/* Session info styling */
@@ -53,6 +86,7 @@
font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
opacity: 0.8;
transition: opacity 0.2s ease;
word-break: break-all;
}
.session-info:hover {
@@ -79,6 +113,8 @@
color: #2d3748;
transition: all 0.3s ease;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
width: 100%;
box-sizing: border-box;
}
.url-input:focus {
@@ -107,6 +143,8 @@
align-items: center;
justify-content: center;
gap: 10px;
width: 100%;
box-sizing: border-box;
}
.download-btn:hover:not(:disabled) {
@@ -216,6 +254,7 @@
margin-top: 20px;
text-align: center;
color: #0369a1;
word-wrap: break-word;
}
.output-message p {
@@ -229,6 +268,7 @@
justify-content: center;
gap: 40px;
flex-wrap: wrap;
margin-bottom: 20px;
}
.feature {
@@ -237,6 +277,7 @@
align-items: center;
gap: 8px;
color: #6b7280;
flex-shrink: 0;
}
.feature-icon {
@@ -249,9 +290,10 @@
font-weight: 500;
font-size: 0.9rem;
color: #4b5563;
text-align: center;
}
/* Progress styles moved from Home.razor */
/* Progress styles */
.progress-container {
margin-top: 20px;
width: 100%;
@@ -292,6 +334,7 @@
font-size: 14px;
color: #666;
font-weight: 500;
word-wrap: break-word;
}
.progress-container.with-video-details .progress-text {
@@ -312,6 +355,7 @@
.download-links-section {
margin-top: 30px;
margin-bottom: 30px; /* Add bottom margin for scroll space */
width: 100%;
max-width: 600px;
}
@@ -328,6 +372,8 @@
display: flex;
flex-direction: column;
gap: 12px;
/* Add bottom padding to ensure last item is fully visible */
padding-bottom: 20px;
}
.download-item {
@@ -352,12 +398,15 @@
display: flex;
flex-direction: column;
gap: 4px;
min-width: 0;
}
.download-title {
font-weight: 600;
color: #333;
font-size: 14px;
word-wrap: break-word;
overflow-wrap: break-word;
}
.download-date {
@@ -378,6 +427,7 @@
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.download-link-btn:hover {
@@ -465,6 +515,7 @@
margin-bottom: 12px;
line-height: 1.4;
word-wrap: break-word;
overflow-wrap: break-word;
}
.error-message {
@@ -475,6 +526,7 @@
border-radius: 8px;
color: #c62828;
text-align: center;
word-wrap: break-word;
}
.conversion-status {
@@ -508,7 +560,7 @@
@keyframes pulse {
0%, 100% {
transform: scale(1);
box-shadow: 0 0 0 0 rgba(30, 136, 229, 0.4);
box-shadow: 0 0 0 0 rgba(30, 136,229, 0.4);
}
50% {
transform: scale(1.02);
@@ -527,61 +579,161 @@
}
}
@media (min-width: 640px) {
/* Responsive Design - Tablet */
@media (min-width: 640px) and (max-width: 1024px) {
.hero-section {
padding: 35px 25px;
margin: 15px;
}
.input-container {
flex-direction: row;
align-items: stretch;
gap: 12px;
}
.url-input {
flex: 1;
font-size: 1rem;
padding: 16px 20px;
min-width: 0;
}
.download-btn {
min-width: 180px;
}
}
@media (max-width: 639px) {
.hero-section {
padding: 30px 20px;
margin: 10px;
}
.app-title {
font-size: 2rem;
min-width: 140px;
max-width: 180px;
flex-shrink: 0;
font-size: 0.95rem;
padding: 16px 20px;
}
.features {
gap: 30px;
gap: 35px;
}
}
/* Responsive Design - Large Desktop */
@media (min-width: 640px) {
.input-container {
flex-direction: row;
align-items: stretch;
gap: 15px;
}
.url-input {
flex: 1;
min-width: 0; /* Allows flex item to shrink below its content size */
}
.download-btn {
min-width: 160px;
max-width: 200px;
flex-shrink: 0;
padding: 18px 24px;
font-size: 1rem;
}
}
/* Responsive Design - Mobile */
@media (max-width: 639px) {
.page-background {
padding: 10px 5px 40px 5px; /* Ensure bottom padding for scroll */
min-height: 100vh;
min-height: 100dvh;
}
.hero-section {
padding: 25px 15px;
margin: 5px auto; /* Ensure centering */
border-radius: 16px;
min-width: 0;
}
.logo {
width: 100px;
height: 100px;
}
.app-title {
font-size: 1.8rem;
line-height: 1.1;
}
.app-subtitle {
font-size: 1rem;
line-height: 1.3;
}
.url-input {
font-size: 16px; /* Prevent zoom on iOS */
padding: 16px 20px;
}
.download-btn {
font-size: 1rem;
padding: 16px 24px;
}
.features {
gap: 25px;
justify-content: space-around;
}
.feature {
min-width: 100px;
min-width: auto;
flex: 1;
max-width: 80px;
}
.feature-icon {
font-size: 1.5rem;
}
.feature span:last-child {
font-size: 0.8rem;
}
.session-info {
font-size: 0.8rem;
font-size: 0.75rem;
padding: 6px 12px;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
}
.download-all-btn {
min-width: 180px;
padding: 14px 20px;
min-width: 160px;
padding: 12px 16px;
font-size: 0.9rem;
}
.zip-info {
font-size: 0.8rem;
font-size: 0.75rem;
}
.download-item {
flex-direction: column;
align-items: stretch;
gap: 12px;
padding: 12px;
}
.download-info {
text-align: left;
}
.download-link-btn {
align-self: stretch;
justify-content: center;
padding: 10px 16px;
}
}
/* Responsive Design */
@media (max-width: 768px) {
.video-info-card {
flex-direction: column;
align-items: center;
text-align: center;
padding: 15px;
gap: 15px;
}
.thumbnail-img {
@@ -589,14 +741,59 @@
height: 112px;
}
.video-meta {
justify-content: center;
.progress-text {
font-size: 13px;
}
.video-title {
font-size: 15px;
}
}
@media (max-width: 480px) {
.video-info-card {
padding: 15px;
/* Extra Small Mobile Devices */
@media (max-width: 360px) {
.hero-section {
padding: 20px 12px;
margin: 3px;
}
.app-title {
font-size: 1.6rem;
}
.app-subtitle {
font-size: 0.9rem;
}
.logo {
width: 80px;
height: 80px;
}
.url-input {
padding: 14px 16px;
font-size: 16px;
}
.download-btn {
padding: 14px 20px;
font-size: 0.9rem;
}
.features {
gap: 20px;
}
.feature {
max-width: 70px;
}
.feature-icon {
font-size: 1.3rem;
}
.feature span:last-child {
font-size: 0.75rem;
}
.thumbnail-img {
@@ -604,9 +801,92 @@
height: 90px;
}
.video-meta {
flex-direction: column;
align-items: center;
gap: 8px;
.download-all-btn {
min-width: 140px;
padding: 10px 14px;
font-size: 0.85rem;
}
}
/* Landscape Mobile Orientation */
@media (max-width: 844px) and (orientation: landscape) {
.page-background {
padding: 15px 10px;
}
.hero-section {
padding: 25px 20px;
margin: 10px auto;
}
.logo-container {
margin-bottom: 25px;
}
.logo {
width: 80px;
height: 80px;
}
.app-title {
font-size: 2rem;
}
.download-form {
margin-bottom: 25px;
}
.features {
margin-bottom: 15px;
}
}
/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
.hero-section {
backdrop-filter: blur(20px);
}
}
/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
.hero-section,
.download-btn,
.download-item,
.video-info-section,
.progress-fill,
.btn-icon,
.download-all-btn,
.download-link-btn {
animation: none !important;
transition: none !important;
}
.processing-spinner {
animation: none !important;
}
}
/* Print Styles */
@media print {
.page-background {
background: white !important;
padding: 20px;
}
.hero-section {
background: white !important;
box-shadow: none !important;
border: 1px solid #ccc;
}
.music-notes {
display: none !important;
}
.download-btn,
.download-link-btn,
.download-all-btn {
display: none !important;
}
}
File diff suppressed because one or more lines are too long