Git Product home page Git Product logo

timelinejs-rails's Introduction

timelineJS-rails

This gem packages the TimelineJS for easy use with the Rails asset pipleine.

General Installation

Add to the assets group in your Gemfile:

gem 'timelineJS-rails', '~> 1.1.5'

Install the gem:

bundle install

Add the Javascript to application.js:

//=require timelineJS/embed

Add the CSS to application.css

/*
 *= require timelineJS/timeline
 */

Language

The Localization language default is en English, if you want to change it, just add the Javascript to application.js:

//=require timelineJS/locale/xxx # you should change the xxx with one of the available languages below
  • af Afrikaans
  • ar Arabic (beta)
  • bg Bulgarian
  • ca Catalan
  • cz Czech
  • da Danish
  • de German / Deutsch
  • el Greek
  • en English
  • en-24hr English using 24hr time
  • es Spanish
  • eu Basque/ Euskara
  • fi Finnish
  • fo Faroese
  • fr French
  • gl Galician
  • hu Hungarian
  • hy Armenian
  • id Indonesian
  • is Icelandic
  • it Italian
  • iw Hebrew (beta)
  • ja Japanese
  • ka Georgian
  • ko Korean
  • lv Latvian
  • nl Dutch
  • no Norwegian
  • pl Polish
  • pt-br Brazilian Portuguese
  • pt Portuguese
  • ru Russian
  • sk Slovak
  • sl Slovenian
  • sr-cy Serbian (Cyrillic)
  • sr Serbian (Latin)
  • sv Swedish
  • ta Tamil
  • tl Tagalog
  • tr Turkish
  • zh-cn Chinese
  • zh-tw Taiwanese

Font Themes

If you want to set the font theme, just add the CSS to application.css:

/*
 *= require timelineJS/themes/font/xxx #you should change the xxx with one of the available font themes below
 */
  • Arvo-PTSans
  • Merriweather-NewsCycle
  • PoiretOne-Molengo
  • PTSerif-PTSans
  • DroidSerif-DroidSans
  • Lekton-Molengo
  • NixieOne-Ledger
  • AbrilFatface-Average
  • PlayfairDisplay-Muli
  • Rancho-Gudea
  • Bevan-PotanoSans
  • BreeSerif-OpenSans
  • SansitaOne-Kameron
  • Pacifico-Arimo

Example

  $(document).ready(function() {
    createStoryJS({
      type: 'timeline',
      width: '400',
      height: '500',
      source: '/events.json', //get the events.json format from https://github.com/VeriteCo/TimelineJS#file-formats
      embed_id: 'time_line'
    });
  });

Thanks

License

www.opensource.org/licenses/MIT

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.