[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 #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.
It serves as a key instrument for analyzing trends, identifying challenges,
and guiding policy development towards achieving an open, accessible, and sustainable research environment.
@ -144,7 +144,7 @@
<ng-container *ngTemplateOutlet="about"></ng-container>
</div>
<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>
</div>
</div>

View File

@ -87,29 +87,31 @@ export class YouWeComponent implements AfterViewInit, AfterContentChecked, OnDes
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof (ResizeObserver || IntersectionObserver)) {
if (typeof ResizeObserver != 'undefined' && subscription instanceof ResizeObserver) {
subscription.disconnect();
}
});
}
public observeSticky() {
let resizeObs = new ResizeObserver(entries => {
entries.forEach(entry => {
setTimeout(() => {
this.offset = this.calcOffset(entry.target);
this.cdr.detectChanges();
});
})
});
this.subscriptions.push(resizeObs);
resizeObs.observe(this.sticky.nativeElement);
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;
}));
if(typeof ResizeObserver != 'undefined') {
let resizeObs = new ResizeObserver(entries => {
entries.forEach(entry => {
setTimeout(() => {
this.offset = this.calcOffset(entry.target);
this.cdr.detectChanges();
});
})
});
this.subscriptions.push(resizeObs);
resizeObs.observe(this.sticky.nativeElement);
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;
}));
}
}
calcOffset(element) {