<body>
<header>
<h1>minimal-masonry</h1>
- <button class="info-button">
+ <button class="info-button" command="show-modal" commandfor="info-dialog">
<svg role="img" aria-labelledby="info" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<title id="info">Open info dialog</title>
<circle cx="12" cy="12" r="10"></circle>
</button>
</header>
- <dialog>
+ <dialog id="info-dialog">
<h1>What is this?</h1>
<p>This website is a minimal reference implementation of the <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Grid_Layout/Masonry_Layout">masonry layout</a>.</p>
<p><a href="https://github.com/ardislu/minimal-masonry">Click here</a> to view the source code on GitHub.</p>
<main></main>
<script>
- const infoDialog = document.querySelector('dialog');
- document.querySelector('.info-button').addEventListener('click', e => infoDialog.showModal());
-
const main = document.querySelector('main');
main.insertAdjacentHTML('beforeend', '<div><h1></h1></div>'.repeat(20));