import { Component, OnInit, Input, ElementRef, ViewChild } from '@angular/core';
import { IonContent, IonIcon } from '@ionic/angular/standalone';
import { CommonModule } from '@angular/common';
import { addIcons } from 'ionicons';
import { sunny, cloudy, rainy, snow } from 'ionicons/icons';

@Component({
  selector: 'app-weather',
  templateUrl: './weather.component.html',
  styleUrls: ['./weather.component.scss'],
  standalone: true,
  imports: [IonIcon, IonContent, CommonModule],
})
export class WeatherComponent implements OnInit {
  @Input() position: string = '南昌';
  @Input() temp: number = 21;

  iconClass: string = 'weather-icon';

  onMouseEnter(): void {
    this.iconClass = 'weather-icon hover';
  }

  onMouseLeave(): void {
    this.iconClass = 'weather-icon';
  }
  ngOnInit(): void {}
  constructor() {
    addIcons({ sunny, cloudy, rainy, snow });
  }
}
