Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Angular component to create SVG loading placeholders

License

NotificationsYou must be signed in to change notification settings

Gbuomprisco/ngx-content-loading

Repository files navigation

Angular component to create SVG loading placeholders. Inspired by the awesomeReact Content Loader.

Have a look at a demo app onStackblitz

Install

npm i --save ngx-content-loading

Usage

Import the module in your app module

import{NgxContentLoadingModule}from'ngx-content-loading';@NgModule({imports:[NgxContentLoadingModule]})exportclassAppModule{}

Presets

Use presets

<ngx-content-loading[width]="800"><svg:gngx-facebook-preset></svg:g></ngx-content-loading><ngx-content-loading[width]="800"[height]="800"><svg:gngx-instagram-preset></svg:g></ngx-content-loading>

Available presets

- ngx-facebook-preset- ngx-instagram-preset- ngx-code-preset- ngx-list-preset- ngx-bullet-list-preset

Define custom shapes

<ngx-content-loading[speed]="'1500ms'"[width]="1000"[height]="300"[primaryColor]="'#222'"[secondaryColor]="'#5e5e5e'"><svg:gngx-circlecy="30"cx="30"r="30"ry="5"></svg:g><svg:gngx-rectwidth="150"height="10"y="10"x="70"rx="5"ry="5"></svg:g><svg:gngx-rectwidth="90"height="10"y="40"x="70"rx="5"ry="5"></svg:g><svg:gngx-rectwidth="210"height="10"y="70"x="0"rx="5"ry="5"></svg:g><svg:gngx-rectwidth="240"height="10"y="100"x="0"rx="5"ry="5"></svg:g></ngx-content-loading>

API

NameTypeDefaultDescription
speedNumber1000msAnimation speed specified in s or ms
widthNumber400viewBox width of SVG
heightNumber130viewBox height of SVG
primaryColorString#f3f3f3Background the SVG
secondaryColorString#ecebebAnimation color
preserveAspectRatioStringxMidYMid meetAspect ratio option of SVG

Transclude elements before and after the SVG element

<ngx-content-loading[speed]="'1500ms'"[width]="1000"[height]="300"[primaryColor]="'#222'"[secondaryColor]="'#5e5e5e'"><bbefore-svg>            I am transcluded before the svg</b><svg:gngx-circlecy="30"cx="30"r="30"ry="5"></svg:g><svg:gngx-rectwidth="150"height="10"y="10"x="70"rx="5"ry="5"></svg:g><svg:gngx-rectwidth="90"height="10"y="40"x="70"rx="5"ry="5"></svg:g><svg:gngx-rectwidth="210"height="10"y="70"x="0"rx="5"ry="5"></svg:g><svg:gngx-rectwidth="240"height="10"y="100"x="0"rx="5"ry="5"></svg:g><bafter-svg>            I am transcluded after the svg</b></ngx-content-loading>

Development

Fork the repo then clone it

$ git clone git@github.com:YourUsername/ngx-content-loading.git && cd ngx-content-loading

Install the dependencies

$ yarn ornpm i

Run the demo app

$ npm start

License

MIT

Please notice this is a work in progress and may not be ready for production usage.

More presets and options will follow soon :)

About

Angular component to create SVG loading placeholders

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp