0.3.1 • Published 2 years ago

avris-columnist v0.3.1

Weekly downloads
2
License
SEE LICENSE IN LI...
Repository
gitlab
Last release
2 years ago

Columnist – Simple and lightweight multi-column design

Columnist achieves a nice, masonry-like, multi-column design without using absolute positioning. It doesn't move items to different columns, doesn't do any fancy maths, all it does it fixing the empty space below shorter columns – simple and lightweight!

Installation

You can either install Columnist as a node module:

$ npm i --save avris-columnist

or

$ yarn add avris-columnist

Use a CDN:

<script src="https://glcdn.githack.com/Avris/Columnist/raw/v0.2.1/dist/Columnist.min.js"></script>

Usage

HTML

<div class="columnist-wall row">
    <div class="columnist-column col-4">
        <div class="card">...</div>
    </div>
    ...
</div>

Class names are irrelevant. It's important that a column has only one child element!

JS

import Columnist from 'avris-columnist';

const columnist = new Columnist(document.querySelector('.columnist-wall'));

columnist.layout();  // apply layout 

columnist.start(100);  // run every 100 ms -- temporary solution, will be removed

columnist.destroy();  // destroy and clean up

CSS

You can add an animation like this:

<style lang="scss" scoped>
    .columnist-wall > .columnist-column {
        transition: margin-top .2s ease-in-out;
    }
</style>

Copyright

0.3.0

2 years ago

0.3.1

2 years ago

0.2.2

3 years ago

0.2.1

4 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago