Skip to content

Commit b890d27

Browse files
committed
fix(site): dock Ask tutor below code lab so code is not obscured
The hero mockup's Ask tutor popup was absolutely positioned over the code lab panel, truncating the right edge of the code and 'Ran cleanly' output lines. - Move the chat card into normal flow inside .mock__main, stacked below the lab with margin-top - Drop position: absolute / right / bottom on .mock__chat - Shorten the demo print() line and output string so the lab body never needs to compete with the chat for width - Bump code and bubble font sizes 1px for legibility
1 parent d506e8b commit b890d27

2 files changed

Lines changed: 24 additions & 28 deletions

File tree

site/index.html

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -114,26 +114,26 @@ <h3 class="mock__h">Variables &amp; Types</h3>
114114
<span class="mock__tag">code lab</span>
115115
<span class="mock__run">▶ Run</span>
116116
</div>
117-
<pre class="mock__code"><span class="t-com"># try changing the value</span>
117+
<pre class="mock__code"><span class="t-com"># try it</span>
118118
<span class="t-fn">name</span> = <span class="t-str">"Ada"</span>
119-
<span class="t-fn">age</span> = <span class="t-num">36</span>
120-
<span class="t-kw">print</span>(<span class="t-str">f"</span>{<span class="t-fn">name</span>}<span class="t-str"> is </span>{<span class="t-fn">age</span>}<span class="t-str">"</span>)</pre>
119+
<span class="t-fn">age</span> = <span class="t-num">36</span>
120+
<span class="t-kw">print</span>(<span class="t-fn">name</span>, <span class="t-fn">age</span>)</pre>
121121
<div class="mock__out">
122-
<span class="mock__ok">✓ Ran cleanly</span>
123-
<code>Ada is 36</code>
122+
<span class="mock__ok">✓ Ran</span>
123+
<code>Ada 36</code>
124124
</div>
125125
</div>
126-
</section>
127-
<div class="mock__chat" aria-hidden="true">
128-
<div class="mock__chat-head">
129-
<span class="mock__chat-title">Ask tutor</span>
130-
<span class="mock__chat-x">×</span>
131-
</div>
132-
<div class="mock__chat-body">
133-
<div class="mock__bubble mock__bubble--you">Why isn't <code>age</code> typed?</div>
134-
<div class="mock__bubble mock__bubble--bot">In Python, <strong>values</strong> carry the type; names are just labels you can point anywhere. <a class="mock__cite">docs.python.org →</a></div>
126+
<div class="mock__chat" aria-hidden="true">
127+
<div class="mock__chat-head">
128+
<span class="mock__chat-title">Ask tutor</span>
129+
<span class="mock__chat-x">×</span>
130+
</div>
131+
<div class="mock__chat-body">
132+
<div class="mock__bubble mock__bubble--you">Why isn't <code>age</code> typed?</div>
133+
<div class="mock__bubble mock__bubble--bot">Values carry the type — names are just labels. <a class="mock__cite">docs.python.org →</a></div>
134+
</div>
135135
</div>
136-
</div>
136+
</section>
137137
</div>
138138
</div>
139139
</div>

site/style.css

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,6 @@ ul, ol { margin: 0; padding: 0; list-style: none; }
232232
font-size: 12px; color: var(--ink-3);
233233
}
234234
.mock__body {
235-
position: relative;
236235
display: grid;
237236
grid-template-columns: 150px 1fr;
238237
min-height: 360px;
@@ -286,10 +285,11 @@ ul, ol { margin: 0; padding: 0; list-style: none; }
286285
margin: 0;
287286
padding: 12px 14px;
288287
font-family: var(--font-mono);
289-
font-size: 12.5px;
288+
font-size: 13.5px;
290289
line-height: 1.65;
291290
color: var(--ink-1);
292291
white-space: pre-wrap;
292+
word-break: break-word;
293293
overflow-x: auto;
294294
}
295295
.mock__code .t-com { color: var(--t-com); font-style: italic; }
@@ -303,40 +303,36 @@ ul, ol { margin: 0; padding: 0; list-style: none; }
303303
background: rgba(122,163,107,0.08);
304304
border-top: 1px solid rgba(122,163,107,0.18);
305305
font-family: var(--font-mono);
306-
font-size: 12.5px;
306+
font-size: 13px;
307307
}
308308
.mock__ok { color: var(--leaf); font-weight: 600; }
309309
.mock__out code { color: var(--ink-1); }
310310
.mock__chat {
311-
position: absolute;
312-
right: 14px; bottom: 14px;
313-
width: 240px;
311+
margin-top: 14px;
314312
background: var(--bg-2);
315313
border: 1px solid var(--line-2);
316314
border-radius: var(--r-md);
317315
box-shadow: 0 18px 40px -18px rgba(0,0,0,0.7);
318316
overflow: hidden;
319-
display: none;
320317
}
321-
@media (min-width: 540px) { .mock__chat { display: block; } }
322318
.mock__chat-head {
323319
display: flex; justify-content: space-between; align-items: center;
324320
padding: 8px 12px;
325321
background: #19191c;
326322
border-bottom: 1px solid var(--line-1);
327-
font-size: 12px;
323+
font-size: 12.5px;
328324
}
329325
.mock__chat-title { color: var(--ink-0); font-weight: 600; }
330326
.mock__chat-x { color: var(--ink-3); }
331-
.mock__chat-body { padding: 10px 10px 12px; display: grid; gap: 8px; }
327+
.mock__chat-body { padding: 10px 12px 12px; display: grid; gap: 8px; }
332328
.mock__bubble {
333-
font-size: 12px; line-height: 1.5;
329+
font-size: 12.5px; line-height: 1.5;
334330
padding: 8px 10px; border-radius: 10px;
335331
}
336332
.mock__bubble code {
337333
font-family: var(--font-mono);
338334
background: rgba(255,255,255,0.06);
339-
padding: 0 4px; border-radius: 4px; font-size: 11px;
335+
padding: 0 4px; border-radius: 4px; font-size: 11.5px;
340336
}
341337
.mock__bubble--you {
342338
background: var(--bg-3); color: var(--ink-1);
@@ -350,7 +346,7 @@ ul, ol { margin: 0; padding: 0; list-style: none; }
350346
}
351347
.mock__cite {
352348
display: inline-block; margin-top: 4px;
353-
color: var(--amber); font-size: 11px;
349+
color: var(--amber); font-size: 11.5px;
354350
}
355351

356352
@media (max-width: 520px) {

0 commit comments

Comments
 (0)