Setting style elements according to conditions when page first loads

Hi everyone. I am trying to style my images according to some conditions and trying to show them when the page opens/loads.

design_on_const(){
var cover1 = document.getElementById("cover1");
var cover2 = document.getElementById("cover2");
var cover3 = document.getElementById("cover3");
var cover4 = document.getElementById("cover4");
var cover5 = document.getElementById("cover5");
cover3.style['visibility']="hidden";
cover4.style['visibility']="hidden";
cover5.style['visibility']="hidden";
if (localStorage.getItem('gardirop_model') == 'surgulu' && localStorage.getItem('gardirop_size') == '132') {
  cover1.style['top'] = "0px";
  cover1.style['left'] = "14%";
  cover1.style['maxHeight'] = "98%";

  cover2.style['top'] = "0px";
  cover2.style['left'] = "51%";
  cover2.style['maxHeight'] = "98%";
}
if (localStorage.getItem('gardirop_model') == 'surgulu' && localStorage.getItem('gardirop_size') == '220') {
  cover1.style['top'] = "0px";
  cover1.style['left'] = "10%";
  cover1.style['maxHeight'] = "97%";

  cover2.style['left'] = "52%";
  cover2.style['maxHeight'] = "91%";
  cover2.style['top'] = "6px";
}
if (localStorage.getItem('gardirop_model') == 'menteseli' && localStorage.getItem('gardirop_size') == '132') {
  cover1.style['top'] = "-1%";
  cover1.style['left'] = "13%";
  cover1.style['maxHeight'] = "100%";

  cover2.style['top'] = "-1%";
  cover2.style['left'] = "50%";
  cover2.style['maxHeight'] = "100%";
}
//menteseli 220cm
if (localStorage.getItem('gardirop_model') == 'menteseli' && localStorage.getItem('gardirop_size') == '220') {

  cover1.style['top'] = "0px";
  cover1.style['left'] = "8%";
  cover1.style['width'] = "20%";
  cover1.style['maxHeight'] = "98%";

  cover2.style['top'] = "-1%";
  cover2.style['left'] = "24%";
  cover2.style['maxHeight'] = "99%";
  cover2.style['width'] = "20%";

  cover3.style['visibility'] = "visible";
  cover4.style['visibility'] = "visible";
  cover5.style['visibility'] = "visible";
}
console.log("done!");
 }

This is my function which sets values to elements and i have called this function like “this.design_on_const();” in constructor, ionViewDidLoad, ngOnInit, ionViewDidEnter and the other lifecycle events. It does work, writes “done” to console but my styles does not shown.
Local storage values had been setted in previous pages so according to this values i have to show my images in this page when page loads. But images dont seem as I wanted, they just shown randomly placed on the page like they take default values. How can I style them in best way or where should I call my function in?
There are my images in html:

     <ion-col width-25>
    <div style="position: relative;display: inline-block;">
      <img class="gardirop" src="{{gardirop}}" style="width: 90%;" />

      <img id="cover1" class="cover_1" src="{{gardirop_cover_1}}" /> 
      <img id="cover2" class="cover_2" src="{{gardirop_cover_2}}" />

      <img id="cover3" class="cover_3" src="{{gardirop_cover_3}}" />
      <img id="cover4" class="cover_4" src="{{gardirop_cover_4}}" />
      <img id="cover5" class="cover_5" src="{{gardirop_cover_5}}" />
    </div>

  </ion-col>

And my .scss file:

.gardirop {
z-index: 1;
position: relative;

 }
.cover_1 {
z-index: 10;
position: absolute;
 }
.cover_2 {
z-index: 20;
position: absolute;
display: inline-block;
   }
.cover_3 {
z-index: 20;
position: absolute;
top:-4px;
left:41%;
max-height: 99%;
display: inline-block;
width: 20%;
}
.cover_4 {
z-index: 20;
position: absolute;
top:6px;
left:60%;
max-height: 90%;
display: inline-block;

}
.cover_5 {
z-index: 20;
position: absolute;
top:7px;
left:74%;
max-height: 89%;
display: inline-block;
width: 16%; }

There’s no need for DOM access here, and it’s very unidiomatic. Bind to the style property instead.

<template ngFor let-cover [ngForOf]="covers">
  <img [src]="cover.src" [style]="cover.style">
</template>

interface Cover {
  src: string;
  style: string;
}

covers: Cover[];

Now just put a bunch of Covers into covers, and assign to the src and style property of each as desired. Angular’s change detection and property binding will reflect it in the DOM automatically.

Thank you for your reply, I have solved the issue.