Skip to content

Commit d7f7eeb

Browse files
committed
feat: added more comments for clarity
1 parent 748936b commit d7f7eeb

File tree

2 files changed

+48
-7
lines changed

2 files changed

+48
-7
lines changed

layouts/index.html

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,15 @@ <h1>Pascal</h1>
1414
<!-- <p class="version-info">Latest: Free Pascal 3.2.2 • Lazarus 4.2</p> -->
1515
</div>
1616
<div class="hero-code">
17+
<!--
18+
Code tabs
19+
- To add a new example:
20+
1) Add a button here with data-example="yourkey"
21+
2) Add a matching <div class="code-example" id="example-yourkey"> below.
22+
3) Define a Hugo variable with backticks (e.g., $yourCode := `...`) and render with
23+
{{ highlight $yourCode "objectpascal" "linenos=false" }}
24+
- The tab switching is implemented in JS inside layouts/_default/baseof.html.
25+
-->
1726
<div class="code-selector">
1827
<button class="code-tab active" data-example="webserver">Web Server</button>
1928
<button class="code-tab" data-example="sorting">Data Processing</button>
@@ -24,6 +33,12 @@ <h1>Pascal</h1>
2433
<button class="code-tab" data-example="concurrent">Concurrency</button>
2534
</div>
2635

36+
<!--
37+
Code examples container
38+
- Each .code-example corresponds to a tab via id="example-<key>".
39+
- We use Hugo's built-in Chroma highlighter. Language: "objectpascal"
40+
- The extra class "capsule-fpc" adds an FPC label via CSS (see static/css/main.css).
41+
-->
2742
<div class="code-examples">
2843
<div class="code-example active" id="example-webserver">
2944
{{ $webserverCode := `program webserver;
@@ -309,6 +324,7 @@ <h3>Productivity</h3>
309324
<!-- Getting Started Section -->
310325
<section class="content-section">
311326
<div class="container">
327+
<!-- Three-step quick start cards. Update links/titles as content grows. -->
312328
<h2 class="section-title">Quick Start</h2>
313329
<div class="cards">
314330
<div class="card">
@@ -333,6 +349,7 @@ <h3>3. Build</h3>
333349
<!-- Community Section -->
334350
<section class="content-section" style="background-color: var(--bg-secondary);">
335351
<div class="container">
352+
<!-- Call-to-action to join the community. Adjust copy/URL as needed. -->
336353
<h2 class="section-title">Join the Community</h2>
337354
<p style="text-align: center; font-size: 1.1rem; max-width: 600px; margin: 0 auto var(--spacing-xl);">
338355
Connect with Pascal developers worldwide, share knowledge, and contribute to the growing Pascal ecosystem.

static/css/main.css

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
/* CSS Variables for theming */
1+
/*
2+
Global CSS variables and design system tokens.
3+
These drive light/dark colors, spacing, typography, and layout.
4+
If you need to tweak the look-and-feel, prefer changing these first.
5+
*/
26
:root {
37
/* Light theme colors */
48
--bg-primary: #fafbfc;
@@ -32,7 +36,10 @@
3236
--transition: all 0.2s ease;
3337
}
3438

35-
/* Dark theme colors - Professional and modern */
39+
/*
40+
Dark theme overrides.
41+
The <body> gets data-theme="dark" via JS (see baseof.html) which triggers these vars.
42+
*/
3643
[data-theme="dark"] {
3744
--bg-primary: #0d1117;
3845
--bg-secondary: #161b22;
@@ -101,7 +108,10 @@ a:hover {
101108
color: var(--accent-hover);
102109
}
103110

104-
/* Header */
111+
/*
112+
Header and top navigation bar.
113+
The mobile experience uses a hamburger that toggles a dropdown (see media query section).
114+
*/
105115
.site-header {
106116
background-color: var(--bg-primary);
107117
border-bottom: 1px solid var(--border-color);
@@ -186,7 +196,10 @@ a:hover {
186196
transform-origin: center;
187197
}
188198

189-
/* Animate hamburger -> X */
199+
/*
200+
Animate hamburger -> X when menu is open.
201+
JS toggles .mobile-menu-toggle.active (see baseof.html).
202+
*/
190203
.mobile-menu-toggle.active span:nth-child(1) {
191204
transform: translateY(12px) rotate(45deg);
192205
}
@@ -448,7 +461,9 @@ a:hover {
448461
position: relative;
449462
}
450463

451-
/* Pascal compatibility capsules */
464+
/*
465+
Compatibility "capsules" shown on code blocks (e.g., FPC). Purely decorative labels.
466+
*/
452467
.highlight.capsule-fpc::before {
453468
content: 'FPC';
454469
position: absolute;
@@ -597,13 +612,20 @@ hr {
597612
color: var(--text-muted);
598613
}
599614

600-
/* Responsive design */
615+
/*
616+
Responsive design
617+
Mobile navigation lives here: a dropdown that expands/collapses with a smooth transition.
618+
*/
601619
@media (max-width: 768px) {
602620
.container {
603621
padding: 0 var(--spacing-md);
604622
}
605623

606-
/* Mobile dropdown menu (smooth transition) */
624+
/*
625+
Mobile dropdown menu (smooth transition)
626+
Hidden state uses max-height + opacity + translateY for a smooth open/close.
627+
We also keep the nav list in column layout in both states to avoid sideways shifting.
628+
*/
607629
.navbar-menu {
608630
display: flex; /* keep layout consistent */
609631
flex-direction: column;
@@ -626,6 +648,7 @@ hr {
626648
visibility: hidden;
627649
transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
628650
}
651+
629652
/* Shown when hamburger is toggled */
630653
.navbar-menu.is-open {
631654
max-height: 60vh;
@@ -634,6 +657,7 @@ hr {
634657
pointer-events: auto;
635658
visibility: visible;
636659
}
660+
637661
/* Keep column layout during both open and closing transitions to prevent sideways shift */
638662
.navbar-menu .navbar-nav {
639663
flex-direction: column;

0 commit comments

Comments
 (0)