//
//  TSMirrorToolView.swift
//  Girly
//
//  Created by 100Years on 2025/1/8.
//

class TSMirrorToolView: TSBaseView {
    
    //改变亮度
    var changedBrightnessComplete:((CGFloat)->Void)?
    //改变图形 model
    var selectedColorComplete:((TSMirrorItemModel)->Void)?{
        didSet {
            shapePickerView.selectedColorComplete = selectedColorComplete
        }
    }
    
    
    lazy var brightnessSlider: TSCommonSliderView = {
        let slider = TSCommonSliderView()
        slider.leftImageView.image = UIImage(named: "brightness")
        slider.changedValueComplete = { [weak self] num in
            guard let self = self else { return }
            changedBrightnessComplete?(num)
        }
        return slider
    }()
    
    
    lazy var shapePickerView: TSMirrorShapePickerView = {
        let shapePickerView = TSMirrorShapePickerView()
        shapePickerView.dataArray = kMirrorShared.shapes
        return shapePickerView
    }()
    
    override func creatUI() {
        addSubview(brightnessSlider)
        brightnessSlider.snp.makeConstraints { make in
            make.leading.equalTo(16)
            make.top.equalTo(0)
            make.trailing.equalTo(-16)
            make.height.equalTo(24)
        }
        
        addSubview(shapePickerView)
        shapePickerView.snp.makeConstraints { make in
            make.top.equalTo(brightnessSlider.snp.bottom).offset(20)
            make.leading.equalTo(40)
            make.trailing.equalTo(-33)
            make.height.equalTo(52)
        }
    }
    
}
