All Projects → camoconnell → Lazy Line Painter

camoconnell / Lazy Line Painter

Licence: mit
Lazy Line Painter - A Modern JS library for SVG path animation

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Lazy Line Painter

Nn Svg
Publication-ready NN-architecture schematics.
Stars: ✭ 805 (-58.03%)
Mutual labels:  drawing, svg
Lity
Lightweight, accessible and responsive lightbox.
Stars: ✭ 1,051 (-45.2%)
Mutual labels:  lightweight, responsive
Screenshotframes
A small CSS library for adding responsive frames (mobile device, desktop computer, or browser toolbar) to images
Stars: ✭ 18 (-99.06%)
Mutual labels:  svg, responsive
Bytesize Icons
Tiny style-controlled SVG iconset (101 icons, 12kb)
Stars: ✭ 3,662 (+90.93%)
Mutual labels:  lightweight, svg
React Native Responsive Linechart
A customizable and responsive line or area chart for react-native
Stars: ✭ 105 (-94.53%)
Mutual labels:  svg, responsive
Azure Design
Here you will find my complete Azure Visio Stencil and bonus SVG and PNG versions for all of the Azure Service and configuration items.
Stars: ✭ 470 (-75.5%)
Mutual labels:  drawing, svg
Perfect Freehand
Draw perfect pressure-sensitive freehand strokes.
Stars: ✭ 999 (-47.91%)
Mutual labels:  drawing, svg
tb-grid
tb-grid is a super simple and lightweight 12 column responsive grid system utilizing css grid.
Stars: ✭ 19 (-99.01%)
Mutual labels:  lightweight, responsive
Robopaint
The software for your friendly painting robot kit!
Stars: ✭ 105 (-94.53%)
Mutual labels:  drawing, svg
Vue Draggablecal
Not your ordinary datepicker. A Vuejs draggable date selector with a fresh responsive design, mobile ready and 0 dependencies, 17kb gzipped
Stars: ✭ 79 (-95.88%)
Mutual labels:  lightweight, responsive
Go Chart
go chart is a basic charting library in go.
Stars: ✭ 3,254 (+69.66%)
Mutual labels:  drawing, svg
Pixelfarm
From Vectors to (sub) Pixels, C# 2D Rendering Library
Stars: ✭ 120 (-93.74%)
Mutual labels:  drawing, svg
beercss
Build material design interfaces in record time... without stress for devs... 🍺💛
Stars: ✭ 223 (-88.37%)
Mutual labels:  lightweight, responsive
Macaw
Powerful and easy-to-use vector graphics Swift library with SVG support
Stars: ✭ 5,756 (+200.1%)
Mutual labels:  drawing, svg
neon
Neon is a modern VueJS design library built with Typescript and SASS
Stars: ✭ 19 (-99.01%)
Mutual labels:  lightweight, responsive
Gantt Elastic
Gantt Chart [ javascript gantt chart, gantt component, vue gantt, vue gantt chart, responsive gantt, project manager , vue projects ]
Stars: ✭ 869 (-54.69%)
Mutual labels:  svg, responsive
Quick Picture Viewer
🖼️ Lightweight, versatile desktop image viewer for Windows. The best replacement for the default Windows photo viewer.
Stars: ✭ 237 (-87.64%)
Mutual labels:  lightweight, svg
hugoblog
Hugoblog is responsive, simple, and clean that would fit for your personal blog based on Hugo Theme Static Site Generator (SSG)
Stars: ✭ 48 (-97.5%)
Mutual labels:  lightweight, responsive
Maker.js
📐⚙ 2D vector line drawing and shape modeling for CNC and laser cutters.
Stars: ✭ 1,185 (-38.22%)
Mutual labels:  drawing, svg
Mocodo
Modélisation Conceptuelle de Données. Nickel. Ni souris.
Stars: ✭ 113 (-94.11%)
Mutual labels:  drawing, svg

Lazy Line Painter

undefined undefined undefined undefined

Lazy Line Painter

lazylinepainter.info

