All Projects → thisissoon → angular-masonry

thisissoon / angular-masonry

Licence: MIT license
A simple lightweight library to use Masonry layout in Angular

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to angular-masonry

angular-ellipsis
A simple lightweight library for Angular which removes excess text and add ellipsis symbol to end of text before text overflows container
Stars: ✭ 16 (+45.45%)
Mutual labels:  ngx, ngx-library
Ngx Masonry
Angular Module for displaying a feed of items in a masonry layout
Stars: ✭ 102 (+827.27%)
Mutual labels:  masonry, ngx
angular-inviewport
A simple lightweight library for Angular with no other dependencies that detects when an element is within the browser viewport and adds a "sn-viewport-in" or "sn-viewport-out" class to the element
Stars: ✭ 72 (+554.55%)
Mutual labels:  ngx, ngx-library
angular-scrollspy
A simple lightweight library for Angular which automatically updates links to indicate the currently active section in the viewport
Stars: ✭ 34 (+209.09%)
Mutual labels:  ngx, ngx-library
react-native-masonry-list
The Masonry List implementation which has similar implementation as the `FlatList` in React Native
Stars: ✭ 255 (+2218.18%)
Mutual labels:  masonry, masonry-layout
angular-image-loader
A simple progressive, responsive, lazy image and video loading library for Angular that detects browser size and loads the appropriate image or video only when the element is in viewport. This package requires @thisissoon/angular-inviewport
Stars: ✭ 21 (+90.91%)
Mutual labels:  ngx, ngx-library
react-plock
Plock is a responsive masonry layout implementation for React.
Stars: ✭ 118 (+972.73%)
Mutual labels:  masonry, masonry-layout
Justified Gallery
Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
Stars: ✭ 1,512 (+13645.45%)
Mutual labels:  masonry, masonry-layout
Ordnung
The 1kb alternative to Isotope
Stars: ✭ 79 (+618.18%)
Mutual labels:  masonry
Shuffle
Categorize, sort, and filter a responsive grid of items
Stars: ✭ 2,170 (+19627.27%)
Mutual labels:  masonry
Screenadaptationkit
🎨iOS rapidScreen Compatible AdapterKit(Deprecate)
Stars: ✭ 70 (+536.36%)
Mutual labels:  masonry
React Native Masonry
🙌 A pure JS react-native component to render a masonry~ish layout for images with support for dynamic columns, progressive image loading, device rotation, on-press handlers, and headers/captions.
Stars: ✭ 1,094 (+9845.45%)
Mutual labels:  masonry
Masonic
🧱 High-performance masonry layouts for React
Stars: ✭ 209 (+1800%)
Mutual labels:  masonry
Vue Masonry Wall
A pure vue responsive masonry layout without direct dom manipulation and ssr support.
Stars: ✭ 79 (+618.18%)
Mutual labels:  masonry
angular-audio-context
An Angular wrapper for the Web Audio API's AudioContext.
Stars: ✭ 20 (+81.82%)
Mutual labels:  ngx
ngx-ion-simple-mask
Input mask for Angular/Ionic
Stars: ✭ 21 (+90.91%)
Mutual labels:  ngx
Niui
Lightweight, feature-rich, accessible front-end library
Stars: ✭ 152 (+1281.82%)
Mutual labels:  masonry
React Xmasonry
Simple, minimalistic and featured native masonry layout for React JS.
Stars: ✭ 62 (+463.64%)
Mutual labels:  masonry
Opensource
♨️ 分享GitHub优秀开源项目和主流开发使用的网站、解决问题方案收集以及学习网站或资料,涵盖了iOS, macOS X, Blockchain, Flutter, Weex, H5, Games, C++, Script等多方面的内容,其中iOS大致包涵以下内容:音视频;IM和直播;逆向开发;图像相关(OpenGL, Metal, GPUImage);内购(IAP), ApplePay和第三方支付;安全攻防和应用加固, 数据安全和算法;常用第三方库;导航栏和状态栏;侧边菜单;数据持久;蓝牙, 手势指纹面容ID解锁, 图片浏览器, 扫码, 下拉和上拉刷新, 指示器, Toast, Menu, Sensor, Privacy, WebView和进度条, 动画, 选择器, 搜索, 分享, 图片验证码, 设备相关信息, 广告, 高仿项目及Demo等。
Stars: ✭ 123 (+1018.18%)
Mutual labels:  masonry
React Snuggle
An intimate and comfortable way to layout your components
Stars: ✭ 251 (+2181.82%)
Mutual labels:  masonry

