Loft

Start in four lines

Give a scene an element and a label, add a shape, pick a look.

With script

import { Scene, shapes } from './dist/loft.js';

const scene = new Scene('#stage', { label: 'A vase, turning' });
scene.add(shapes.vase(), 'clay');
scene.orbit({ auto: 0.3 });

Looks: clay, toon, ink, wire, engrave, halftone. Or describe your own fill, lines, outline and dots.

With markup alone

<script type="module" src="./dist/loft-element.js"></script>

<loft-scene shape="knot" look="ink" spin orbit
            label="A trefoil knot, turning">
</loft-scene>

The full guide, with every constructor and option, is in the project's README.

UI illustrations that lean when you point

UI illustrations (Loft calls them spots) are small pictures of interface ideas, for feature cards and empty states. They are drawn flat, but every part is a sheet standing in space. Point at a card: its parts lift off the page and a short piece of motion plays. Move toward an edge or a corner and the picture leans away under the pointer. Each design system above redraws them in its own colours, line weight, corner radius and motion.

While pointed at

    A ready-made one

    import { Spot } from './dist/loft.js';
    
    new Spot('#art', 'paste', {
      hover: 'loop',     // or 'once'
      trigger: '.card',  // hovering the card plays it
    });

    Your own

    import { Spot, kit } from './dist/loft.js';
    
    new Spot('#art', { size: [240, 200], parts: [
      { shape: kit.rect(40, 50, 160, 100, 14) },
      { shape: kit.sparkle(170, 80, 14), fill: 'accent',
        lift: 30, hover: { rz: Math.PI / 2, scale: 1.2 } },
    ] });

    Icons, lifted off the page

    The same twenty ideas from three icon libraries, each icon's own SVG read with kit.path() and stood up as a spot. Its strokes stand at different depths, so when you point at one it leans toward you, comes apart a little, and plays a short motion of its own. Pick a design system above and the icons, their tiles and their motion change with it.

    import { Spot, kit } from './dist/loft.js';
    
    new Spot('#icon', { size: [24, 24], parts: [{
      group: paths.map((d, k) => ({ shape: kit.path(d), fill: false, lift: 2 + 2.5 * k })),
      hover: [{ t: 0.5, ry: Math.PI, z: 5 }, { t: 1, ry: 2 * Math.PI, z: 0 }],  // a flip
    }] }, { hover: 'once', follow: 0.5 });

    Each shape, moulded into the next

    Every shape on this sheet is sampled onto one plain net of points, so any two can be blended point for point, however differently they were built. Drag it to turn it.

    Hull · 1 of 12

    Eight shapes, one call each

    Spin a profile, sweep a section along a path, or skin a surface over a row of frames. Each call returns a surface you can restyle, reshape and animate. Motion is geometry changing: pick one, then point at a shape to play it.

    On hover

      One Blender model, six looks

      This figure was read out of a rigged .blend file: six boxes hanging from six bones. Each box is drawn as one closed surface of degree 1, so every look and every layer treats it the way it treats a vase. Pick a look, switch its layers, and drag the figure to turn it.

      Look

      Layers of this look
      Rig

      Each part turns about the head of the bone it hangs from.