Skip to content

Commit 3eba431

Browse files
Merge pull request #2489 from asfadmin/Yoreley-DS6242
Yoreley ds6242 - satellite graphic dark mode
2 parents 64b6529 + c398ce1 commit 3eba431

4 files changed

Lines changed: 22 additions & 9 deletions

File tree

src/app/components/header/timeseries-header/timeseries-header.component.html

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,23 @@
3939
}
4040
</span>
4141
<span class="line-of-site-icon">
42-
<img
43-
ngSrc="assets/satellite-graphics/sat-1.png"
44-
class="invert-icon"
45-
[class.flip-icon]="flightDesc"
46-
alt="Line of Site"
47-
height="70"
48-
width="84"
49-
/>
42+
@if (isDarkMode$ | async) {
43+
<img
44+
ngSrc="assets/satellite-graphics/sat-1-dark.png"
45+
[class.flip-icon]="flightDesc"
46+
alt="Line of Site"
47+
height="70"
48+
width="84"
49+
/>
50+
} @else {
51+
<img
52+
ngSrc="assets/satellite-graphics/sat-1.png"
53+
[class.flip-icon]="flightDesc"
54+
alt="Line of Site"
55+
height="70"
56+
width="84"
57+
/>
58+
}
5059
</span>
5160
<span class="line-of-site-icon-text">
5261
{{ 'INCIDENCE_ANGLE' | translate }}: 29° &ndash; 46°

src/app/components/header/timeseries-header/timeseries-header.component.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, OnInit, OnDestroy, inject } from '@angular/core';
22
import { SubSink } from 'subsink';
3+
import { map } from 'rxjs/operators';
34

45
import { Store } from '@ngrx/store';
56
import { AppState } from '@store';
@@ -8,7 +9,7 @@ import * as searchStore from '@store/search';
89
import * as mapStore from '@store/map';
910
import * as filtersStore from '@store/filters';
1011

11-
import { ScreenSizeService } from '@services';
12+
import { ScreenSizeService, ThemingService } from '@services';
1213
import { MapDrawModeType, MapInteractionModeType } from '@models';
1314
import * as models from '@models';
1415
import { NgOptimizedImage, AsyncPipe } from '@angular/common';
@@ -35,8 +36,10 @@ import { TranslateModule } from '@ngx-translate/core';
3536
export class TimeseriesHeaderComponent implements OnInit, OnDestroy {
3637
private store$ = inject<Store<AppState>>(Store);
3738
private screenSize = inject(ScreenSizeService);
39+
private themingService = inject(ThemingService);
3840

3941
public breakpoint$ = this.screenSize.breakpoint$;
42+
public isDarkMode$ = this.themingService.theme$.pipe(map(theme => theme === 'dark'));
4043
public breakpoints = models.Breakpoints;
4144
public isDrawing = false;
4245
public flightDirections: models.FlightDirection[];

src/app/services/theming.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,6 @@ export class ThemingService {
2929
// removes all classes from body, probably not best for later on
3030
body.removeAttribute('class');
3131
body.classList.add(themeName);
32+
this.theme$.next(themeName === 'theme-dark' ? 'dark' : 'light');
3233
}
3334
}
151 KB
Loading

0 commit comments

Comments
 (0)