add layer

This commit is contained in:
Harvey Zack committed 2018-10-15 11:31:06 +08:00
1 parent e4518d21ce
commit 4327787895
15 files changed
+256 -134

No files matched your search

+11
View File
@@ -1,5 +1,16 @@
let id = 0;
export default class Layers {
constructor(art) {
this.art = art;
}
add(option) {
const { refs } = this.art;
id++;
refs.$layers.insertAdjacentHTML('beforeend', `
<div data-layer-index="${id}" class="art-layer art-layer-${option.name}" style="z-index: ${option.index || id}">
${option.html}
</div>
`);
}
}