A Modern JS library for SVG path animation

Getting Started | Documentation | Examples | Lazy Line Composer



Getting Started

Lazy Line Painter Lazy Line Painter can be setup with minimal effort as per the Quick Start instructions.

However if a GUI is more your thing, be sure to use the Lazy Line Composer.
A free Online Editor developed specifically for SVG path animation.


NPM
npm i lazy-line-painter
CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/lazy-line-painter-1.9.4.min.js"></script>
DOWNLOAD
<script src="./libs/lazylinepainter-1.9.4.js"></script>



Quick Start

The most basic, no-frills implementation;

// import LazyLinePainter
import LazyLinePainter from 'lazy-line-painter'

// select your svg
let el = document.querySelector('#my-svg')

// initialise & configure LazyLinePainter
let myAnimation = new LazyLinePainter(el, { strokeWidth : 10 })

// paint! :)
myAnimation.paint()



Documentation


Configuration

Configure on initialisation

On initialise you can pass lazylinepainter a config object as an argument containing the attritubes you wish to alter across the entire svg.
All config properties are optional.
Style attributes set in the config will override css styles.

let config = {

	// style properties
	'strokeWidth'     // Adjust width of stroke
	'strokeColor'     // Adjust stroke color
	'strokeCap'       // Adjust stroke cap  - butt  | round | square
	'strokeJoin'      // Adjust stroke join - miter | round | bevel
	'strokeOpacity'   // Adjust stroke opacity 0 - 1
	'strokeDash'      // Adjust stroke dash - '5, 5'

	// animation properties
	'delay'           // Delay before animation starts
	'reverse'         // reverse playback
	'ease'            // penner easing - easeExpoOut / easeExpoInOut / easeExpoIn etc
	'repeat'          // number of additional plays, -1 for loop
}

let svg = document.querySelector('#my-svg') 
let myAnimation = new LazyLinePainter(svg, config)

Configure individual paths

Data attributes can be used to configure style & animation properties on individual paths in the SVG.
Data attributes will override both css styles & initialisation config style attributes.

<path
	// style attribues
	data-llp-stroke-width
	data-llp-stroke-color
	data-llp-stroke-opacity
	data-llp-stroke-cap
	data-llp-stroke-join 
	data-llp-stroke-dash

	// animation attribues
	data-llp-duration (ms)
	data-llp-delay (ms) // delay offset from start of timeline
	data-llp-reverse (default = false)
	data-llp-ease (default = 'easeLinear')
/>



API Reference

Methods

Paint - accepts optional playback arguments - reverse, ease, delay

myAnimation.paint( { 
	reverse : true, 
	ease : 'easeExpoOut' 
});

Erase - paint can still be called on the element after it has been erased;

myAnimation.erase();

Pause

myAnimation.pause();

Resume

myAnimation.resume();

Set - set options after initialisation

// progress - sets path position, second param accepts a number between 0 - 1
myAnimation.set('progress', value);

Get - returns all lazylinepainter data;

myAnimation.get();

Destroy - destroys svg & lazyline instance

myAnimation.destroy();



Events

Handle events across entire animation
myAnimation.on('start', () => {});
myAnimation.on('update', () => {});
myAnimation.on('complete', () => {});
Handle all events

Called for each shape animated within the svg.
event argument contains shape properties.

myAnimation.on('start:all', (event) => {});
myAnimation.on('update:all', (event) => { console.log(event.progress); // [0-1] });
myAnimation.on('complete:all', (event) => {});
Handle targeted events.

Listen to events on specific shapes by adding the shape-id after the colon.
event argument contains shape properties.

myAnimation.on('start:id', (event) => {});
myAnimation.on('update:id', (event) => {});
myAnimation.on('complete:id', (event) => {});
Timeline playback events
myAnimation.on('pause', () => {});
myAnimation.on('resume', () => {});
myAnimation.on('erase', () => {});



Examples



Changelog

Refer to Release notes for entire Changelog



Author

Cam O'Connell @ http://merriment.info/
Email - [email protected]

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].