1.1.6 • Published 7 years ago

flowly-js v1.1.6

Weekly downloads
15
License
MIT
Repository
github
Last release
7 years ago

Flowly-JS

Demo is here

result

Setup

Add Flowly.js to your project with npm install --save https://github.com/hyde2able/Flowly-js or yarn add https://github.com/hyde2able/Flowly-js.

Now, you can require or import the library, depending on your favorite workflow.

const Flowly = require('flowly-js')
// or
import Flowly from 'flowly-js'

Of course you can also simply copy over the compiled file from the dist folder and include it like any other 3rd party script. Make sure to run npm install in the Flowly folder to compile the project. Or download the precompiled files from the release section.

<script src="dist/flowly.js"></script>
<!-- or if you prefer minified -->
<script src="dist/flowly.min.js"></script>

Usage

var flowly = new Flowly('#container', {
  padding: { top: 10, bottom: 10 },
  duration: 3000
});

// Add Text
flowly.addText({
  body: 'message',
  size: 50,
  duration: 1500,
  color: '#333333',
  shadow: '#000000'
})

// Add Image
flowly.addImage({
  url: './images/fish.png',
  width: size + 'px',
  height: (size * 100 / 205 ) + 'px',
  duration: duration
})

Behaviours

Options

var options = {
  text: {
    weight: 'bold',
    size  : 56,
    color : '#000',
    shadow: '#fff',
    className: 'flowly-text',
    whiteSpace: 'nowrap' || 'pre',
    zIndex: 2147483647,
    fontFamily: '-apple-system, BlinkMacSystemFont, "Helvetica Neue", "Yu Gothic", YuGothic, "ヒラギノ角ゴ ProN W3", Hiragino Kaku Gothic ProN, Arial, "メイリオ", Meiryo, sans-serif'
  },
  image: {
    height: '200px',
    width : 'auto',
    className: 'flowly-image',
  },
  padding: {
    left: 0,
    right: 0,
    top: 0,
    bottom: 0,
  },
  disable: false,
  duration: 2000,
  easing: 'linear',
  direction: 'right',
}

var flowly = new Flowly('#container', options)
PropertyValuesDefaultDescription
text.weightbold or normalboldtext font weight
text.sizeinteger56text font size
text.colorrgb#000text font color
text.shadowrgb#ffftext shadow color
text.classNamestringflowly-texttext className
text.whiteSpacenowrap or prenowrapfont whiteSpace
text.zIndexinteger2147483647text zIndex
text.fontFamilystring...text fontFamily
image.heightstring200pximage width
image.heightstringautoimage height
image.classNamestringflowly-imageimage className
padding.topinteger0padding top
padding.bottominteger0padding bottom
padding.leftinteger0padding left
padding.rightinteger0padding right
disabletrue or falsefalsedisable flag
durationinteger2000animation duration
easingstringlinearanimation easing
durationright or left or top or bottomrightanimation direction

Add Text Options

var options = {
  body: 'text message',
  color: '#000000'
  shadow: '#ffffff',
  size: 50,
  weight: 'bold',
  fontFamily: 'monospace',
  className: 'classname',
};

flowly.addText(options)
PropertyValuesDefaultDescription
bodystring[required]text body
sizeinteger56text font size
colorrgb#000text font color
shadowrgb#ffftext shadow color
weightbold or normalboldtext font weight
classNamestringflowly-texttext className
fontFamilystring...text fontFamily

Add Image Options

var options = {
  src: './images/hoge.png',
  width: '200px',
  height: '300px',
  className: 'classname',
};

flowly.addImage(options)
PropertyValuesDefaultDescription
srcstring[required]image src
widthstring200pximage width
heightstringautoimage height
classNamestringflowly-imageimage className

Build

As a prerequisite, you will need gulp installed: npm install -g gulp

npm install
npm run build

gulp will watch the source directory for changes and automatically build the dist files, serving some demo files with live reload.

Authors

@pokohide

License

Licensed under MIT. Enjoy.

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago