A vanilla JavaScript library for creating simple responsive timelines.
View the demo!
Infinite Length | Responsive |
---|---|
Copy the following files into the HEAD
of your website (be sure to set the appropriate paths):
<link rel="stylesheet" href="PATH_TO/simpletimeline.css">
<script type="text/javascript" src="PATH_TO/simpletimeline.js"></script>
Define an HTML wrapper with an id of your choice:
<div id="timeline"></div>
Simple Timeline takes 2 parameters currently, the element ID of the wrapper, and an array of objects containing your timeline data:
const TIMELINE_DATA = [
{
year: '2004',
title: 'This is a test title',
image: 'https://picsum.photos/600/400'
},
{
year: '2005',
title: 'This is a test title 2',
image: 'https://picsum.photos/600/400'
},
{
year: '1990',
title: 'This is a test title 3',
image: 'https://picsum.photos/600/400'
},
{
year: '2018',
title: 'This is a test title 4',
image: 'https://picsum.photos/600/400'
},
{
year: '2005',
title: 'This is a test title 2',
image: 'https://picsum.photos/600/400'
},
{
year: '1990',
title: 'This is a test title 3',
image: 'https://picsum.photos/600/400'
},
{
year: '2018',
title: 'This is a test title 4',
image: 'https://picsum.photos/600/400'
},
];
let timeline = new Timeline('timeline', TIMELINE_DATA);
timeline.init();
Calling timeline.init()
will then parse your data, and initialize a new timeline in the specified wrapper.
let timeline = new Timeline('timeline', TIMELINE_DATA);
timeline.init();
Simple timeline is barebones. It's left lightweight to allow easier customization of css and js.
Edit simpletimeline.css
and simpletimeline.js
to your hearts content!
Feel free to submit issues and enhancement requests.
CheshireBeane welcomes contributions to our open source projects on Github.
Please follow the following steps if you wish to contribute to this open source project!
- Fork the repo on GitHub
- Clone the project to your own machine
- Commit changes to your own branch
- Push your work back up to your fork
- Submit a Pull request so that we can review your changes
To setup this project for development:
- Clone or download the repository
- Run
npm install
inside the root of the project - In gulpfile.js change the location you are proxying:
proxy: 'localhost:8888/timeline'
- Run
gulp
to start dev environment (including scss, babel, and browserSync)
Tanner Eustice - Initial work - teustice
Cheshirebeane Team - Initial work - CheshireBeane
This project is licensed under the MIT License
Cheshirebeane