Compare commits

...

36 Commits

Author SHA1 Message Date
Lim Chee Aun
a475ca962e
Merge pull request #57 from hongshaoyang/patch-1
update server command to use python3
2018-10-14 21:09:40 +08:00
hongshaoyang
76939d17ce
update server command to use python3
why are you still on python2?! JK.
2018-10-14 19:51:47 +08:00
Lim Chee Aun
61fc68ff7d Code revamp
- Better sticky position for the years headers
- Replace blur effect with gradients
- Fix scrolling bug on Chrome
2015-08-06 00:37:10 +08:00
Lim Chee Aun
8830cdf2a5 Remove Nitrous hack button 2015-08-06 00:32:32 +08:00
Lim Chee Aun
e3a5a8dfa3 Link to cheeaun.life 2015-07-15 09:01:54 +08:00
Lim Chee Aun
96a1c04c86 Slight aesthetic changes 2015-06-19 00:41:37 +08:00
Lim Chee Aun
58a482b264 Merge pull request #48 from habi/patch-1
Corrected Typo
2014-07-05 11:34:46 +08:00
David Haberthür
d5b2d36249 Corrected Typo 2014-07-04 13:56:49 +02:00
Lim Chee Aun
92ddd78cd5 Merge pull request #47 from laktek/master
Added Hack on Nitrous.IO button to the README.
2014-04-17 10:25:11 -07:00
Lakshan Perera
49d53cc9e6 Added Hack on Nitrous.IO button to the README. 2014-04-17 22:43:15 +08:00
Lim Chee Aun
56673381b0 Add step to update repo description URL 2013-12-09 21:19:00 +08:00
Lim Chee Aun
ddc50342dd Add more steps to setup Life 2013-12-09 21:09:00 +08:00
Lim Chee Aun
482248b5ca Space/code cleanup, add -moz-border-sizing for Firefox 2013-12-09 20:52:37 +08:00
Lim Chee Aun
31c9d0fef4 Merge branch 'vertical-stretch' of github.com:rileyjshaw/life into rileyjshaw-vertical-stretch 2013-12-09 20:45:06 +08:00
Lim Chee Aun
d39537a8ee Merge pull request #40 from rileyjshaw/cursor
CSS: Eliminate wildcard selector and change cursor to grab to complement #3797166
2013-12-08 17:37:40 -08:00
Riley Shaw
00e41408d0 CSS: Eliminate wildcard selector and change cursor to grab to complement #3797166 2013-12-08 19:40:09 -05:00
Riley Shaw
669c5b56be Extend dividers to bottom of page 2013-12-08 19:31:22 -05:00
Lim Chee Aun
4ffb7be6ce Code cleanup and fixes 2013-12-09 07:45:15 +08:00
Lim Chee Aun
3eb32b25e1 Merge branch 'master' of github.com:mathijspb/life into mathijspb-master 2013-12-09 07:36:38 +08:00
Lim Chee Aun
2b75452d54 Merge pull request #36 from DerAtrox/master
changed http:// to https://
2013-12-07 06:56:13 -08:00
DerAtrox
7e8a1e3935 changed http:// to https:// 2013-12-07 14:44:21 +01:00
Lim Chee Aun
473e77daa7 Missing s 2013-12-06 07:48:24 +08:00
Lim Chee Aun
ab448c4a56 Add doc for hideAge option 2013-12-06 00:02:17 +08:00
Lim Chee Aun
f34fedd43a s/6/7 2013-12-05 23:41:03 +08:00
Lim Chee Aun
c57c3f93d0 Merge pull request #29 from laktek/master
Users may need to force push
2013-12-05 07:39:53 -08:00
Lim Chee Aun
424e3934a3 Merge pull request #12 from nfvs/support-for-markdown-links
Added support for Markdown style links. Fixes issue #5.
2013-12-04 19:47:24 -08:00
Nuno Santos
50601de379 Merge remote-tracking branch 'cheeaun/master' into support-for-markdown-links
Conflicts:
	index.html
2013-12-04 19:39:14 +01:00
Mathijs Peerboom
3797166296 adding vertical scrolling by mouse slide 2013-12-04 11:25:39 +01:00
Mathijs Peerboom
cf8ac230fb Merge remote-tracking branch 'upstream/master' 2013-12-04 10:44:03 +01:00
Nuno Santos
f9f8f79425 Added a more meaningful example. 2013-12-04 08:51:56 +01:00
Nuno Santos
91f10f9b40 Use ? instead of * to match tooltips in Markdown links. 2013-12-03 20:12:56 +01:00
Nuno Santos
66197d54ee Added support for tooltips inside Markdown links. 2013-12-03 19:59:14 +01:00
Mathijs Peerboom
1f821e15a0 added missing semicolon 2013-12-03 14:39:38 +01:00
Mathijs Peerboom
efbe4cdf90 adding horizontal scrolling by mouse slide 2013-12-03 13:55:36 +01:00
Nuno Santos
3e98a54109 Fixed Markdown link detection to support multiple instances.
Fixes issue #5.
2013-12-02 23:57:09 +01:00
Nuno Santos
c41100a58a Added support for Markdown style links. Fixes issue #5. 2013-12-02 23:18:20 +01:00
3 changed files with 119 additions and 29 deletions

View File

