Help equip tomorrow's Bible students today!

Open a book

Open a book arrow
    Books for Bible Colleges stack of books
    Books for Bible Colleges stack of books
      ×
      content here
      `; openModal(content); } function pray(){ window.open("https://uk.langham.org/get-involved/pray/"); } function menu(){ if ($("#MenuIcon").hasClass("image-yellow")){ $("#MenuIcon").removeClass("image-yellow"); }else{ $("#MenuIcon").addClass("image-yellow"); } $("#Menu").toggle(500,"swing"); } function resizeWindow(){ var bookshelfHeight = $(".bookshelf").first().height(); var bookshelfWidth = $(".bookshelf").first().width(); var bookshelfHeight = $(".bookshelf").first().height(); var windowWidth = $(window).width(); var windowHeight = $(window).height(); var bookWidth = BOOK_WIDTH_LARGE; var bookHeight = BOOK_HEIGHT_LARGE; if (windowHeight >= 950){ // Large screen bookHeight = BOOK_HEIGHT_LARGE; }else if (windowHeight >= 780 && windowHeight < 950){ // Tablet bookHeight = BOOK_HEIGHT_MEDIUM; }else{ // Mobile phone bookHeight = BOOK_HEIGHT_SMALL; } if (windowWidth >= 950){ // Large screen bookWidth = BOOK_WIDTH_LARGE; }else if (windowWidth >= 430 && windowWidth < 950){ // Tablet bookWidth = BOOK_WIDTH_MEDIUM; }else{ // Mobile phone bookWidth = BOOK_WIDTH_SMALL; } $(".bk-list li.bk-li") .width(bookWidth) .height(bookHeight); $(".bk-list li.bk-li").show(); // Max books per bookshelf var maxBooks = Math.floor(Math.floor($(".bookshelf:first").width()) / ($(".bk-list li.bk-li:first").width() + parseInt($(".bk-list li.bk-li").css("margin-left")))); if (maxBooks === undefined) maxBooks = 4; $(".bk-list li.bk-li:nth-child(n+" + (maxBooks+1) + "):nth-last-child(n)").hide(); } function openBook(id){ $(".book-" + id).trigger("click"); $("#Menu").hide(); } function closeBooksAction(excludeBookElement){ $(".bk-book").not(excludeBookElement).removeClass("bk-viewinside").removeClass("bk-outside").parent(); var existingExcludeBookZIndex = $(excludeBookElement).closest("li.bk-li").css("z-index"); var newExcludeBookZIndex = existingExcludeBookZIndex - 100; //$(excludeBookElement).closest("li.bk-li").css("z-index",newExcludeBookZIndex); reorderBooksZIndex(); setTimeout(function(){ $(".bk-book").not(excludeBookElement).css({ left: "0px" }); setTimeout(function(){resizeWindow();},100); },BOOK_CLOSE_TIME); } function reorderBooksZIndex(){ $("li.bk-li").each(function(index){ var totalBooks = $("li.bk-li").length; $(this).css("z-index",(totalBooks - 1) - index); }); } function openFullscreen(elem) { if (elem.requestFullscreen) { elem.requestFullscreen(); } else if (elem.webkitRequestFullscreen) { /* Safari */ elem.webkitRequestFullscreen(); } else if (elem.msRequestFullscreen) { /* IE11 */ elem.msRequestFullscreen(); } } function closeFullscreen() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.webkitExitFullscreen) { /* Safari */ document.webkitExitFullscreen(); } else if (document.msExitFullscreen) { /* IE11 */ document.msExitFullscreen(); } } function watchVideos(){ setTimeout(function(){videos(VIDEOS_YOUTUBE);},1200); } window.addEventListener("resize", (event) => {resizeWindow();}); $(document).ready(function() { // Init // Books for (var x = 1; x <= 2; x++) { var bookshelf = (x === 1)?BOOKSHELF.filter(o=>o.type === "top"):BOOKSHELF.filter(o=>o.type === "bottom"); for (var i = 0; i < bookshelf.length; i++) { var book = bookshelf[i] var pages = []; // Create pages $("#PagesContent .page-content[data-id='" + book.id + "']").each(function(){ book.pages.push($(this).html()); }); // Build pages book.pages.forEach((page, pageIndex) => { var pageNumber = pageIndex + 1; pages.push(`
      ${page}
      `); }); book.spine = (book.spine.length > 0)?book.spine:book.title; $(".bookshelf:nth-child(" + x + ") .bk-list").append(`
    • ${book.title}

      ${pages.join("")}
      ${book.back}

      ${book.spine}

    • `); } // Actions $(".bookshelves .modal-image").on("click", function(){ var image = $(this).get(0).outerHTML; var caption = $(this).data("caption"); if (caption !== undefined && caption.length > 0) caption = `

      ${caption}

      `; var content = ``; openModal(content); }); } // Reset $("#ModalClose").on("click", function() { closeModal(); }); // Fullscreen $(".fullscreen").on("click", function() { if (!isFullScreen) { openFullscreen(document.documentElement); isFullScreen = true; $(".fullscreen").addClass("fullscreen-true"); } else { closeFullscreen(); isFullScreen = false; $(".fullscreen").removeClass("fullscreen-true"); } }); // Hide full screen button if in iframe if (window.location !== window.parent.location) $(".fullscreen").hide(); // Videos $(".video").on("click", function(){ var id = $(this).data("id"); var name = $(this).data("name"); var aspectRatio = $(this).data("aspectratio"); video(id, name, aspectRatio); }); // Show books Books.init(1); Books.init(2); window.dispatchEvent(new Event('resize')); // Book size $(".bk-back,.bk-front,.bk-cover-back").width(BOOK_FRONT_WIDTH); $(".bk-cover").width(BOOK_COVER_WIDTH); $(".bk-right").hide(); $(".bk-page,.bk-page").width(BOOK_PAGE_WIDTH); // Menu items $(".menu-item").on("click", function(){ var id = $(this).data("id"); openBook(id); if (id === "watch") watchVideos(); }) // Donate $(".donate").on("click", function(){donate();}); // Book fillers $(".books-filler").on("click", function(){menu();}); // Show then hide instructions if (!DEMO) $("#Instructions").fadeIn(1000); setTimeout(function(){ $("#Instructions").fadeOut(500); },3500); $("#Instructions").on("click", function(){$(this).hide()}); // Show share icons $("#Menu").hide(); $("#MenuContainer").fadeIn(); // Scrolling background if (ANIMATE_BACKGROUND){ var backgroundIndex = 0; setInterval(function(){ $("body").css("background-position","left 0% bottom " + backgroundIndex + "%"); backgroundIndex = backgroundIndex + ANIMATE_BACKGROUND_SPEED; if (backgroundIndex > 400) backgroundIndex = 0; },50); } // Image cache $("img").each(function(){ var src = $(this).prop("src"); src = src + "?" + APP_VERSION; $(this).prop("src", src); }); // Events $(document).on("BOOK_OPEN", function(e){ var book = e.detail.book; var bookshelfNumber = e.detail.bookshelfNumber; var transEndEventName = e.detail.transEndEventName; var bookParentLI = $(book).closest("li.bk-li"); var bookParentLIZIndex = parseInt(bookParentLI.css("z-index")); var newBookParentLIZIndex = (bookParentLIZIndex < 100)?100:0; var newBookParentLIZIndexExtra = bookParentLIZIndex + newBookParentLIZIndex; closeBooksAction(book); reorderBooksZIndex(); toggleLastBooks(book, bookshelfNumber, true); $(book) .data("opened", true) .addClass('bk-outside').on(transEndEventName, function() { $(this).off(transEndEventName).addClass('bk-viewinside'); }); bookParentLI.css("z-index", newBookParentLIZIndexExtra); $("#Logo").fadeOut(300); }); $(document).on("BOOK_CLOSE", function(e){ var book = e.detail.book; var bookshelfNumber = e.detail.bookshelfNumber; var transEndEventName = e.detail.transEndEventName; toggleLastBooks(book, bookshelfNumber, false); $(book) .data("opened", false) .removeClass('bk-viewinside').on(transEndEventName, function() { $(this).off(transEndEventName).removeClass('bk-outside'); }); $("#Logo").fadeIn(1000); }); function toggleLastBooks(book, bookshelfNumber, opening){ // Edit position of final and penultimate books to make them fit on smaller screens if (bookshelfNumber === undefined) bookshelfNumber = 1; var parent = $(book).closest("li"); var lastBookVisible = $(".bookshelf:nth-child(" + bookshelfNumber + ") li.bk-li:visible").last().find(".bk-book").get(0); var penultimateBookVisible = $(".bookshelf:nth-child(" + bookshelfNumber + ") li.bk-li:visible").last().prev().find(".bk-book").get(0); if (book === lastBookVisible || book === penultimateBookVisible){ if (opening){ $(book).css({ left: "-125px" }); }else{ setTimeout(function(){ $(".bk-book").css({ left: "0px" }); setTimeout(function(){resizeWindow();},100); },BOOK_CLOSE_TIME); } } } // Show modal (if applicable) if (URL_PARAMS.has("showVideos")) watchVideos(); });