Skip to content

Instantly share code, notes, and snippets.

@russianryebread
Last active November 5, 2015 14:30
Show Gist options
  • Select an option

  • Save russianryebread/bbcd13782963b92e95e7 to your computer and use it in GitHub Desktop.

Select an option

Save russianryebread/bbcd13782963b92e95e7 to your computer and use it in GitHub Desktop.
Track your Bible Reading
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bible Reading Plan</title>
<style type="text/css">
html {
font-family: "Open Sans";
color: #666;
font-weight: 100;
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.container {
max-width: 900px;
min-width: 320px;
margin: 10px auto;
}
.section {
float: left;
width: 48%;
padding: 1%;
}
.chapter {
float: left;
width: 35px;
height: 35px;
border: 2px solid #e4e4e4;
text-align: center;
margin: 2.5px;
line-height: 35px;
cursor: pointer;
border-radius: 3px;
}
.chapter:hover {
background: #e4e4e4;
}
.chapter.read {
background: #57b7ff;
border: 2px solid #57b7ff;
color: white;
font-weight: bold;
}
h1 small {
font-size: 65%;
font-weight: 400;
line-height: 1;
color: #888;
}
.row, h2 {
clear: both;
}
h3 {
margin-top: 50px
}
@media (max-width: 600px) {
.section {
float: none;
width: 100%;
}
}
</style>
<link href='https://fonts.googleapis.com/css?family=Open+Sans:400,300,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="container">
<h1>Bible Reading Plan <small class="info"></small></h1>
<!--
<blockquote>
MY DEAR FLOCK, -- The approach of another year stirs up within me new desires for your
salvation, and for the growth of those of you who are saved. "God is my record how
greatly I long after you all in the bowels of Jesus Christ." What the coming year is to
bring forth who can tell? There is plainly a weight lying on the spirits of all good men,
and a looking for some strange work of judgment upon this land. There is a need now
to ask that solemn question -- "If in the land of peace wherein thou trustedst, they
wearied thee, then how wilt thou do in the swelling of Jordan?"
Those believers will stand firmest who have no dependence upon self or upon
creatures, but upon Jehovah our Righteousness.
<cite>Robert Murry M‘Cheyne</cite>
</blockquote>
-->
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript">
var bible = {
"Old Testament": {
"Genesis" : 50,
"Exodus" : 40,
"Leviticus" : 27,
"Numbers" : 36,
"Deuteronomy" : 34,
"Joshua" : 24,
"Judges" : 21,
"Ruth" : 4,
"1 Samuel" : 31,
"2 Samuel" : 24,
"1 Kings" : 22,
"2 Kings" : 25,
"1 Chronicles" : 29,
"2 Chronicles" : 36,
"Ezra" : 10,
"Nehemiah" : 13,
"Esther" : 10,
"Job" : 42,
"Psalms" : 150,
"Proverbs" : 31,
"Ecclesiastes" : 12,
"Song of Songs" : 8,
"Isaiah" : 66,
"Jeremiah" : 52,
"Lamentations" : 5,
"Ezekiel" : 48,
"Daniel" : 12,
"Hosea" : 14,
"Joel" : 3,
"Amos" : 9,
"Obadiah" : 1,
"Jonah" : 4,
"Micah" : 7,
"Nahum" : 3,
"Habakkuk" : 3,
"Zephaniah" : 3,
"Haggai" : 2,
"Zechariah" : 14,
"Malachi" : 4
},
"New Testament": {
"Matthew" : 28,
"Mark" : 16,
"Luke" : 24,
"John" : 21,
"Acts" : 28,
"Romans" : 16,
"1 Corinthians" : 16,
"2 Corinthians" : 13,
"Galatians" : 6,
"Ephesians" : 6,
"Philippians" : 4,
"Colossians" : 4,
"1 Thessalonians" : 5,
"2 Thessalonians" : 3,
"1 Timothy" : 6,
"2 Timothy" : 4,
"Titus" : 3,
"Philemon" : 1,
"Hebrews" : 13,
"James" : 5,
"1 Peter" : 5,
"2 Peter" : 3,
"1 John" : 5,
"2 John" : 1,
"3 John" : 1,
"Jude" : 1,
"Revelation" : 22
},
}
var ot_count = 929;
var nt_count = 260;
var total_count = ot_count + nt_count;
$(function() {
var html = "";
for (sections in bible) {
var numberOfChapters, i = 1;
var id = '';
var nl = "\n";
html += '<div class="section"><h2>'+sections+'</h2>';
for (book in bible[sections]) {
numberOfChapters = bible[sections][book]
id = book.replace(' ', '').toLowerCase();
html += '<div class="row">'+nl+'<h3>'+book+'</h3>';
html += '<div id="'+id+'" class="chapters">';
for (i=1; i<=numberOfChapters; i++) {
html += '<div id="'+id+i+'" data-book="'+id+'" data-chapter="'+i+'" class="chapter">'+i+'</div>'+nl;
}
html += "</div></div>"+nl+'<div class="row"></div>';
}
html += "</div></div>";
}
$('.container').append(html);
loadSaved();
$('.chapter').click(function(){
$(this).toggleClass("read");
saveRead($(this));
calculateRead()
});
function saveRead(element){
var id = String(element.data("book")) + String(element.data("chapter"))
if (element.hasClass("read")) {
localStorage.setItem(id, 1);
} else {
localStorage.removeItem(id);
}
}
function loadSaved(){
$.each(localStorage, function(key, value){
$("#"+key).addClass("read");
});
calculateRead()
}
function calculateRead(){
var totalRead = ((localStorage.length / total_count) * 100);
if(totalRead < 100 && totalRead > 0){
$(".info").html("(You have read "+totalRead.toPrecision(2)+"% of the Bible.)")
} else {
$(".info").html("");
}
}
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment