Get started with lave CDN

MIT licensed

Lave is a minimalist library for creating responsive, flexible, and dynamic layouts using CSS grid.

Tags:
  • stringify
  • uneval
  • circular
  • json
  • serialize

Stable version

Copied!

How to start using lave CDN


<!DOCTYPE html>
<html>
<head>
    <title>Get started with lave CDN - cdnhub.io</title>
    <script src="https://cdn.cdnhub.io/lave/1.1.10/lave.js"></script>
</head>
<body>
    <button id="start">Start Lave</button>
    <script>
        const button = document.querySelector('#start');
        const canvas = document.createElement('canvas');
        const ctx = canvas.getContext('2d');

        button.addEventListener('click', () => {
            const width = 640;
            const height = 480;
            canvas.width = width;
            canvas.height = height;

            document.body.appendChild(canvas);

            Lave.init({
                canvas,
                width,
                height,
                backgroundColor: 0x000000,
            });

            Lave.scene(function () {
                ctx.fillStyle = 0xffffff;
                ctx.fillRect(0, 0, width, height);

                const circle = Lave.circle(100, 100, 50);
                Lave.drawCircle(ctx, circle);
            });

            Lave.loop();
        });
    </script>
</body>
</html>
Copied!

All versions