A Christmas Carol Reader
About this app
Read Charles Dickens' A Christmas Carol one chapter at a time with a single click of a button in-between chapters.
A Christmas Carol Reader A Christmas Carol Reader Next Chapter
Related apps
Put this on your site
Source
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>A Christmas Carol Reader</title>
<meta name="description" content="Read Charles Dickens' A Christmas Carol one chapter at a time with a single click of a button in-between chapters.">
<meta name="keywords" content="A Christmas Carol, Charles Dickens, book, reading, chapters">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<script type="text/javascript">
try {
// App Javascript Goes Here. Place your entire script content inside the try block for error handling.
document.addEventListener("DOMContentLoaded", function() {
const chapters = [
"Stave One: Marley's Ghost",
"Stave Two: The First of the Three Spirits",
"Stave Three: The Second of the Three Spirits",
"Stave Four: The Last of the Spirits",
"Stave Five: The End of It"
];
let currentChapterIndex = 0;
function displayChapter(index) {
$("#chapter-title").text(chapters[index]);
}
$("#next-chapter-btn").click(function() {
currentChapterIndex++;
if (currentChapterIndex < chapters.length) {
displayChapter(currentChapterIndex);
} else {
$("#next-chapter-btn").text("All Chapters Read");
$("#next-chapter-btn").attr("disabled", true);
}
});
displayChapter(currentChapterIndex);
});
} catch (error) {
// This will throw the error to the parent window.
throw error;
}
</script>
<style>
body {
background-color: #f8f9fa;
font-family: 'Open Sans', sans-serif;
color: #333;
}
.container {
max-width: 600px;
margin: 0 auto;
padding: 20px;
}
h1 {
text-align: center;
margin-bottom: 30px;
}
.chapter {
margin-bottom: 40px;
}
#next-chapter-btn {
width: 100%;
padding: 10px;
font-size: 18px;
font-weight: bold;
text-transform: uppercase;
background-color: #007bff;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
transition: background-color 0.3s;
}
#next-chapter-btn:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div id="main-container" class="container">
<h1>A Christmas Carol Reader</h1>
<div class="chapter">
<h3 id="chapter-title"></h3>
</div>
<button id="next-chapter-btn">Next Chapter</button>
</div>
</body>
</html>
NEW APPS
These are apps made by the community!