Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions src/lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,9 @@ export type SignupStore = {
}

export type StandardTypes =
| `text`
| `email`
| `number`
| `date`
| `tel`
| `checkbox`
`text` | `email` | `number` | `date` | `tel` | `checkbox`
export type CustomTypes =
| `select`
| `toggle`
| `singleRange`
| `doubleRange`
| `placeSelect`
| `radio`
`select` | `toggle` | `singleRange` | `doubleRange` | `placeSelect` | `radio`
export type FormFieldType = StandardTypes | CustomTypes

export type FormFieldProps = {
Expand Down Expand Up @@ -280,6 +270,9 @@ export type Microcopy = {
theme?: string
chooseLocation?: string
register?: string
statsLayout?: `default` | `grouped`
currentStatsTitle?: string
mediatedStatsTitle?: string
boxes?: {
locationsNumber?: number
locationsName?: string
Expand Down
155 changes: 113 additions & 42 deletions src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -33,43 +33,94 @@
{@html $microcopy?.indexPage?.theme}
</h2>

<section style="white-space: nowrap;">
<div style="background: var(--light-blue);">
<span id="chapterNumber">{data.chapters.filter((ch) => ch.acceptsSignups).length}</span>
<strong>
<IconPlace {style} />
{$microcopy?.indexPage?.boxes?.locationsName}</strong
>
</div>
<div style="background: var(--green);">
<span id="studentNumber">{$microcopy?.indexPage?.boxes?.studentsNumber}</span>
<strong>
<IconUserGraduate {style} />
{$microcopy?.indexPage?.boxes?.studentsName}</strong
>
</div>
<div style="background: var(--orange);">
<span id="pupilNumber">{$microcopy?.indexPage?.boxes?.pupilsNumber}</span>
<strong>
<IconChild {style} />
{$microcopy?.indexPage?.boxes?.pupilsName}</strong
>
</div>
<div style="background: var(--green);">
<span id="scholarshipNumber">{$microcopy?.indexPage?.boxes?.scholarshipNumber}</span>
<strong>
<IconUserGraduate {style} />
{@html $microcopy?.indexPage?.boxes?.scholarshipName}
</strong>
</div>
<div style="background: var(--light-blue);">
<span id="organizationMemberNumber">{$microcopy?.indexPage?.boxes?.organizationMemberNumber}</span>
<strong>
<IconUserGroup {style} />
{@html $microcopy?.indexPage?.boxes?.organizationMemberName}
</strong>
</div>
</section>
{#if $microcopy?.indexPage?.statsLayout === `grouped`}
<section class="stat-groups" aria-label="Zahlen zu StudyTutors">
<div class="stat-group">
<h2>{$microcopy?.indexPage?.currentStatsTitle ?? `Wir sind aktuell`}</h2>
<div class="stat-row current">
<div class="stat-box" style="background: var(--blue);">
<span id="chapterNumber">{data.chapters.filter((ch) => ch.acceptsSignups).length}</span>
<strong>
<IconPlace {style} />
{$microcopy?.indexPage?.boxes?.locationsName}</strong
>
</div>
<div class="stat-box" style="background: var(--green);">
<span id="organizationMemberNumber">{$microcopy?.indexPage?.boxes?.organizationMemberNumber}</span>
<strong>
<IconUserGroup {style} />
{@html $microcopy?.indexPage?.boxes?.organizationMemberName}
</strong>
</div>
</div>
</div>

<div class="stat-group">
<h2>{$microcopy?.indexPage?.mediatedStatsTitle ?? `Wir vermittelten seit 2020:`}</h2>
<div class="stat-row mediated">
<div class="stat-box" style="background: var(--green);">
<span id="studentNumber">{$microcopy?.indexPage?.boxes?.studentsNumber}</span>
<strong>
<IconUserGraduate {style} />
{$microcopy?.indexPage?.boxes?.studentsName}</strong
>
</div>
<div class="stat-box" style="background: var(--orange);">
<span id="pupilNumber">{$microcopy?.indexPage?.boxes?.pupilsNumber}</span>
<strong>
<IconChild {style} />
{$microcopy?.indexPage?.boxes?.pupilsName}</strong
>
</div>
<div class="stat-box" style="background: var(--light-blue);">
<span id="scholarshipNumber">{$microcopy?.indexPage?.boxes?.scholarshipNumber}</span>
<strong>
<IconUserGraduate {style} />
{@html $microcopy?.indexPage?.boxes?.scholarshipName}
</strong>
</div>
</div>
</div>
</section>
{:else}
<section class="stat-row default-stats" style="white-space: nowrap;">
<div class="stat-box" style="background: var(--light-blue);">
<span id="chapterNumber">{data.chapters.filter((ch) => ch.acceptsSignups).length}</span>
<strong>
<IconPlace {style} />
{$microcopy?.indexPage?.boxes?.locationsName}</strong
>
</div>
<div class="stat-box" style="background: var(--green);">
<span id="studentNumber">{$microcopy?.indexPage?.boxes?.studentsNumber}</span>
<strong>
<IconUserGraduate {style} />
{$microcopy?.indexPage?.boxes?.studentsName}</strong
>
</div>
<div class="stat-box" style="background: var(--orange);">
<span id="pupilNumber">{$microcopy?.indexPage?.boxes?.pupilsNumber}</span>
<strong>
<IconChild {style} />
{$microcopy?.indexPage?.boxes?.pupilsName}</strong
>
</div>
<div class="stat-box" style="background: var(--green);">
<span id="scholarshipNumber">{$microcopy?.indexPage?.boxes?.scholarshipNumber}</span>
<strong>
<IconUserGraduate {style} />
{@html $microcopy?.indexPage?.boxes?.scholarshipName}
</strong>
</div>
<div class="stat-box" style="background: var(--light-blue);">
<span id="organizationMemberNumber">{$microcopy?.indexPage?.boxes?.organizationMemberNumber}</span>
<strong>
<IconUserGroup {style} />
{@html $microcopy?.indexPage?.boxes?.organizationMemberName}
</strong>
</div>
</section>
{/if}

<h2>
<!-- choose on map -->
Expand Down Expand Up @@ -100,25 +151,45 @@
text-align: center;
font-weight: lighter;
}
section {
.stat-groups {
display: flex;
padding: 1em;
place-content: center;
gap: 2.25em;
flex-direction: column;
color: white;
}

.stat-group {
color: var(--text-color);
}

.stat-group h2 {
margin: 0 0 0.75em;
text-decoration: underline;
text-underline-offset: 0.2em;
}

.stat-row {
display: flex;
gap: 2em;
flex-wrap: wrap;
color: white;
justify-content: center;
white-space: nowrap;
}
section div {

.stat-box {
color: white;
font-size: 2ex;
text-align: center;
flex: 0 1 10%;
flex: 0 1 10em;
padding: 1ex;
border-radius: 1ex;
font-weight: bold;
display: flex;
flex-direction: column;
}
section div span {
.stat-box span {
font-size: 3ex;
display: block;
}
Expand Down
3 changes: 3 additions & 0 deletions src/signup-form/de/smallTexts_unused.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ indexPage:
register: 'Oder melde dich direkt <a href="/signup-student">
<strong>bei uns an.</strong>
</a>'
statsLayout: grouped
currentStatsTitle: Wir sind aktuell
mediatedStatsTitle: 'Wir vermittelten seit 2020:'
boxes:
locationsName: Standorte
studentsName: Studierende
Expand Down
Loading