Skip to content

Commit

Permalink
Make the style of the projector titles customizable (#1156)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-schieder committed May 25, 2022
1 parent d1b2225 commit 3231e26
Show file tree
Hide file tree
Showing 9 changed files with 80 additions and 9 deletions.
18 changes: 15 additions & 3 deletions client/src/app/domain/models/mediafiles/mediafile.constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,32 @@ export const LogoDisplayNames: { [place in LogoPlace]: string } = {
pdf_ballot_paper: `PDF ballot paper logo`
};

export type FontPlace = 'regular' | 'italic' | 'bold' | 'bold_italic' | 'monospace' | 'chyron_speaker_name';
export type FontPlace =
| 'regular'
| 'italic'
| 'bold'
| 'bold_italic'
| 'monospace'
| 'chyron_speaker_name'
| 'projector_h1'
| 'projector_h2';
export const FontDisplayNames: { [place in FontPlace]: string } = {
regular: `Font regular`,
italic: `Font italic`,
bold: `Font bold`,
bold_italic: `Font bold italic`,
monospace: `Font monospace`,
chyron_speaker_name: `Chyron speaker name`
chyron_speaker_name: `Chyron speaker name`,
projector_h1: `Projector h1`,
projector_h2: `Projector h2`
};
export const FontDefaults: { [place in FontPlace]: string } = {
regular: `assets/fonts/fira-sans-latin-400.woff`,
italic: `assets/fonts/fira-sans-latin-400italic.woff`,
bold: `assets/fonts/fira-sans-latin-500.woff`,
bold_italic: `assets/fonts/fira-sans-latin-500italic.woff`,
monospace: `assets/fonts/roboto-condensed-bold.woff`,
chyron_speaker_name: `assets/fonts/fira-sans-latin-400.woff`
chyron_speaker_name: `assets/fonts/fira-sans-latin-400.woff`,
projector_h1: `assets/fonts/fira-sans-latin-500.woff`,
projector_h2: `assets/fonts/fira-sans-latin-400.woff`
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="data" class="agenda-slide-wrapper">
<h1>{{ 'Agenda' | translate }}</h1>
<h1 class="projector_h1">{{ 'Agenda' | translate }}</h1>

<div
*ngFor="let item of data.data.items"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ <h3>{{ recommender }}</h3>
<!-- Title -->
<div class="spacer" [ngStyle]="{ height: projector.show_header_footer ? '50px' : '0' }"></div>
<div [ngClass]="{ slidetitle: data.data.show_sidebox }">
<h1>
<h1 class="projector_h1">
<span *ngIf="data.data.number">{{ data.data.number }}:</span>
{{ getTitleWithChanges() }}
</h1>
<!-- recommendation referencing motions -->
<h2 *ngIf="data.data.show_sidebox && data.data.recommendation_referencing_motions">
<h2 *ngIf="data.data.show_sidebox && data.data.recommendation_referencing_motions" class="projector_h2">
<span>{{ 'Referring motions' | translate }}</span>
:
<span *ngFor="let titleInformation of referencingMotions; let last = last">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div *ngIf="data">
<h1>
<h1 class="projector_h1">
<span *ngIf="data.data.item_number">{{ data.data.item_number }} &middot;</span>
{{ data.data.title }}
</h1>
Expand Down
12 changes: 12 additions & 0 deletions client/src/app/site/pages/meetings/services/load-font.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ export class LoadFontService {
this.setNewFontFace(`OSFont ChyronName`, chyronFont);
}
});

this.mediaManageService.getFontUrlObservable(`projector_h1`).subscribe(projectorH1 => {
if (projectorH1) {
this.setNewFontFace(`OSFont projectorH1`, projectorH1);
}
});

this.mediaManageService.getFontUrlObservable(`projector_h2`).subscribe(projectorH2 => {
if (projectorH2) {
this.setNewFontFace(`OSFont projectorH2`, projectorH2);
}
});
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ export class MediaManageService {
}

public get allFontPlaces(): FontPlace[] {
return [`regular`, `italic`, `bold`, `bold_italic`, `monospace`, `chyron_speaker_name`];
return [
`regular`,
`italic`,
`bold`,
`bold_italic`,
`monospace`,
`chyron_speaker_name`,
`projector_h1`,
`projector_h2`
];
}

private readonly logoUrlSubjects: { [place in LogoPlace]?: BehaviorSubject<string | null> } = {};
Expand Down
9 changes: 9 additions & 0 deletions client/src/assets/styles/font-variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ $font-weight-monospace: 400;
$font-chyronname: 'OSFont ChyronName';
$font-chyronname-src: url('../fonts/fira-sans-latin-400.woff') format('woff');
$font-weight-chyronname: 400;

/** Projector H1 Font */
$font-projectorH1: 'OSFont projectorH1';
$font-projectorH1-src: url('../fonts/fira-sans-latin-500.woff') format('woff');

/** Projector H2 Font */
$font-projectorH2: 'OSFont projectorH2';
$font-projectorH2-src: url('../fonts/fira-sans-latin-400.woff') format('woff');

16 changes: 16 additions & 0 deletions client/src/assets/styles/fonts.scss
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,19 @@
font-weight: $font-weight-chyronname;
src: $font-chyronname-src;
}

/** projectorH1 */
@font-face {
font-family: $font-projectorH1;
font-style: normal;
font-display: swap;
src: $font-projectorH1-src;
}

/** projectorH2 */
@font-face {
font-family: $font-projectorH2;
font-style: normal;
font-display: swap;
src: $font-projectorH2-src;
}
15 changes: 14 additions & 1 deletion client/src/assets/styles/projector.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,26 @@
line-height: 1.1em;
}

.slidetitle > h1,
h1.projector_h1 {
&, * {
font-family: $font-projectorH1;
}
}

h2 {
line-height: 40px;
font-weight: normal;
}

.slidetitle > h2,
h2.projector_h2 {
&, * {
font-family: $font-projectorH2;
}
}

h3 {
color: #222;
margin-bottom: 10px;
}

Expand Down

0 comments on commit 3231e26

Please sign in to comment.