Newer
Older
CamaraComercioWeb / src / app / shared / components / navbar / navbar.component.ts
Edward Florez on 20 Oct 2021 1 KB change icons and slide and list working
import { Component, OnInit } from '@angular/core';
import { faSlidersH } from '@fortawesome/free-solid-svg-icons';

@Component({
  selector: 'app-navbar',
  templateUrl: './navbar.component.html',
  styleUrls: ['./navbar.component.scss'],
})
export class NavbarComponent implements OnInit {
  icon_settings = faSlidersH;
  filters_is_visible: boolean = false;

  constructor() {}

  ngOnInit(): void {}

  showFilters() {
    const filters: any = document.querySelector('.discover__filters');
    const carousel: any = document.querySelector('.carousel_size');
    if (!this.filters_is_visible) {
      console.log('Run show filters');
      filters.classList.add('discover__filters-show');
      this.filters_is_visible = true;
      carousel.classList.add('carousel_size_show');
      console.log('listo');
    } else {
      console.log('Run hide filters');
      filters.classList.remove('discover__filters-show');
      this.filters_is_visible = false;
      carousel.classList.remove('carousel_size_show');
    }
  }
}