Skip to content

Commit 60129e2

Browse files
authored
Merge pull request #17 from CodeBoxxTechSchool/ml/mobile-enhancement
Ml/mobile enhancement
2 parents 4055ab0 + 22c5d82 commit 60129e2

6 files changed

Lines changed: 67 additions & 20 deletions

File tree

src/pages/Home.jsx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,12 @@ function ScriptTitle({ index, children, dark }) {
181181
);
182182
}
183183

184-
function SectionHead({ eyebrow, index, title, lede, children }) {
184+
function SectionHead({ eyebrow, index, title, lede, children, badge }) {
185185
return (
186186
<div className="section-head">
187187
<div className="d-flex flex-column gap-3">
188188
<ScriptTitle index={index}>{eyebrow}</ScriptTitle>
189+
{badge}
189190
<h2 className="h2">{title}</h2>
190191
{lede ? <p className="lede">{lede}</p> : null}
191192
</div>
@@ -242,21 +243,22 @@ function DivisionBand({
242243
intro,
243244
left,
244245
aside,
246+
badge,
245247
}) {
246248
return (
247249
<section id={id} className={'sect' + (alt ? ' sect-alt' : '')}>
248250
<div className="wrap">
249251
{aside ? (
250252
<div className="d-flex gap-5 align-items-start justify-content-between flex-wrap">
251253
<div className="division-main">
252-
<SectionHead index={index} eyebrow={role} title={name} lede={lede} />
254+
<SectionHead index={index} eyebrow={role} title={name} lede={lede} badge={badge} />
253255
{intro}
254256
</div>
255257
{aside}
256258
</div>
257259
) : (
258260
<React.Fragment>
259-
<SectionHead index={index} eyebrow={role} title={name} lede={lede} />
261+
<SectionHead index={index} eyebrow={role} title={name} lede={lede} badge={badge} />
260262
{intro}
261263
</React.Fragment>
262264
)}
@@ -848,6 +850,7 @@ function Academy({ onEnroll }) {
848850
index="05"
849851
role={t('home.academy.role')}
850852
name={t('home.academy.name')}
853+
badge={<Badge bg="brand">{t('home.academy.nextIntake')}</Badge>}
851854
after={
852855
<React.Fragment>
853856
<IntakeCalendar onEnroll={onEnroll} />
@@ -888,12 +891,9 @@ function Academy({ onEnroll }) {
888891
}
889892
>
890893
<div className="panel panel-sticky">
891-
<div className="d-flex justify-content-between align-items-center gap-3">
892-
<span className="kicker">
893-
{topics[active].kicker || t('home.academy.cohortStructureLabel')}
894-
</span>
895-
<Badge bg="brand">{t('home.academy.nextIntake')}</Badge>
896-
</div>
894+
<span className="kicker">
895+
{topics[active].kicker || t('home.academy.cohortStructureLabel')}
896+
</span>
897897
<p className="pbody">{topics[active].detail}</p>
898898
{topics[active].people ? (
899899
<div className="people-grid people-grid-4">

src/styles/_chrome.scss

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,37 @@
132132
.nav-item {
133133
height: auto;
134134
width: 100%;
135-
padding: 12px 0;
135+
flex-direction: column;
136+
align-items: stretch;
137+
padding: 0;
138+
139+
&:not(:last-child) {
140+
box-shadow: inset 0 -1px 0 0 v.$ui-slate-200;
141+
}
142+
143+
> a {
144+
width: 100%;
145+
justify-content: space-between;
146+
padding: 16px 0;
147+
}
136148
}
137149

138150
.nav-dropdown {
139151
position: static;
140-
margin: 8px 0 0;
152+
width: 100%;
153+
min-width: 0;
154+
margin: 0 0 12px;
155+
padding: 0;
156+
border-radius: 0;
141157
box-shadow: none;
142-
padding-left: 12px;
158+
background: none;
159+
160+
a {
161+
width: 100%;
162+
padding: 12px 16px;
163+
border-radius: v.$radius-md;
164+
color: v.$ui-slate-500;
165+
}
143166
}
144167
}
145168

src/styles/_components.scss

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
position: relative;
226226
width: 100%;
227227
min-height: 560px;
228-
padding: 64px 48px;
228+
padding: 64px 30px;
229229
display: flex;
230230
flex-direction: column;
231231
justify-content: space-between;
@@ -239,11 +239,20 @@
239239
h1 {
240240
margin: 0;
241241
max-width: 900px;
242-
font-size: v.$text-hero;
242+
font-size: v.$text-specimen;
243243
font-weight: v.$weight-black;
244-
line-height: v.$leading-hero;
244+
line-height: v.$leading-mobile-hero;
245245
color: v.$neutral-0;
246246
}
247+
248+
@media (min-width: 768px) {
249+
padding: 64px 48px;
250+
251+
h1 {
252+
font-size: v.$text-hero;
253+
line-height: v.$leading-hero;
254+
}
255+
}
247256
}
248257

249258
.hero-logo {

src/styles/_home.scss

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
letter-spacing: 0.5px;
7373
text-transform: uppercase;
7474
color: v.$ui-slate-900;
75+
overflow-wrap: break-word;
7576

7677
&.active {
7778
color: v.$blue-500;
@@ -305,7 +306,7 @@
305306
// media query to collapse to 1 column on narrow viewports.
306307
.calendar-cols {
307308
display: grid;
308-
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
309+
grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
309310
}
310311
// One row per Sanity `program` document that has intake rows — data-driven, not
311312
// fixed at 2, same spirit as `.calendar-cols`.
@@ -325,6 +326,10 @@
325326
background: v.$navy-500;
326327
border-radius: v.$radius-xl;
327328
padding: 48px;
329+
330+
@media (max-width: v.$breakpoint-md) {
331+
padding: 24px;
332+
}
328333
}
329334
.calendar-head {
330335
display: flex;
@@ -379,6 +384,7 @@
379384
display: flex;
380385
align-items: baseline;
381386
justify-content: space-between;
387+
flex-wrap: wrap;
382388
gap: 16px;
383389
}
384390
.calendar-row-left {
@@ -391,6 +397,12 @@
391397
align-items: center;
392398
gap: 12px;
393399
}
400+
@media (max-width: v.$breakpoint-md) {
401+
.calendar-row-left,
402+
.calendar-row-right {
403+
flex: 1 1 100%;
404+
}
405+
}
394406
.calendar-date {
395407
font-size: v.$text-h3;
396408
font-weight: v.$weight-semibold;

src/styles/_layout.scss

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212

1313
.grid2 {
1414
display: grid;
15-
grid-template-columns: 1fr 1fr;
15+
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
1616
gap: 24px;
1717
align-items: start;
1818
}
1919
.grid3 {
2020
display: grid;
21-
grid-template-columns: repeat(3, 1fr);
21+
grid-template-columns: repeat(3, minmax(0, 1fr));
2222
gap: 24px;
2323
}
2424
.grid4 {
2525
display: grid;
26-
grid-template-columns: repeat(4, 1fr);
26+
grid-template-columns: repeat(4, minmax(0, 1fr));
2727
gap: 24px;
2828
}
2929

@@ -37,9 +37,11 @@
3737
.grid2,
3838
.grid3,
3939
.grid4 {
40-
grid-template-columns: 1fr;
40+
grid-template-columns: minmax(0, 1fr);
4141
}
4242
.sect {
4343
padding: 64px 0;
44+
width: 100%;
45+
overflow: hidden;
4446
}
4547
}

src/styles/_variables.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ $text-nano: 10px;
165165

166166
$leading-tight: 100%;
167167
$leading-hero: 72px;
168+
$leading-mobile-hero: 54px;
168169
$leading-body: 20px;
169170

170171
$tracking-eyebrow: 1px;

0 commit comments

Comments
 (0)