Overlay

Overlay

new Overlay()

This class handles the overlay UI for the Blue Marble script.

Since:
  • 0.0.2
Source:
Example
const overlay = new Overlay();
overlay.addDiv({ 'id': 'overlay' })
  .addDiv({ 'id': 'header' })
    .addHeader(1, {'textContent': 'Your Overlay'}).buildElement()
    .addP({'textContent': 'This is your overlay. It is versatile.'}).buildElement()
  .buildElement() // Marks the end of the header <div>
  .addHr().buildElement()
.buildOverlay(document.body);
// Output:
// (Assume <body> already exists in the webpage)
<body>
  <div id="overlay">
    <div id="header">
      <h1>Your Overlay</h1>
      <p>This is your overlay. It is versatile.</p>
    </div>
    <hr>
  </div>
</body>