Pixel UI/Overlays/Dialog

Dialog

A modal that dissolves in, pixel by pixel, in any look.

<piix-dialog>WebGL
Deploy

Deploy to production?

This publishes 14 changes. You can roll back at any time.

Deploy now

It's the browser's own <dialog> underneath, so focus is trapped inside, Escape closes it and focus goes back where it came from. The panel is drawn on the GPU and dissolves in over a dithered backdrop. Anything with data-piix-open="its id" opens it; anything inside with data-close closes it, and so does clicking the backdrop.

Installation

<!-- once, anywhere on the page: every component -->
<script src="https://cdn.jsdelivr.net/npm/piixpal@0.6/piixpal.min.js"></script>

Usage

<piix-glow-button data-piix-open="deploy">Deploy</piix-glow-button>

<piix-dialog id="deploy">
  <h2>Deploy to production?</h2>
  <p>This publishes 14 changes. You can roll back at any time.</p>
  <piix-glow-button data-close>Deploy now</piix-glow-button>
</piix-dialog>

Examples

Frosted glass

With look="glass" the page behind blurs through the panel.

Open

Frosted

Everything behind me is blurred, the rim and the glare are pixels.

Lovely

Terminal

Run

rm -rf node_modules?

This frees 1.2 GB. It also means a long npm install.

yes, do it

API reference

AttributeWhat it doesDefault
openopen it; or call .show() and .close()–
lookglow chrome glass riso crt: the whole style. See Looksglow
palettethe colours of the lightviolet, or the look's own
widthany CSS length520px
pixelsize of one pixel, in px3

Events

EventWhen
openwhen it opens
closewhen it closes, however that happened

Accessibility