@ -3,7 +3,7 @@ Life
This is something that I've wanted to build for a long time. It's a **timeline of important events** in my life, visualized in a way my mind always imagine it. There was something called [**Lifepath.me**](http://dcurt.is/facebook-timelines-and-lifepath-me-4) but now it's gone. How about Facebook timeline? Meh.
So, this is it. Have a look at [cheeaun.github.io/life](http://cheeaun.github.io/life).
So, this is it. Have a look at [cheeaun.life](http://cheeaun.life/).
Features
--------
@ -28,9 +28,12 @@ How to setup your own *Life*
2. `git checkout -b gh-pages` (or any branch name you like)
3. Make a copy of `life.example.md`, rename it to `life.md`.
4. Add your life events into `life.md`.
5. Preview it on a local server. Use [`python -m SimpleHTTPServer`](http://docs.python.org/2/library/simplehttpserver.html) or [`http-server`](https://github.com/nodeapps/http-server).
5. Preview it on a local server. Use [`python -m http.server`](https://docs.python.org/3/library/http.server.html) or [`http-server`](https://github.com/nodeapps/http-server).
6. Commit `life.md` (not in `master` branch).
6. `git push origin gh-pages -f` and publish to [GitHub Pages](http://pages.github.com/).
7. `git push origin gh-pages -f` and publish to [GitHub Pages](http://pages.github.com/).
8. Update the website link in your GitHub repo description.
9. Tell the world about your Life.
10. Add your Life to the [Lives](https://github.com/cheeaun/life/wiki/Lives) page.
How to upgrade your *Life*
--------------------------
@ -60,6 +63,7 @@ The configuration:
- `customStylesheetURL` - (*string*, default to `null`) Path to a custom stylesheet file, for those who doesn't like the default *theme*.
- `yearLength` - (*number*, default to `120`) The width of the year grids, in pixels.
- `hideAge` - (*boolean*, default to `false`) Option to hide age from year axis.
Datetime "syntax"
-----------------
@ -74,7 +78,7 @@ Datetime "syntax"
Other people's Lives
--------------------
Here's [a compilation of Lives from the people who has forked Life](https://github.com/cheeaun/life/wiki/Lives).
Here's [a compilation of Lives from the people who have forked Life](https://github.com/cheeaun/life/wiki/Lives).
License
-------

View File

@ -3,28 +3,33 @@
<title>Life</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:400,300">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:400,300">
<style>
*{
font-family: Open Sans, Helvetica, Arial, sans-serif;
}
body{
font-family: Open Sans, Helvetica, Arial, sans-serif;
color: #fff;
background-color: #384047;
margin: 0;
padding: 0;
font-size: 12px;
-webkit-text-size-adjust: none;
position: relative;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
cursor: default;
}
a{
color: #fff;
}
header{
z-index: 3;
background: linear-gradient(to bottom, rgba(56,64,71,0) 0%,rgba(56,64,71,.5) 20%,rgba(56,64,71,1) 50%,rgba(56,64,71,.5) 80%,rgba(56,64,71,0) 100%);
position: fixed;
bottom: 0;
left: 0;
margin: 0;
padding: 20px;
padding: 10px;
}
header a{
margin-left: 1em;
@ -38,7 +43,6 @@ header a:hover{
h1{
display: inline;
font-size: 20px;
font-weight: normal;
line-height: 1em;
opacity: .5;
z-index: 3;
@ -46,27 +50,67 @@ h1{
white-space: nowrap;
}
#life{
padding-top: 40px;
padding-bottom: 5em;
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
overflow: auto;
-webkit-overflow-scrolling: touch;
cursor: -webkit-grab;
cursor: -moz-grab;
cursor: grab;
}
#life section.year{
box-sizing: border-box;
border-left: 1px dashed rgba(255,255,255,.1);
color: rgba(255,255,255,.3);
#life-years{
position: absolute;
top: 0;
bottom: 0;
padding-left: 10px;
padding-top: 10px;
white-space: nowrap;
pointer-events: none;
}
#life-years .year{
display: inline-block;
box-sizing: border-box;
color: #fff;
font-weight: 300;
white-space: nowrap;
box-sizing: border-box;
height: 100%;
border-left: 1px dashed rgba(255,255,255,.2);
}
#life-years .year:first-child{
border-left: 0;
}
#life-years .year span{
background: linear-gradient(to bottom, rgba(56,64,71,1) 30%,rgba(56,64,71,0) 100%);
display: block;
padding: 10px;
position: -webkit-sticky;
position: sticky;
top: 0;
z-index: 3;
}
#life-years .year span i{
opacity: .5;
font-style: normal;
}
#life-events{
padding-top: 40px;
padding-bottom: 5em;
position: relative;
}
#life-events:after{
content: '';
display: block;
clear: left;
}
#life .event{
padding-right: 20px;
padding-bottom: 5px;
vertical-align: middle;
white-space: nowrap;
float: left;
clear: left;
}
#life .event b{
font-weight: normal;
@ -247,11 +291,21 @@ h1{
}
}
// Parse Markdown links in the text
// credit: http://stackoverflow.com/a/9268827
var link = null;
while(link = d.text.match(/\[([^\]]+)\]\(([^)"]+)(?: \"([^\"]+)\")?\)/)) {
var link_attr = "";
if (link[3] !== undefined) {
link_attr = " title='" + link[3] + "'";
}
d.text = d.text.replace(link[0], "<a href='" + link[2] + "'" + link_attr + ">" + link[1] + "</a>");
}
return '<div class="event" style="margin-left: ' + offset.toFixed(2) + 'px">'
+ '<div class="time" style="width: ' + width.toFixed(2) + 'px"></div>'
+ '<b>' + d.time.title + '</b> ' + d.text + '&nbsp;&nbsp;'
+ '<b>' + d.time.title + '</b> ' + d.text
+ '</div>';
return '';
},
renderYears: function(firstYear, lastYear){
var dayLength = life.config.yearLength/12/30;
@ -259,10 +313,10 @@ h1{
var days = 0;
var hideAge = life.config.hideAge;
for (var y=firstYear, age = 0; y<=lastYear+1; y++, age++){
html += '<section class="year" style="left: ' + (days*dayLength).toFixed(2) + 'px">'
+ y + (hideAge ? '' : (' (' + age + ')'))
+ '</section>';
days += (y % 4 == 0) ? 366 : 365;
var days = (y % 4 == 0) ? 366 : 365;
html += '<div class="year" style="width: ' + (days*dayLength).toFixed(2) + 'px"><span>'
+ y + (hideAge ? '' : (' <i>(' + age + ')</i>'))
+ '</span></div>';
}
return html;
},
@ -282,14 +336,46 @@ h1{
});
life.firstYear = firstYear;
var html = life.renderYears(firstYear, lastYear);
var html = '<div id="life-events">';
// 'comment_' class name is to hide it from Safari Reader
html += '<div id="life-years" class="comment_">' + life.renderYears(firstYear, lastYear) + '</div>';
data.forEach(function(d){
html += life.renderEvent(d);
});
html += '</div>';
life.$el.innerHTML = html;
}
};
var slider = {
startingMousePostition: {},
containerOffset: {},
init: function(){
window.addEventListener('mousedown', function(event){
slider.startingMousePostition = {
x: event.clientX,
y: event.clientY
};
slider.containerOffset = {
x: life.$el.scrollLeft,
y: life.$el.scrollTop
};
window.addEventListener('mousemove', slider.slide);
});
window.addEventListener('mouseup', function(event){
window.removeEventListener('mousemove', slider.slide);
});
},
slide: function(event){
event.preventDefault();
var x = slider.containerOffset.x + (slider.startingMousePostition.x - event.clientX);
var y = slider.containerOffset.y + (slider.startingMousePostition.y - event.clientY);
life.$el.scrollLeft = x;
life.$el.scrollTop = y;
}
};
life.start();
slider.init();
})();
</script>

View File

@ -1,8 +1,8 @@
@USERNAME' life
@USERNAME's life
===============
- 24/02/1955 Born
- ~1968 Summer job
- 03/1976 Built a computer
- 01/04/1976 Started a company
- 01/04/1976 Started a [company](http://en.wikipedia.org/wiki/Apple_Inc. "Apple Inc.")
- 04/1976-2011 Whole bunch of interesting events