Skip to content

Commit 3d29d39

Browse files
authored
Merge pull request #354 from processing/ui-fixes
UI fixes
2 parents cae5eb6 + bd3e603 commit 3d29d39

19 files changed

Lines changed: 173 additions & 144 deletions

src/components/Footer/index.astro

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const t = await getUiTranslator(currentLocale);
1111
>
1212
<div class="grid lg:row-span-2 grid-rows-subgrid">
1313
<div>
14-
<div class="mb-md">p5.js</div>
14+
<div class="mb-5">p5.js</div>
1515
</div>
1616
<div
1717
class="self-end w-28 max-w-full lg:w-32 text-accent-type-color lg:-top-2 relative"
@@ -20,7 +20,7 @@ const t = await getUiTranslator(currentLocale);
2020
</div>
2121
</div>
2222
<div>
23-
<div class="mb-md" id="resources-footer-category">{t("Resources")}</div>
23+
<div class="mb-5" id="resources-footer-category">{t("Resources")}</div>
2424
<ul aria-labelledby="resources-footer-category">
2525
<li><a href="/reference">{t("Reference")}</a></li>
2626
<li><a href="/tutorials">{t("Tutorials")}</a></li>
@@ -34,7 +34,7 @@ const t = await getUiTranslator(currentLocale);
3434
</div>
3535
<div class="lg:col-span-2 grid grid-cols-subgrid">
3636
<div>
37-
<div class="mb-md" id="info-footer-category">{t("Information")}</div>
37+
<div class="mb-5" id="info-footer-category">{t("Information")}</div>
3838
<ul aria-labelledby="info-footer-category">
3939
<li><a href="/download">{t("Download")}</a></li>
4040
<li><a href="/contact">{t("Contact")}</a></li>
@@ -44,7 +44,7 @@ const t = await getUiTranslator(currentLocale);
4444
</ul>
4545
</div>
4646
<div class="lg:col-start-2 mt-xl lg:mt-0">
47-
<div class="mb-md" id="socials-footer-category">{t("Socials")}</div>
47+
<div class="mb-5" id="socials-footer-category">{t("Socials")}</div>
4848
<ul aria-labelledby="socials-footer-category">
4949
<li><a href="https://github.com/processing/p5.js">GitHub</a></li>
5050
<li><a href="https://www.instagram.com/p5xjs/">Instagram</a></li>

src/components/GridItem/ContributorDoc.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const { item } = Astro.props;
1414
href={`/contribute/${removeLocaleAndExtension(item.slug)}`}
1515
>
1616
<div
17-
class="grid place-content-center mt-xs bg-accent-color text-accent-type-color aspect-photo p-4 mb-2"
17+
class="grid place-content-center bg-accent-color text-accent-type-color aspect-photo p-4"
1818
>
1919
<span
2020
class="text-lg text-center align-middle line-clamp-3 text-pretty group-hover:underline"

src/components/Nav/styles.module.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@
3333
justify-content: space-between;
3434
height: 35px;
3535
width: 100%;
36-
padding: var(--spacing-xs) 0;
36+
a {
37+
height: 25px;
38+
}
3739
}
3840

3941
&:global(.open) {
@@ -67,6 +69,9 @@
6769
gap: var(--spacing-xs);
6870
padding: 0;
6971
margin-bottom: 10px;
72+
a {
73+
height: unset;
74+
}
7075
}
7176

7277
.toggle {
@@ -97,7 +102,7 @@
97102

98103
svg {
99104
height: 1rem;
100-
width: 1rem;
105+
width: 1.25rem;
101106
}
102107
@media (min-width: $breakpoint-tablet) {
103108
display: none !important;
@@ -108,7 +113,7 @@
108113
display: none;
109114
@media (min-width: $breakpoint-tablet) {
110115
display: block;
111-
margin-top: 5px;
116+
margin-top: 7.5px;
112117
}
113118
}
114119

src/components/PageHeader/RootPage.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ const borderStyle = isFilterRoute ? "" : "border-b border-sidebar-type-color";
1515
class=`grid grid-cols-2 lg:grid-cols-4 gap-x-[40px] min-h-[350px] h-[50vh] pt-5xl lg:pt-4xl bg-accent-color text-accent-type-color pb-md px-5 md:px-lg ${borderStyle}`
1616
>
1717
<h1 class="whitespace-pre-line col-span-full mb-5">{title}</h1>
18-
<p class="text-h3 !mt-0 mb-3xl col-span-3">{subtitle}</p>
18+
<p class="text-h3 !mt-0 mb-3xl col-span-2">{subtitle}</p>
1919
</div>

src/components/ReferenceDirectoryWithFilter/index.tsx

Lines changed: 33 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -77,29 +77,30 @@ export const ReferenceDirectoryWithFilter = ({
7777
}, []);
7878
}, [categoryData, searchKeyword]);
7979