Angular Masonry

Build Status Coverage Status Commitizen friendly code style: prettier

A simple, lightweight library to use Masonry in Angular

This is a simple library for Angular, implemented in the Angular Package Format v5.0.

Install

via NPM

npm i @thisissoon/angular-masonry masonry-layout --save

via Yarn

yarn add @thisissoon/angular-masonry masonry-layout

app.module.ts

import { MasonryModule } from '@thisissoon/angular-masonry';

const masonryProviders = [
  { provide: Masonry, useFactory: () => window['Masonry'] },
];

@NgModule({
  imports: [MasonryModule.forRoot(masonryProviders)],
})
export class AppModule {}

angular.json

Add the Masonry library javascript to your angular cli config

"scripts": [
  "../node_modules/masonry-layout/dist/masonry.pkgd.js"
],

Universal app (only needed if using platform-server)

app.server.module.ts

import { MasonryModule } from '@thisissoon/angular-masonry';

@NgModule({
  imports: [
    // no need to provide window['Masonry'] here as
    // a mock implemention is provided by default
    MasonryModule.forRoot(),
  ],
})
export class AppServerModule {}

Example

A full working example can be found in the src/app folder.

app.component.ts

export class AppComponent implements AfterViewInit, OnDestroy {
  @ViewChild('grid') public grid: ElementRef;

  public masonryInstance: MasonryInstance;

  public cards = cards;

  constructor(@Inject(Masonry) public masonry) {}

  ngAfterViewInit() {
    const options: MasonryOptions = {
      itemSelector: '.card',
      columnWidth: '.card',
      gutter: 20,
      fitWidth: true,
    };
    this.masonryInstance = new this.masonry(this.grid.nativeElement, options);
  }

  layout() {
    this.masonryInstance.layout();
  }

  ngOnDestroy() {
    this.masonryInstance.destroy();
  }
}

app.component.css

Styling is just an example

:host {
  display: block;
  margin-top: 1rem;
}

.grid {
  margin: 0 auto;
}

.card {
  display: inline-block;
  margin-bottom: 1rem;
  width: 18rem;
}

app.component.html

<div class="grid" #grid>
  <div class="card" *ngFor="let card of cards">
    <div class="card-body">
      <h5 class="card-title">{{ card.title }}</h5>
      <p class="card-text">{{ card.text }}</p>
      <a href="#" class="btn btn-primary">Go somewhere</a>
    </div>
  </div>
</div>

Development server

Run ng serve for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Code scaffolding

Run ng generate component component-name to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module.

Build

Run ng build to build the project. The build artifacts will be stored in the dist/ directory. Use the -prod flag for a production build.

Running unit tests

Run ng test to execute the unit tests via Karma.

Running end-to-end tests

Run ng e2e to execute the end-to-end tests via Protractor.

Making Commits

This repo uses Commitizen CLI and Conventional Changelog to create commits and generate changelogs. Instead of running git commit run git cz and follow the prompts. Changelogs will then be generated when creating new releases by running npm run release.

Making Releases

Run npm run release to create a new release. This will use Standard Version to create a new release. Standard Version will generate / update the changelog based on commits generated using Commitizen CLI, update the version number following semantic versioning rules and then commit and tag the commit for the release. Simply run git push --follow-tags origin master.

Further help

To get more help on the Angular CLI use ng help or go check out the Angular CLI README.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].