mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-09 03:46:16 -08:00
19 lines
579 B
TypeScript
19 lines
579 B
TypeScript
import type { ComponentHost, EntryInput } from './component/types'
|
|
import Component from './utils/component'
|
|
|
|
export interface LayerHost extends ComponentHost {
|
|
option: { layers: EntryInput<LayerHost>[] }
|
|
template: { $player: HTMLElement, $layer: HTMLElement }
|
|
}
|
|
|
|
export default class Layer extends Component<LayerHost> {
|
|
constructor(art: LayerHost) {
|
|
super(art)
|
|
const { option, template: { $layer } } = art
|
|
this.name = 'layer'
|
|
this.$parent = $layer
|
|
for (let index = 0; index < option.layers.length; index++)
|
|
this.add(option.layers[index]!)
|
|
}
|
|
}
|