80-
const renderEntries = (entries: ReferenceDirectoryEntry[]) => (
81-
<div class="content-grid">
82-
{entries.map((entry) => (
83-
<div class="col-span-3 w-full overflow-hidden" key={entry.id}>
84-
<a
85-
href={`/reference/${entry.data.path}`}
86-
class="group hover:no-underline"
87-
aria-label={entry.data.title}
88-
aria-describedby={`${entry.data.title}-description`}
89-
>
90-
<span
91-
class="text-body-mono group-hover:underline"
92-
dangerouslySetInnerHTML={{ __html: entry.data.title }}
93-
/>
94-
<p
95-
class="mt-1 text-sm"
96-
id={`${entry.data.title}-description`}
97-
>{`${getOneLineDescription(entry.data.description)}`}</p>
98-
</a>
99-
</div>
100-
))}
101-
</div>
102-
);
80+
const renderEntries = (entries: ReferenceDirectoryEntry[]) =>
81+
entries.length === 0 ? null : (
82+
<div class="content-grid">
83+
{entries.map((entry) => (
84+
<div class="col-span-3 w-full overflow-hidden" key={entry.id}>
85+
<a
86+
href={`/reference/${entry.data.path}`}
87+
class="group hover:no-underline"
88+
aria-label={entry.data.title}
89+
aria-describedby={`${entry.data.title}-description`}
90+
>
91+
<span
92+
class="text-body-mono group-hover:underline"
93+
dangerouslySetInnerHTML={{ __html: entry.data.title }}
94+
/>
95+
<p
96+
class="mt-1 text-sm"
97+
id={`${entry.data.title}-description`}
98+
>{`${getOneLineDescription(entry.data.description)}`}</p>
99+
</a>
100+
</div>
101+
))}
102+
</div>
103+
);
103104

104105
const getSubcatHeading = (
105106
subcat: { name: string },
@@ -110,21 +111,20 @@ export const ReferenceDirectoryWithFilter = ({
110111
}
111112

112113
return (
113-
<div class="my-lg">
114+
<>
114115
{subcat.name.includes("p5.") ? (
115116
<a
116117
id={subcat.name}
117118
href={`/reference/${category.name === "p5.sound" ? "p5.sound" : "p5"}/${subcat.name}`}
118119
>
119-
<h3>{subcat.name}</h3>
120+
<h3 className="m-0 py-[40px]">{subcat.name}</h3>
120121
</a>
121122
) : (
122-
<h3>
123+
<h3 className="m-0 py-[40px]" id={subcat.name}>
123124
{subcat.name}
124-
<a id={subcat.name} />
125125
</h3>
126126
)}
127-
</div>
127+
</>
128128
);
129129
};
130130

@@ -133,21 +133,17 @@ export const ReferenceDirectoryWithFilter = ({
133133
return <div class="mt-lg">{uiTranslations["No Results"]}</div>;
134134
}
135135
return filteredEntries.map((category) => (
136-
<div
137-
class="my-md border-b border-type-color pb-2xl last:!border-0"
138-
key={category.name}
139-
>
140-
<h2>
136+
<section key={category.name}>
137+
<h2 class="mb-0" id={category.name}>
141138
{category.name}
142-
<a id={category.name} />
143139
</h2>
144140
{category.subcats.map((subcat) => (
145141
<div key={subcat.name}>
146142
{getSubcatHeading(subcat, category)}
147143
{renderEntries(subcat.entries)}
148144
</div>
149145
))}
150-
</div>
146+
</section>
151147
));
152148
};
153149

@@ -162,12 +158,12 @@ export const ReferenceDirectoryWithFilter = ({
162158
<div>
163159
<div class="h-0 overflow-visible">
164160
<div class="relative -top-[75px] grid h-[75px] grid-cols-2 gap-x-[40px] border-b border-sidebar-type-color bg-accent-color px-5 pb-lg md:px-lg lg:grid-cols-4">
165-
<div class="text-body col-span-3 flex w-full max-w-[750px] border-b border-accent-type-color text-accent-type-color">
161+
<div class="text-body col-span-2 flex w-full max-w-[750px] border-b border-accent-type-color text-accent-type-color">
166162
<input
167163
type="text"
168164
id="search"
169165
ref={inputRef}
170-
class="w-full bg-transparent py-xs text-accent-type-color placeholder:text-accent-type-color"
166+
class="w-full bg-transparent py-xs text-accent-type-color placeholder:text-accent-type-color focus:outline-0"
171167
placeholder="Filter by keyword"
172168
onKeyUp={(e: JSX.TargetedKeyboardEvent<HTMLInputElement>) => {
173169
const target = e.target as HTMLInputElement;

src/components/RelatedItems/index.astro

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,26 @@ interface Props {
2121
const { title, items, class: className } = Astro.props;
2222
---
2323

24-
<div class={className}>
24+
<div>
2525
<hr />
26-
<h2 class="mt-md mb-lg">{title}</h2>
27-
<div class="grid grid-cols-2 lg:grid-cols-4 gap-y-xl gap-x-[40px]">
28-
{
29-
items.map((i) => {
30-
if (isCurationResponse(i)) {
31-
return <GridItemSketch item={i} />;
32-
}
33-
switch (i.collection) {
34-
case "reference":
35-
return <GridItemReference item={i} />;
36-
case "examples":
37-
return <GridItemExample item={i} />;
38-
case "events":
39-
return <GridItemEvent item={i} />;
40-
}
41-
})
42-
}
43-
</div>
26+
<section class={className}>
27+
<h2>{title}</h2>
28+
<ul class="grid grid-cols-2 lg:grid-cols-4 gap-y-xl gap-x-[40px]">
29+
{
30+
items.map((i) => {
31+
if (isCurationResponse(i)) {
32+
return <GridItemSketch item={i} />;
33+
}
34+
switch (i.collection) {
35+
case "reference":
36+
return <GridItemReference item={i} />;
37+
case "examples":
38+
return <GridItemExample item={i} />;
39+
case "events":
40+
return <GridItemEvent item={i} />;
41+
}
42+
})
43+
}
44+
</ul>
45+
</section>
4446
</div>

src/components/SearchForm/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const t = await getUiTranslator(currentLocale);
2020
type="search"
2121
placeholder={t("Search") as string}
2222
name="term"
23-
class="placeholder-accent-type-color bg-transparent pl-[40px] py-[6px] md:py-[4px] lg:py-[8px] w-full rounded-[20px] peer"
23+
class="placeholder-accent-type-color bg-transparent pl-[40px] py-[6px] md:py-[4px] lg:py-[8px] w-full rounded-[20px] focus:outline-0 peer"
2424
aria-label="Search through site content"
2525
required
2626
/>

src/components/SearchResults/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const SearchResults = ({
116116
onSearchChange(e);
117117
}
118118
}}
119-
class="h-fit w-full appearance-none bg-transparent px-md text-4xl placeholder-sidebar-type-color"
119+
class="h-fit w-full appearance-none bg-transparent px-md text-4xl placeholder-sidebar-type-color focus:outline-0"
120120
aria-label="Search through site content"
121121
required
122122
/>

src/layouts/AboutLayout.astro

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,13 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
5959
<Head title="About" locale={currentLocale} />
6060

6161
<BaseLayout title="About" variant="root">
62-
<section class="mt-md pb-xs rendered-markdown">
62+
<section class="rendered-markdown">
6363
<Content />
6464
</section>
65-
<hr />
66-
<section class="pb-2xl lg:pb-xl">
65+
66+
<section>
6767
<h2 id="people">{t("People")}</h2>
68-
<ul class="content-grid my-xl">
68+
<ul class="content-grid">
6969
{
7070
displayedFeaturedPeople.map((fp) => (
7171
<li class="col-span-2">
@@ -74,12 +74,12 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
7474
))
7575
}
7676
</ul>
77-
<LinkButton variant="link" url="/people" class="my-md min-w-[220px]"
77+
<LinkButton variant="link" url="/people" class="mt-md min-w-[220px]"
7878
>{t("All People")}</LinkButton
7979
>
8080
</section>
81-
<hr />
82-
<section class="pb-3xl lg:pb-2xl">
81+
82+
<section>
8383
<h2 id="contact">{t("Contact")}</h2>
8484
<div class="text-2xl grid grid-cols-6 lg:grid-cols-9 gap-x-[40px] mt-xl">
8585
<div class="col-span-2 lg:col-span-3">Email</div><div
@@ -100,7 +100,6 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
100100
</div>
101101
</div>
102102
</section>
103-
<hr />
104103
<section>
105104
<h2 id="processing-foundation">Processing Foundation</h2>
106105
<ul class="text-2xl mt-xl">
@@ -121,7 +120,4 @@ const displayedFeaturedPeople = sortedFeaturedPeople.slice(0, 6);
121120
a {
122121
@apply text-type-magenta-dark;
123122
}
124-
h2 {
125-
@apply mt-sm;
126-
}
127123
</style>

src/layouts/BaseLayout.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const {
2626
subtitle,
2727
className = "",
2828
variant = "root",
29-
mainContentParentClass = "mx-5 md:mx-lg pb-4xl mt-md",
29+
mainContentParentClass = "mx-5 md:mx-lg mt-md",
3030
homepageConfig,
3131
} = Astro.props;
3232
const currentLocale = getCurrentLocale(Astro.url.pathname);

0 commit comments

Comments
 (0)