diff --git a/src/app/pages/algorithms/fractal/fractal.component.html b/src/app/pages/algorithms/fractal/fractal.component.html index be75397..5a530cd 100644 --- a/src/app/pages/algorithms/fractal/fractal.component.html +++ b/src/app/pages/algorithms/fractal/fractal.component.html @@ -31,7 +31,11 @@
zoom_out - + @if (sliderReady()) { + + } @else { +
+ } zoom_in
diff --git a/src/app/pages/algorithms/fractal/fractal.component.ts b/src/app/pages/algorithms/fractal/fractal.component.ts index 8116a13..9ca9c5f 100644 --- a/src/app/pages/algorithms/fractal/fractal.component.ts +++ b/src/app/pages/algorithms/fractal/fractal.component.ts @@ -1,4 +1,4 @@ -import {Component, OnInit, signal} from '@angular/core'; +import {afterNextRender, Component, OnInit, signal} from '@angular/core'; import {Information} from '../information/information'; import {MatCard, MatCardContent, MatCardHeader, MatCardTitle} from '@angular/material/card'; import {TranslatePipe} from '@ngx-translate/core'; @@ -39,6 +39,13 @@ import {clampZoom, initialView, iterationsForZoom, zoomAroundPoint} from './frac styleUrl: './fractal.component.scss', }) export class FractalComponent implements OnInit { + // ngx-slider throws on the server (no layout APIs), so render it in the browser only + readonly sliderReady = signal(false); + + constructor() { + afterNextRender(() => this.sliderReady.set(true)); + } + algoInformation: AlgorithmInformation = { title: 'FRACTAL.EXPLANATION.TITLE', entries: [ diff --git a/src/app/pages/algorithms/pendulum/pendulum.component.html b/src/app/pages/algorithms/pendulum/pendulum.component.html index c9f42e0..b9c5950 100644 --- a/src/app/pages/algorithms/pendulum/pendulum.component.html +++ b/src/app/pages/algorithms/pendulum/pendulum.component.html @@ -5,39 +5,43 @@
-
-
-

{{ 'PENDULUM.TRAIL_DECAY_TIME' | translate }}

- -
-
-

{{ 'PENDULUM.ATTRACTION' | translate }}

- -
+ @if (sliderReady()) { +
+
+

{{ 'PENDULUM.TRAIL_DECAY_TIME' | translate }}

+ +
+
+

{{ 'PENDULUM.ATTRACTION' | translate }}

+ +
-
-

{{ 'PENDULUM.L1_LENGTH' | translate }}

- -
-
-

{{ 'PENDULUM.L2_LENGTH' | translate }}

- -
+
+

{{ 'PENDULUM.L1_LENGTH' | translate }}

+ +
+
+

{{ 'PENDULUM.L2_LENGTH' | translate }}

+ +
-
-

{{ 'PENDULUM.M1_MASS' | translate }}

- -
-
-

{{ 'PENDULUM.M2_MASS' | translate }}

- -
+
+

{{ 'PENDULUM.M1_MASS' | translate }}

+ +
+
+

{{ 'PENDULUM.M2_MASS' | translate }}

+ +
-
-

{{ 'PENDULUM.DAMPING' | translate }}

- -
-
+
+

{{ 'PENDULUM.DAMPING' | translate }}

+ +
+
+ } @else { +
+ }