Skip to content

Commit 12c24cb

Browse files
authored
Merge pull request #1 from skfd/copilot/fix-mobile-layout-issues
Mobile responsive layout
2 parents f8dc232 + 4af1ff6 commit 12c24cb

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

style.css

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,3 +667,121 @@ main {
667667
::-webkit-scrollbar-track { background: transparent; }
668668
::-webkit-scrollbar-thumb { background: #333344; border-radius: 3px; }
669669
::-webkit-scrollbar-thumb:hover { background: #444466; }
670+
671+
/* ── Mobile Responsive ──────────────────────────────── */
672+
@media (max-width: 640px) {
673+
/* Switch to flex-column so main fills exactly the space below the header,
674+
regardless of how tall the header grows when controls wrap. */
675+
html, body {
676+
height: 100vh;
677+
height: 100dvh; /* respect mobile browser chrome */
678+
display: flex;
679+
flex-direction: column;
680+
}
681+
682+
main {
683+
flex: 1;
684+
height: auto;
685+
overflow: hidden;
686+
}
687+
688+
header {
689+
height: auto;
690+
flex-shrink: 0;
691+
flex-wrap: wrap;
692+
padding: 0.35rem 0.5rem;
693+
row-gap: 0.2rem;
694+
}
695+
696+
/* hide purely decorative / secondary elements */
697+
.header-ornament,
698+
.header-center-divider,
699+
.header-sep,
700+
.subtitle {
701+
display: none;
702+
}
703+
704+
/* row 1: title (left) + links (right) */
705+
.header-left {
706+
order: 1;
707+
flex: 1;
708+
padding: 0;
709+
}
710+
711+
.header-right-links {
712+
order: 2;
713+
margin-right: 0;
714+
flex-shrink: 0;
715+
}
716+
717+
/* row 2: all controls, centered */
718+
.header-controls {
719+
order: 3;
720+
width: 100%;
721+
justify-content: center;
722+
flex-wrap: wrap;
723+
gap: 0.35rem;
724+
padding-bottom: 0.2rem;
725+
}
726+
727+
.resource-counter .res-item {
728+
padding: 0.15rem 0.3rem;
729+
}
730+
731+
#book-select {
732+
max-width: 8rem;
733+
font-size: 0.65rem;
734+
padding: 0.22rem 0.35rem;
735+
}
736+
737+
.transport {
738+
gap: 0.15rem;
739+
}
740+
741+
.transport button {
742+
padding: 0.2rem 0.4rem;
743+
font-size: 0.9rem;
744+
}
745+
746+
#speed-display {
747+
min-width: 1.8rem;
748+
font-size: 0.75rem;
749+
}
750+
751+
/* reduce side padding in the reading area */
752+
#text-panel {
753+
padding: 1rem 0.75rem;
754+
}
755+
756+
/* orbs: anchor to right edge instead of off-screen right of text column */
757+
.orb-anchor {
758+
left: auto;
759+
right: 0.5rem;
760+
}
761+
762+
/* tooltip: open to the left of the orb (orb is at right edge) */
763+
.orb .orb-tooltip {
764+
right: calc(100% + 0.6rem);
765+
left: auto;
766+
max-width: min(16rem, calc(100vw - 4rem));
767+
}
768+
769+
/* intro box: constrain to viewport width */
770+
.intro-box {
771+
width: calc(100vw - 2rem);
772+
padding: 2rem 1.2rem;
773+
}
774+
}
775+
776+
/* ── Very small phones (≤400px) ─────────────────────── */
777+
@media (max-width: 400px) {
778+
.header-source-link {
779+
font-size: 0.6rem;
780+
padding: 0.2rem 0.4rem;
781+
}
782+
783+
.transport button {
784+
padding: 0.18rem 0.3rem;
785+
font-size: 0.85rem;
786+
}
787+
}

0 commit comments

Comments
 (0)