import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
  selector: 'app-page-ip',
  standalone: true,
  imports: [CommonModule],
  templateUrl: './page-ip.html',
  styleUrls: ['./page-ip.scss']
})
export class PageIpComponent {
  uploadImage() {
    alert('图片上传功能需要后端支持，此处为前端演示');
  }

  analyzeImage() {
    alert('正在分析图片颜色...');
  }

  onDragOver(event: DragEvent) {
    event.preventDefault();
    const uploadArea = event.target as HTMLElement;
    uploadArea.style.borderColor = '#3498db';
    uploadArea.style.backgroundColor = 'rgba(52, 152, 219, 0.1)';
  }

  onDragLeave(event: DragEvent) {
    const uploadArea = event.target as HTMLElement;
    uploadArea.style.borderColor = '#bdc3c7';
    uploadArea.style.backgroundColor = '#f9f9f9';
  }
}