[master]: Change text size in about first section and fix resize observer in server

This commit is contained in:
Konstantinos Triantafyllou 2024-03-19 16:53:27 +02:00
parent 5196f25525
commit 090eaa08cc
2 changed files with 22 additions and 20 deletions

View File

@ -21,7 +21,7 @@
</ng-template> </ng-template>
<ng-template #mission> <ng-template #mission>
<div class="uk-h5 uk-width-2-5@m uk-width-1-1"> <div class="uk-text-large uk-width-2-5@m uk-width-1-1">
At the heart of this platform is the mission to provide transparent, comprehensive insights into the state of Open Access in Ireland. At the heart of this platform is the mission to provide transparent, comprehensive insights into the state of Open Access in Ireland.
It serves as a key instrument for analyzing trends, identifying challenges, It serves as a key instrument for analyzing trends, identifying challenges,
and guiding policy development towards achieving an open, accessible, and sustainable research environment. and guiding policy development towards achieving an open, accessible, and sustainable research environment.
@ -144,7 +144,7 @@
<ng-container *ngTemplateOutlet="about"></ng-container> <ng-container *ngTemplateOutlet="about"></ng-container>
</div> </div>
<div [ngClass]="isMobile ? 'uk-margin-medium-top' : ''"> <div [ngClass]="isMobile ? 'uk-margin-medium-top' : ''">
<div class="uk-card uk-card-body uk-card-default uk-background-secondary uk-light uk-margin-auto pilot"> <div class="uk-card uk-card-body uk-card-default uk-background-secondary uk-light uk-margin-auto pilot uk-text-large">
<ng-container *ngTemplateOutlet="pilot"></ng-container> <ng-container *ngTemplateOutlet="pilot"></ng-container>
</div> </div>
</div> </div>

View File

@ -87,29 +87,31 @@ export class YouWeComponent implements AfterViewInit, AfterContentChecked, OnDes
ngOnDestroy() { ngOnDestroy() {
this.subscriptions.forEach(subscription => { this.subscriptions.forEach(subscription => {
if (subscription instanceof (ResizeObserver || IntersectionObserver)) { if (typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) {
subscription.disconnect(); subscription.disconnect();
} }
}); });
} }
public observeSticky() { public observeSticky() {
let resizeObs = new ResizeObserver(entries => { if(typeof ResizeObserver != 'undefined') {
entries.forEach(entry => { let resizeObs = new ResizeObserver(entries => {
setTimeout(() => { entries.forEach(entry => {
this.offset = this.calcOffset(entry.target); setTimeout(() => {
this.cdr.detectChanges(); this.offset = this.calcOffset(entry.target);
}); this.cdr.detectChanges();
}) });
}); })
this.subscriptions.push(resizeObs); });
resizeObs.observe(this.sticky.nativeElement); this.subscriptions.push(resizeObs);
this.subscriptions.push(UIkit.util.on('#sticky-' + this.id, 'active', (): void => { resizeObs.observe(this.sticky.nativeElement);
this.isSticky = true; this.subscriptions.push(UIkit.util.on('#sticky-' + this.id, 'active', (): void => {
})); this.isSticky = true;
this.subscriptions.push(UIkit.util.on('#sticky-' + this.id, 'inactive', () => { }));
this.isSticky = false; this.subscriptions.push(UIkit.util.on('#sticky-' + this.id, 'inactive', () => {
})); this.isSticky = false;
}));
}
} }
calcOffset(element) { calcOffset(element) {