Skip to content

Commit d409ca4

Browse files
committed
chore: format
1 parent d52d64e commit d409ca4

39 files changed

Lines changed: 194 additions & 147 deletions

‎src/components/Tile.astro‎

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,44 @@
11
---
22
type Props = {
33
id: string;
4-
variant: "default" | "turnable";
4+
variant: 'default' | 'turnable';
55
crease?: boolean;
6-
color?: "white" | "beige";
6+
color?: 'white' | 'beige';
77
};
88
9-
const { id, variant, color = "white", crease = false }: Props = Astro.props;
9+
const { id, variant, color = 'white', crease = false }: Props = Astro.props;
1010
---
1111

12-
<turnable-tile {id} class:list={["tile", color]} data-crease={crease} data-id={id} data-variant={variant}>
12+
<turnable-tile
13+
{id}
14+
class:list={['tile', color]}
15+
data-crease={crease}
16+
data-id={id}
17+
data-variant={variant}
18+
>
1319
<div class="tile-front">
1420
<slot name="front" />
1521
</div>
16-
{
17-
variant === "turnable" && (
18-
<div class="tile-back">
19-
<slot name="back" />
20-
</div>
21-
)
22-
}
22+
{variant === 'turnable' && (
23+
<div class="tile-back">
24+
<slot name="back" />
25+
</div>
26+
)}
2327
</turnable-tile>
2428

2529
<style>
2630
.tile {
2731
color: inherit;
2832
font-weight: 600;
2933
display: grid;
30-
grid-template-areas: "stack";
34+
grid-template-areas: 'stack';
3135
position: relative;
3236
perspective: 1000px;
3337
transform-style: preserve-3d;
3438
transition: rotate 500ms linear;
3539
}
3640

37-
.tile[data-variant="turnable"] {
41+
.tile[data-variant='turnable'] {
3842
cursor: pointer;
3943
}
4044

@@ -79,12 +83,12 @@ const { id, variant, color = "white", crease = false }: Props = Astro.props;
7983
box-sizing: border-box;
8084
}
8185

