leoo

1.0.2 • Public • Published
Logo project

Leo

Create elements when you scroll

Build Status NPM version Package size Dependencies devDependencies Status code style: prettier Twitter


Content

Features

  • Create a lazy element when you scroll.
  • Create a beautiful HTML page.

Install 🐙

Add this script in your HTML to access Leo.

<script crossorigin src="https://unpkg.com/leoo@1.0.0/umd/leo.client.min.js"></script>

Exemples 🖍

new Leo("main", [
        {
            htmlContainer: 'section',
            class: ["t"]
        },
        {
            htmlContainer: "section",
            class: ["l"],
            template: `
              <h1>You can use backticks with multiples lines</h1>
              <p>An other html element</p>
            `
        },
        {
            htmlContainer: "div",
            class: ["test", "m"],
            template: `<h1>Test Leo</h1>`
        }
    ]);

Let's try this script it will create three elements in the <main></main> HTML element.

API 👩‍💻

Once you include the script you can access the Leo class.

Class new Leo(container, ops, [options]).

The leo class allow you to create lazy HTML elements.

  • container - The container where the elements would be create, can be an HTML tag, class or id.
  • ops - An array of objects.
    • class - An array of class to add to your new HTML element.
    • template - The inner html of your html.
    • htmlContainer - The HTML tag of your new element.
  • [options] - Object option
    • [options.infinite] default -> false - If true recreate infinitely elements.

License ⚖️

@MIT


Dependencies (0)

    Dev Dependencies (14)

    Package Sidebar

    Install

    npm i leoo

    Weekly Downloads

    0

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    8.06 kB

    Total Files

    3

    Last publish

    Collaborators

    • luctst