git @ Cat's Eye Technologies DAM / master demo / panel.html
master

Tree @master (Download .tar.gz)

panel.html @masterraw · history · blame

<!DOCTYPE html>
<!--
SPDX-FileCopyrightText: In 2019, Chris Pressey, the original author of this work, placed it into the public domain.
For more information, please refer to <https://unlicense.org/>
SPDX-License-Identifier: Unlicense
-->
<head>
  <meta charset="utf-8">
  <title>DAM panel demo</title>
</head>
<style>
.dam-panel {
  border: 1px solid black;
  margin-bottom: 0.5em;
}
.dam-panel > button {
  letter-spacing: 3px;
}
.dam-panel > div {
  padding: 0.5em;
}
</style>
<body>

<h1>DAM panel demo</h1>

<p>DAM comes with a panel widget.  This widget provides a button by which it can
be collapsed or expanded.  The styling is just an example.</p>

<div id="installation"></div>

<script src="../dist/dam-plus-widgets-0.2.js"></script>
<script>
  var div=DAM.maker("div"), p=DAM.maker("p"), span=DAM.maker("span"), button=DAM.maker("button");
  var statusBar = span();
  function updateStatus(msg) {
    statusBar.innerHTML += "<p>clicked " + msg + "</p>";
  }
  document.getElementById('installation').appendChild(
    div(
      DAM.makePanel(
        { title: "Knobs", isOpen: false },
        button("Knob 1", { onclick: function(e) { updateStatus("Knob 1"); }}),
        button("Knob 2", { onclick: function(e) { updateStatus("Knob 2"); }})
      ),
      DAM.makePanel(
        { title: "Doohickeys", isOpen: false },
        button("Doohickey 1", { onclick: function(e) { updateStatus("Doohickey 1"); }}),
        button("Doohickey 2", { onclick: function(e) { updateStatus("Doohickey 2"); }})
      ),
      statusBar
    )
  );
</script>

</body>