Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

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

TimelineJS: A Storytelling Timeline built in JavaScript.

License

NotificationsYou must be signed in to change notification settings

lorenzoitza/TimelineJS

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Document history with TimelineJS

There are lots of timeline tools on the web but they are almost all eitherhard on the eyes or hard to use. Create timelines that are at the same timebeautiful and intuitive for users

TimelineJS is great for pulling in media from different sources. Just throw in alink from Twitter, YouTube, Flickr, Vimeo, Google Maps or SoundCloud andTimelineJS will format it to fit perfectly. More media types will be supportedin the future.

Creating one is as easy as filling in a Google spreadsheet or as detailed asJSON.

Add it to your site

Using Inline (easiest)

Place the embed code where you want the timeline to show in the<body> of your site. SeeConfig Options for a full list of what you can set in the config.

<divid="timeline-embed"></div><scripttype="text/javascript">vartimeline_config={width:'100%',height:'600',source:'path_to_json/or_link_to_googlespreadsheet',embed_id:'timeline-embed',//OPTIONAL USE A DIFFERENT DIV ID FOR EMBEDstart_at_end:false,//OPTIONAL START AT LATEST DATEstart_at_slide:'4',//OPTIONAL START AT SPECIFIC SLIDEstart_zoom_adjust:'3',//OPTIONAL TWEAK THE DEFAULT ZOOM LEVELhash_bookmark:true,//OPTIONAL LOCATION BAR HASHESfont:'Bevan-PotanoSans',//OPTIONAL FONTdebug:true,//OPTIONAL DEBUG TO CONSOLElang:'fr',//OPTIONAL LANGUAGEmaptype:'watercolor',//OPTIONAL MAP STYLEcss:'path_to_css/timeline.css',//OPTIONAL PATH TO CSSjs:'path_to_js/timeline-min.js'//OPTIONAL PATH TO JS}</script><scripttype="text/javascript"src="path_to_js/storyjs-embed.js"></script>

Using a method (advanced)

You could also initialize a new timeline using thecreateStoryJS method afterstoryjs-embed.js has been loaded

createStoryJS({type:'timeline',width:'800',height:'600',source:'path_to_json/or_link_to_googlespreadsheet',embed_id:'my-timeline'// ID of the DIV you want to load the timeline into});

Here's a simple example:

<head><!-- jQuery --><scripttype="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script><!-- BEGIN TimelineJS --><scripttype="text/javascript"src="path_to_js/storyjs-embed.js"></script><script>$(document).ready(function(){createStoryJS({type:'timeline',width:'800',height:'600',source:'path_to_json/or_link_to_googlespreadsheet',embed_id:'my-timeline'});});</script><!-- END TimelineJS --></head><body><divid="my-timeline"></div></body>

Config Options

Here are some of the options you can set in the config.

Language

langLocalizationdefault isen EnglishLanguages available:

  • enEnglish
  • frFrench
  • esSpanish
  • itItalian
  • deGerman / Deutsch
  • ptPortuguese
  • pt-brBrazilian Portuguese
  • nlDutch
  • isIcelandic
  • noNorwegian
  • bgBulgarian
  • slSlovenian
  • huHungarian
  • hyArmenian
  • foFaroese
  • czCzech
  • dkDanish
  • idIndonesian
  • plPolish
  • ruRussian
  • skSlovak
  • caCatalan
  • elGreek
  • taTamil
  • tlTagalog
  • trTurkish
  • jaJapanese
  • krKorean
  • zh-chChinese
  • zh-twTaiwanese
  • arArabic (beta)

Help us add more. Grab a copy of a language file and replace it with your languageExample language file and find your language'stwo letter code here

###Start at Endstart_at_endset to true to start the timeline on the last date.default is false

###Start at Slidestart_at_slideYou can tell TimelineJS to start at a specific slide numberdefault is 0

###Start Zoom Adjuststart_zoom_adjustThis will tweak the default zoom level. Equivilent to pressing the zoom in or zoom out button the specified number of times. Negative numbers zoom out.default is 0

###Hash Bookmarkhash_bookmarkset to true to allow bookmarking slides using the hash tagdefault is false

###DebugdebugWill log events etc to the console.default is false

###Map Style TypesDue to recent changes to the Google Maps API, you need aAPI Key in order to use custom map types.gmap_key:required in order to use maptype

maptype:

  • Stamen Maps

    • toner
    • toner-lines
    • toner-labels
    • watercolor
    • sterrain
  • Google Maps

    • ROADMAP
    • TERRAIN
    • HYBRID
    • SATELLITE

###Font Optionsfont:

  • 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
  • Or make your own

####Font Combination Preview:Font Combination Preview

File Formats

JSON:

JSON is the native data format for TimelineJS.

Remember, JSON is it is picky. A misplaced comma or quotation mark canprevent the timeline from loading properly.

Here is the full model:

{"timeline":{"headline":"The Main Timeline Headline Goes here","type":"default","text":"<p>Intro body text goes here, some HTML is ok</p>","asset":{"media":"http://yourdomain_or_socialmedialink_goes_here.jpg","credit":"Credit Name Goes Here","caption":"Caption text goes here"},"date":[{"startDate":"2011,12,10","endDate":"2011,12,11","headline":"Headline Goes Here","text":"<p>Body text goes here, some HTML is OK</p>","tag":"This is Optional","asset":{"media":"http://twitter.com/ArjunaSoriano/status/164181156147900416","thumbnail":"optional-32x32px.jpg","credit":"Credit Name Goes Here","caption":"Caption text goes here"}}],"era":[{"startDate":"2011,12,10","endDate":"2011,12,11","headline":"Headline Goes Here","text":"<p>Body text goes here, some HTML is OK</p>","tag":"This is Optional"}]}}

JSONP :

Timeline can use a variation of JSONP to allow you to easily load data across different domains.

To allow this to happen, the file must end with the extention.jsonp

Here is the full model:

storyjs_jsonp_data={"timeline":{"headline":"The Main Timeline Headline Goes here","type":"default","text":"<p>Intro body text goes here, some HTML is ok</p>","asset":{"media":"http://yourdomain_or_socialmedialink_goes_here.jpg","credit":"Credit Name Goes Here","caption":"Caption text goes here"},"date":[{"startDate":"2011,12,10","endDate":"2011,12,11","headline":"Headline Goes Here","text":"<p>Body text goes here, some HTML is OK</p>","tag":"This is Optional","asset":{"media":"http://twitter.com/ArjunaSoriano/status/164181156147900416","thumbnail":"optional-32x32px.jpg","credit":"Credit Name Goes Here","caption":"Caption text goes here"}}],"era":[{"startDate":"2011,12,10","endDate":"2011,12,11","headline":"Headline Goes Here","tag":"This is Optional"}],"chart":[{"startDate":"2011,12,10","endDate":"2011,12,11","headline":"Headline Goes Here","value":"28"}]}}

Google Docs:

If you don’t want to mess with JSON, fire up Google Docs and build yourtimeline in a spreadsheet. It’s as simple as dropping a date, text, and linksinto the appropriate columns in TimelineJS’s template.

You can find the template here:TimelineJS Google Spreadsheet Template

There are only a couple things you need to know in order to create a timelineusing Google Docs:

  1. Make the spreadsheet public:
    Google Docs are automatically set to private but the spreadsheet must bepublic.
Click the blue “Share” button on the top right-hand corner. In the “Sharesettings” window, you’ll see the private setting of the spreadsheet: click“Change...”. In the Visibility options window, choose “Public on the Web” andsave.
  1. Publish to the Web
    Under the File menu, select “Publish to the Web.”
In the next window, check the box next to “Automatically republish whenchanges are made.” Uncheck all other boxes. Click “start publishing.” Thiswill give you the URL to embed in your HTML file.
  1. Copy/paste the Web URL into your TimelineJS HTML file
    After you publish the spreadsheet, Google Docs will generate a link to thefile. Copy the link for the Web Page option (as opposed to PDF, HTML, XLS,etc.), then paste it into the timeline’s HTML file (seeAdd it to your site )

Storify:

Support for Storify is still in it's early stages. It works though. Just paste a link to the storify story as the source.

Media

Included in the zip file is a kitchen sink example. This timeline shows how toincorporate the different media types from different services like Twitter,YouTube, Flickr, Instagram, TwitPic, Wikipedia, Dailymotion, SoundCloud and Vimeo.

Just copy and paste the address of the media from the browser barinto the media parameter. TimelineJS will auto-magically pull in the media via their api andformat it.

Best practices

Tips and tricks to best utilize TimelineJS

  1. Keep it light - don’t get bogged down by text or other elements
  2. Pick stories that have a strong chronological narrative. It does not work well for stories that need to jump around in the timeline.
  3. Include events that build up to major occurrences, not just the major events.
  4. Don't overwhelm the user. A timeline with hundreds of events is probably not the best use of the format.

License

This Source Code Form is subject to the terms of the Mozilla PublicLicense, v. 2.0. If a copy of the MPL was not distributed with thisfile, You can obtain one athttp://mozilla.org/MPL/2.0/.

About

TimelineJS: A Storytelling Timeline built in JavaScript.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp