Skip to content

Commit 4bba15f

Browse files
committed
feat: add references
1 parent 1de8bd5 commit 4bba15f

File tree

5 files changed

+148
-12
lines changed

5 files changed

+148
-12
lines changed

src/content.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ const referenceCompaniesCollection = defineCollection({
5757
companyName: z.string(),
5858
logo: image(),
5959
url: z.string().url().optional(),
60+
archived: z.boolean().optional().default(false),
6061
}),
6162
});
6263

Lines changed: 90 additions & 0 deletions
Loading

src/content/references/companies/index.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
companyName: Bundesamt für Strassen ASTRA
33
logo: ./astra.svg
44
url: https://www.astra.admin.ch
5+
- id: dogli
6+
companyName: DOGLi GmbH
7+
logo: ./dogli.svg
8+
url: https://dogli.app
59
- id: haslerrail
610
companyName: HaslerRail AG
711
logo: ./haslerrail.svg
@@ -18,6 +22,11 @@
1822
companyName: STO Innenausbau AG
1923
logo: ./sto.svg
2024
url: https://sto-innenausbau.ch
25+
archived: true
26+
- id: uzh
27+
companyName: Universität Zürich
28+
logo: ./uzh.svg
29+
url: https://www.uzh.ch
2130
- id: wagner
2231
companyName: Wagner Unternehmungen AG
2332
logo: ./wagner.svg
@@ -26,10 +35,12 @@
2635
companyName: Wiegand AG
2736
logo: ./wiegand.png
2837
url: https://wiegand.ch
38+
archived: true
2939
- id: yaver
3040
companyName: YAVER Infrastructure & Services GmbH
3141
logo: ./yaver.svg
3242
url: https://yaver.ch
43+
archived: true
3344
- id: zli
3445
companyName: Zürcher Lehrbetriebsverband ICT
3546
logo: ./zli.svg

src/content/references/companies/uzh.svg

Lines changed: 1 addition & 0 deletions
Loading

src/layouts/sections/ReferencesSection.astro

Lines changed: 45 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Image } from "astro:assets";
44
import { getCollection } from "astro:content";
55
66
const locale = currentLocale.get();
7-
const companies = await getCollection("referenceCompanies");
7+
const companies = await getCollection("referenceCompanies", (entry) => !entry.data.archived);
88
const projects = await getCollection("referenceProjects", (entry) => entry.data.locale === locale);
99
---
1010

@@ -39,25 +39,47 @@ const projects = await getCollection("referenceProjects", (entry) => entry.data.
3939
z-index: 1;
4040
}
4141

42+
img {
43+
height: 4rem;
44+
width: auto;
45+
max-width: 100%;
46+
object-fit: contain;
47+
}
48+
4249
:where(.references-projects) {
43-
display: flex;
50+
display: grid;
51+
grid-template-columns: repeat(2, 1fr);
4452
gap: var(--size-gutter-big);
4553
margin-block-end: var(--size-gutter-big);
4654

55+
img {
56+
height: 8rem;
57+
}
58+
59+
div:first-child {
60+
grid-column: span 2;
61+
62+
h3 {
63+
min-height: 3rem;
64+
}
65+
}
66+
67+
h3 {
68+
min-height: 5rem;
69+
}
70+
4771
div {
4872
background-color: var(--color-background);
4973
padding: var(--size-gutter-big);
5074
display: flex;
5175
flex-direction: column;
5276
align-items: center;
53-
flex-grow: 1;
54-
width: 100%;
5577
}
5678
}
5779

5880
:where(.references-companies) {
5981
display: grid;
60-
grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
82+
grid-template-columns: repeat(4, 1fr);
6183
gap: var(--size-gutter-big);
6284

6385
a {
@@ -69,17 +91,28 @@ const projects = await getCollection("referenceProjects", (entry) => entry.data.
6991
padding: var(--size-gutter-big);
7092
gap: var(--size-gutter);
7193
color: inherit;
72-
text-decoration: none;
73-
font-size: 0.875rem;
7494
font-weight: 600;
7595
background-color: var(--color-background);
7696
}
97+
}
7798

78-
img {
79-
height: 4rem;
80-
width: auto;
81-
max-width: 100%;
82-
object-fit: contain;
99+
@media screen and (max-width: 1600px) {
100+
.references-companies {
101+
grid-template-columns: repeat(2, 1fr);
102+
}
103+
}
104+
105+
@media screen and (max-width: 800px) {
106+
.references-companies {
107+
grid-template-columns: 1fr;
108+
}
109+
110+
.references-projects {
111+
grid-template-columns: 1fr;
112+
113+
div:first-child {
114+
grid-column: span 1;
115+
}
83116
}
84117
}
85118
</style>

0 commit comments

Comments
 (0)