PHP 8.2.30
Preview: browser.html Size: 1.05 KB
/proc/thread-self/root/home/byroehnu/.trash/node_modules11/png-js/examples/browser.html

<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <title>PNG.js example</title>
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <script src="../zlib.js"></script>
  <script src="../png.js"></script>  
</head>

<body>
  <h2>PNG.js browser demo</h2>  
  <div id="buttons"></div>
  <canvas id="png-canvas"></canvas>
  
  <script>
      var files = ['ball.png',
        'chompy.png',
        'djay-indexed.png',
        'djay.png',
        'laptop.png',
        'loading.png',
        'spinfox.png',
        'trees.png']
      var buttonsEl = document.getElementById('buttons')
      buttonsEl.innerHTML = files.reduce((result, file) => {
        return result.concat(`<button data-file="${file}">${file}</button>`)
      }, '')
      buttonsEl.addEventListener('click', (e) => {        
        var file = e.target.dataset.file
        if (!file) {
          return
        }
        PNG.load(`../images/${file}`, document.getElementById('png-canvas'))
      })
    </script>
</body>

</html>

Directory Contents

Dirs: 0 × Files: 1

Name Size Perms Modified Actions
1.05 KB lrw-r--r-- 2026-02-14 19:19:12
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).