mkeblx / domtex

DOM elements to WebGL textures
MIT License
3 stars 0 forks source link

layers support #6

Open mkeblx opened 6 years ago

mkeblx commented 6 years ago

Split apart by layers, indicated by selectors. For depth layer concepts.

mkeblx commented 6 years ago

Example:

<div class="layer1">
  <div class="layer2">
  </div>
</div>

To get correct layer textures would need to hide layers, generate textures, then unhide & move on to next.

for (var i = 0; i < layers.length; i++) {
  var layer = layers[i];
  await page.evaluate((class) => {
      var els = document.querySelectorAll('.'+class);
      // hide/show appropriate layers
  }, layer.name);
  captureScreenshot(layer.name+'.png');
}