82-
.tile[data-crease="true"] .tile-front {
86+
.tile[data-crease='true'] .tile-front {
8387
clip-path: polygon(0 0, 100% 0, 100% calc(100% - 13px), calc(100% - 13px) 100%, 0 100%);
8488
}
8589

86-
.tile[data-crease="true"] .tile-front::after {
87-
content: "";
90+
.tile[data-crease='true'] .tile-front::after {
91+
content: '';
8892
position: absolute;
8993
bottom: 0;
9094
right: 0;
@@ -105,15 +109,15 @@ const { id, variant, color = "white", crease = false }: Props = Astro.props;
105109

106110
const tile = document.getElementById(id);
107111

108-
tile?.addEventListener("click", function () {
109-
if (tile?.dataset.variant === "turnable") {
110-
tile?.classList.toggle("show");
112+
tile?.addEventListener('click', function () {
113+
if (tile?.dataset.variant === 'turnable') {
114+
tile?.classList.toggle('show');
111115
}
112116
});
113117
}
114118
}
115119

116-
if (!customElements.get("turnable-tile")) {
117-
customElements.define("turnable-tile", Tile);
120+
if (!customElements.get('turnable-tile')) {
121+
customElements.define('turnable-tile', Tile);
118122
}
119123
</script>

‎src/components/accordion/Accordion.astro‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
import type { AccordionItem } from "../../types/AccordionItem";
2+
import type { AccordionItem } from '../../types/AccordionItem';
33
44
/**
55
* Accordion Component
@@ -25,7 +25,7 @@ interface Props {
2525
const { class: className, ...rest } = Astro.props;
2626
---
2727

28-
<ul class:list={["accordion", className]} {...rest}>
28+
<ul class:list={['accordion', className]} {...rest}>
2929
<slot />
3030
</ul>
3131

‎src/components/accordion/AccordionItem.astro‎

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
import type { HTMLAttributes } from "astro/types";
3-
import Heading from "./Heading.astro";
4-
import { useI18n } from "astro-nanostores-i18n:runtime";
2+
import type { HTMLAttributes } from 'astro/types';
3+
import Heading from './Heading.astro';
4+
import { useI18n } from 'astro-nanostores-i18n:runtime';
55
66
/**
77
* Accordion Item Component
88
*
99
* @description An individual accordion item that can be expanded/collapsed with smooth animations
1010
*/
1111
12-
type Props = HTMLAttributes<"li"> & {
12+
type Props = HTMLAttributes<'li'> & {
1313
/**
1414
* Id of the item
1515
*/
@@ -27,17 +27,17 @@ type Props = HTMLAttributes<"li"> & {
2727
* Heading level for the title (h1-h6)
2828
* @default 'h3'
2929
*/
30-
headingLevel?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
30+
headingLevel?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
3131
/**
3232
* Visual size of the heading (can differ from semantic level)
3333
* @default 'h6'
3434
*/
35-
headingSize?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
35+
headingSize?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
3636
/**
3737
* Visual style variant of the accordion
3838
* @default 'chevron'
3939
*/
40-
variant?: "minimal" | "chevron";
40+
variant?: 'minimal' | 'chevron';
4141
/**
4242
* Whether the accordion item is initially open
4343
* @default false
@@ -50,42 +50,54 @@ type Props = HTMLAttributes<"li"> & {
5050
openOnUrlReference?: boolean;
5151
};
5252
53-
const translations = useI18n("accordion.item", {
54-
more: "Mehr anzeigen",
55-
less: "Weniger anzeigen",
53+
const translations = useI18n('accordion.item', {
54+
more: 'Mehr anzeigen',
55+
less: 'Weniger anzeigen',
5656
});
5757
5858
const {
5959
id,
6060
class: className,
6161
name,
62-
headingLevel = "h3",
63-
headingSize = "h6",
64-
variant = "chevron",
62+
headingLevel = 'h3',
63+
headingSize = 'h6',
64+
variant = 'chevron',
6565
open = false,
6666
openOnUrlReference = true,
6767
...rest
6868
}: Props = Astro.props;
6969
---
7070

71-
<li id={id} class:list={["item", className]} {...rest} data-dynamic={openOnUrlReference}>
71+
<li id={id} class:list={['item', className]} {...rest} data-dynamic={openOnUrlReference}>
7272
<slot name="pretext" />
73-
<details class:list={["wrapper", `variant-${variant}`]} name={name} {...open ? { open } : {}}>
73+
<details class:list={['wrapper', `variant-${variant}`]} name={name} {...(open ? { open } : {})}>
7474
<summary class="header">
7575
<div class="title">
76-
{variant === "chevron" && (
76+
{variant === 'chevron' && (
7777
<Heading level={headingLevel} size={headingSize}>
7878
<>
7979
<slot name="title" />
8080
<span class="icon-chevron">
81-
<svg aria-hidden="true" width="12" height="8" fill="none" xmlns="http://www.w3.org/2000/svg">
82-
<path d="M1.4 1.6L6 6.2l4.6-4.6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" />
83-
</svg>
81+
<svg
82+
aria-hidden="true"
83+
width="12"
84+
height="8"
85+
fill="none"
86+
xmlns="http://www.w3.org/2000/svg"
87+
>
88+
<path
89+
d="M1.4 1.6L6 6.2l4.6-4.6"
90+
stroke="currentColor"
91+
stroke-width="2"
92+
stroke-linecap="round"
93+
stroke-linejoin="round"
94+
/>
95+
</svg>
8496
</span>
8597
</>
8698
</Heading>
8799
)}
88-
{variant === "minimal" && (
100+
{variant === 'minimal' && (
89101
<>
90102
<span class="toggle-text more">{translations.more}</span>
91103
<span class="toggle-text less">{translations.less}</span>
@@ -191,7 +203,7 @@ const {
191203
:where(header)::marker,
192204
:where(.header)::-webkit-details-marker {
193205
display: none;
194-
content: "";
206+
content: '';
195207
}
196208

197209
:where(.header .title:hover),
@@ -232,7 +244,7 @@ const {
232244

233245
if (!hash) return;
234246

235-
const id = hash.split("#")[1];
247+
const id = hash.split('#')[1];
236248

237249
if (!id) return;
238250
const element = document.getElementById(id);
@@ -243,10 +255,10 @@ const {
243255

244256
if (!dynamicOpening) return;
245257

246-
const details = element.getElementsByTagName("details");
258+
const details = element.getElementsByTagName('details');
247259

248260
if (details.length === 1) {
249-
details[0]?.setAttribute("open", "");
261+
details[0]?.setAttribute('open', '');
250262
}
251263
};
252264

‎src/components/accordion/Heading.astro‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44
* @description A versatile heading component that handles all heading levels with proper accessibility
55
*/
66
const headingOptions = {
7-
h1: "h1",
8-
h2: "h2",
9-
h3: "h3",
10-
h4: "h4",
11-
h5: "h5",
12-
h6: "h6",
7+
h1: 'h1',
8+
h2: 'h2',
9+
h3: 'h3',
10+
h4: 'h4',
11+
h5: 'h5',
12+
h6: 'h6',
1313
};
1414
15-
import type { HTMLAttributes } from "astro/types";
15+
import type { HTMLAttributes } from 'astro/types';
1616
17-
interface Props extends HTMLAttributes<"h1" | "h2" | "h3" | "h4" | "h5" | "h6"> {
17+
interface Props extends HTMLAttributes<'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6'> {
1818
/**
1919
* The tag name of the heading
2020
*/
@@ -25,11 +25,11 @@ interface Props extends HTMLAttributes<"h1" | "h2" | "h3" | "h4" | "h5" | "h6">
2525
size?: keyof typeof headingOptions;
2626
}
2727
28-
const { level = "h2", size = level, ...rest } = Astro.props;
28+
const { level = 'h2', size = level, ...rest } = Astro.props;
2929
const Tag = headingOptions[level];
3030
---
3131

32-
<Tag class:list={["heading", size]} {...rest}>
32+
<Tag class:list={['heading', size]} {...rest}>
3333
<slot />
3434
</Tag>
3535

‎src/content.config.ts‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import {
44
i18nFileLoader,
55
i18nLoader,
66
localized as localizedSchema,
7-
} from "astro-loader-i18n";
8-
import { defineCollection, type ImageFunction } from "astro:content";
9-
import { localeSlugs } from "./site.config";
10-
import { glob } from "astro/loaders";
11-
import { z } from "astro/zod";
7+
} from 'astro-loader-i18n';
8+
import { defineCollection, type ImageFunction } from 'astro:content';
9+
import { localeSlugs } from './site.config';
10+
import { glob } from 'astro/loaders';
11+
import { z } from 'astro/zod';
1212

1313
const localized = <T extends z.ZodType>(schema: T) => localizedSchema(schema, localeSlugs);
1414

@@ -57,7 +57,7 @@ const sectionsCollection = defineCollection({
5757
});
5858

5959
const referenceCompaniesCollection = defineCollection({
60-
loader: i18nLoader({ pattern: "**/[^_]*.{md,mdx}", base: "./src/content/references/companies" }),
60+
loader: i18nLoader({ pattern: '**/[^_]*.{md,mdx}', base: './src/content/references/companies' }),
6161
schema: ({ image }) =>
6262
extendI18nLoaderSchema(
6363
z.object({

‎src/content/pages/de/past/references.mdx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@ path: referenzen
33
title: Referenzen
44
---
55

6-
import Divider from "../../../../components/Divider.astro";
7-
import ReferencesSection from "../../../../layouts/sections/ReferencesSection.astro";
8-
import CompaniesSection from "../../../../layouts/sections/CompaniesSection.astro";
6+
import Divider from '../../../../components/Divider.astro';
7+
import ReferencesSection from '../../../../layouts/sections/ReferencesSection.astro';
8+
import CompaniesSection from '../../../../layouts/sections/CompaniesSection.astro';
99

1010
<section class="spotlight">
11-
Als Firma haben wir bereits mit vielen Kunden in verschiedensten Projekten gearbeitet. Wir haben daher bereits
12-
Erfahrung mit Webapplikationen, Handy-Apps, Kurse im Bereich IT und weiteres.
11+
Als Firma haben wir bereits mit vielen Kunden in verschiedensten Projekten gearbeitet. Wir haben
12+
daher bereits Erfahrung mit Webapplikationen, Handy-Apps, Kurse im Bereich IT und weiteres.
1313
</section>
1414

1515
<Divider firstSegmentColor="var(--color-white)" fixAntialiasingBottom />
1616

1717
<section class="white-background">
18-
<ReferencesSection />
18+
<ReferencesSection />
1919
</section>
2020

2121
<Divider
@@ -26,5 +26,5 @@ import CompaniesSection from "../../../../layouts/sections/CompaniesSection.astr
2626
/>
2727

2828
<section>
29-
<CompaniesSection />
30-
</section>
29+
<CompaniesSection />
30+
</section>

‎src/content/pages/en/past/references.mdx‎

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@ path: references
33
title: References
44
---
55

6-
import Divider from "../../../../components/Divider.astro";
7-
import ReferencesSection from "../../../../layouts/sections/ReferencesSection.astro";
8-
import CompaniesSection from "../../../../layouts/sections/CompaniesSection.astro";
6+
import Divider from '../../../../components/Divider.astro';
7+
import ReferencesSection from '../../../../layouts/sections/ReferencesSection.astro';
8+
import CompaniesSection from '../../../../layouts/sections/CompaniesSection.astro';
99

1010
<section class="spotlight">
11-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec risus sit amet nisl consectetur suscipit. Duis diam
12-
dui, ultricies ut dolor vel, venenatis egestas ex. Ut vitae nibh arcu. Suspendisse varius risus id blandit fermentum.
13-
Pellentesque dictum viverra nisi, id congue ex elementum sed. Donec bibendum libero vitae dui accumsan, ac rhoncus mi
14-
pellentesque. Aliquam erat volutpat. Morbi bibendum feugiat dolor non tristique. Aliquam erat volutpat.
11+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec nec risus sit amet nisl consectetur
12+
suscipit. Duis diam dui, ultricies ut dolor vel, venenatis egestas ex. Ut vitae nibh arcu.
13+
Suspendisse varius risus id blandit fermentum. Pellentesque dictum viverra nisi, id congue ex
14+
elementum sed. Donec bibendum libero vitae dui accumsan, ac rhoncus mi pellentesque. Aliquam erat
15+
volutpat. Morbi bibendum feugiat dolor non tristique. Aliquam erat volutpat.
1516
</section>
1617

1718
<Divider firstSegmentColor="var(--color-white)" fixAntialiasingBottom />
1819

1920
<section class="white-background">
20-
<ReferencesSection />
21+
<ReferencesSection />
2122
</section>
2223

2324
<Divider
@@ -28,5 +29,5 @@ import CompaniesSection from "../../../../layouts/sections/CompaniesSection.astr
2829
/>
2930

3031
<section>
31-
<CompaniesSection />
32-
</section>
32+
<CompaniesSection />
33+
</section>

‎src/content/references/companies/astra.de.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ companyName: Bundesamt für Strassen ASTRA
44
logo: ./astra.svg
55
url: https://www.astra.admin.ch
66
details: de text
7-
---
7+
---

0 commit comments

Comments
 (0)