Pixel UI/Delight/Zipper

Zipper

A zipped-up panel of pixel fabric over your content. Pull it open.

<piix-zipper>DOM + canvas

Drag the pull down

Something new.

Hidden until you unzip it.

Fabric
Teeth

A panel of fabric with a zip down the middle covers whatever is inside. Grab the pull and drag it down: the teeth come apart and the halves part in a V that widens above the pull, like a real zip. Let go halfway and it stays halfway. Pull it nearly to the bottom and it gives way: the halves fall aside and the content is yours. The pull is a real slider for keyboards.

Installation

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

Usage

<piix-zipper>
  <div style="height:280px;padding:32px;background:#6b4cff;color:#fff">
    <h2 style="margin:0 0 8px;font-size:40px">Something new.</h2>
    <p>Hidden until you unzip it.</p>
  </div>
</piix-zipper>

Examples

A leather wallet

Balance
$1,280

Open it from code

open() unzips all the way, close() zips it back up.

Surprise!
Open Close

API reference

AttributeWhat it doesDefault
fabricdenim leather lime inkdenim
teethbrass silver limebrass
pixelsize of one pixel, in px3
soundmake sounds even without <piix-chiptune>; off keeps it silent–

Events

EventWhen
pullthe pull moved: detail.progress, 0 at the top to 1 at the bottom
openit gave way and the content is uncovered

Methods

MethodWhat it does
open()unzip all the way
close()zip it back up

Accessibility