fix: prevent FAB button overflow on very small screens (iPhone 13 mini)

- Add media query for screens ≤400px (iPhone 13 mini = 375px)
- Reduce button size to 34px and icon size to 16px
- Recalculate 6-button positions with 6px gaps (234px total width)
- Ensures buttons stay centered within narrow viewports
This commit is contained in:
juanatsap
2025-12-06 09:57:09 +00:00
parent 404748afb5
commit e06f98d1d8
3 changed files with 467 additions and 1 deletions
@@ -379,6 +379,95 @@
}
}
/* ========================================
Very Small Screens: iPhone 13 mini (375px) and smaller
Tighter button spacing to prevent overflow
======================================== */
@media (max-width: 400px) {
/* Smaller buttons for very small screens */
.download-btn,
.print-friendly-btn,
.fixed-btn.contact-btn,
.shortcuts-btn,
.info-button,
.back-to-top,
.color-theme-switcher {
width: 34px !important;
height: 34px !important;
}
/* Smaller icons */
.download-btn iconify-icon,
.print-friendly-btn iconify-icon,
.fixed-btn.contact-btn iconify-icon,
.shortcuts-btn iconify-icon,
.info-button iconify-icon,
.back-to-top iconify-icon,
.color-theme-switcher iconify-icon {
width: 16px !important;
height: 16px !important;
font-size: 16px !important;
max-width: 16px !important;
}
/* REAL MOBILE DEVICES: 6 buttons tightly spaced */
/* 6 buttons * 34px + 5 gaps * 6px = 234px total, center offset = -117px */
.is-mobile-device .download-btn {
left: calc(50% - 117px) !important;
}
.is-mobile-device .print-friendly-btn {
left: calc(50% - 77px) !important;
}
.is-mobile-device .fixed-btn.contact-btn {
left: calc(50% - 37px) !important;
}
/* Theme switcher - fourth position: +3px from center */
.is-mobile-device .color-theme-switcher {
left: calc(50% + 3px) !important;
}
.is-mobile-device .info-button {
left: calc(50% + 43px) !important;
}
.is-mobile-device .back-to-top {
left: calc(50% + 83px) !important;
}
/* Non-mobile (desktop in mobile emulation): 7 buttons */
/* 7 buttons * 34px + 6 gaps * 6px = 274px total, center offset = -137px */
.download-btn {
left: calc(50% - 137px) !important;
}
.print-friendly-btn {
left: calc(50% - 97px) !important;
}
.fixed-btn.contact-btn {
left: calc(50% - 57px) !important;
}
.shortcuts-btn {
left: calc(50% - 17px) !important;
}
.color-theme-switcher {
left: calc(50% + 23px) !important;
}
.info-button {
left: calc(50% + 63px) !important;
}
.back-to-top {
left: calc(50% + 103px) !important;
}
}
/* ========================================
Mobile: Keep action bar visible (prevent hiding on scroll)
======================================== */
+1 -1
View File
File diff suppressed because one or more lines are too long