Splitting up your app into separate components and using some loops and new variables along with the ngIfs you started implementing will help make things more clean and readable:
public imageMap = {
containerThunder: {
src: 'assets/thunderstorm-min.jpg',
alt: 'Thunder Storm',
},
containerSnowDay: { src: 'assets/snowDay-min.jpg', alt: ' Snowy Day' },
containerSnowNight: {
src: 'assets/snowNight-min.jpg',
alt: ' Snowy Night',
},
...etc
<div [ngClass]="containerStyle" *ngIf="weatherData">
<ng-container *ngFor="let image of imageMap | keyvalue; trackBy: image.key">
<img
*ngIf="containerStyle === image.key"
[src]="image.value.src"
[alt]="image.value.alt"
/>
</ng-container>
...etc
</div>
The latest versions of Angular include the NgOptimizedImage
directive as part of the @angular/common
library which you could start to use to help with image lazy loading and prioritization. For even more performance improvements, you could also consider testing out Cloudinary's free tier which is incredibly easy to use for optimizing your images on the fly so that you can remove your assets from the build and slim down your bundle. Currently you have almost 10Mb of image assets in that folder which significantly impact your performance.
Hope this helps you Joe!