Pixel UI/Games & sound/Handheld

Handheld

A pocket game console, and anything you put inside plays on its screen.

<piix-handheld>DOM + canvas

SAVE FILE 1

Real HTML, shown in four shades of green.

Continue
New game
Options

Scroll with the D-pad. Press SELECT to change the screen.

Screen
Shell

A chunky handheld with a power light, a D-pad, A and B, Select and Start. Your content stays live, real HTML on its screen, recoloured into four LCD shades with a dot-matrix grid on top: links work, text can be selected. The D-pad scrolls and hops a cursor between links, A presses, B goes back to the top, Select changes the screen colours and Start boots it again. Every press fires a cancelable press event first, so you can build your own game on it.

Installation

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

Usage

<piix-handheld>
  <h3>SAVE FILE 1</h3>
  <p>Real HTML, shown in four shades of green.</p>
  <p><a href="#">Continue</a><br><a href="#">New game</a><br><a href="#">Options</a></p>
  <p>Scroll with the D-pad. Press SELECT to change the screen.</p>
</piix-handheld>

Examples

Your blog, as a cartridge

Images are recoloured too.

Piixpal launch

Patch notes 0.5

Games arrived: breakout, dialogue and this very console.

Read more

A game of your own

Cancel the press and do your own thing with the buttons.

◆

API reference

AttributeWhat it doesDefault
screendmg pocket light grape color (no filter)dmg
colorthe shell: classic lime grape ink coralclassic
widthany CSS length320px
brandthe name on the frontPiixpal
bootoff skips the boot screen–
fontpixel or inherit (your page font)pixel
soundmake sounds even without <piix-chiptune>; off keeps it silent–

Events

EventWhen
pressany button: detail.button is up, down, left, right, a, b, select or start. Cancelable.
screenSelect changed the colours: detail.screen

Methods

MethodWhat it does
press(button)press a button from code

Accessibility