Pixel UI/Scenes/Train window

Train window

A train window with the countryside rushing past.

<piix-scene>WebGL
Colours
Sky
Fade

Look out of a train: clouds and far mountains crawl, the hills roll by faster, a fence whips past and telegraph poles flash through the frame with their wires sagging between them. The carriage sways and bumps over every rail joint. Move the pointer to look around. With sky="none" the carriage wall disappears and the window floats on your own page.

Installation

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

Usage

<piix-scene kind="train" height="460px"></piix-scene>

Examples

As a hero

Give Hero a scene and your content sits on top of it.

Now open

Somewhere new

A whole place, drawn in pixels, behind your words.

Explore

On a normal page

sky="none" cuts the sky out, so your page shows through. Add fade to dissolve an edge.

Repainted

Give it a palette and the whole scene is redrawn in those colours.

Fewer colours

levels sets how many shades each colour channel gets. 2 or 3 is very retro.

API reference

AttributeWhat it doesDefault
kindsakura alps lake galaxy rays vortex train poppies castle vistasakura
skynone makes the sky see-through–
fadetop bottom both: dissolve that edge in dithered pixels–
paletterepaint it in a palette instead of its own colours–
levelsshades per colour channel, 2 to 166
pixelsize of one pixel, in px4
dither0 for flat colour, 1 for full dither1
speed1 is normal, 0 holds still1
heightwhen not filling: px or any CSS length480px
fillsit behind the content of the parent element–

Accessibility