Compare commits

...

4 Commits

Author SHA1 Message Date
Jacob Haddon
86f6396bdb aded a pop function to the pages to help prevent short or blank pages. 2024-11-09 18:34:35 -05:00
Jacob Haddon
f918b39f5a added text about SEEK AND HIDE; webmaster email; header for ABOUT 2024-10-02 16:17:54 -04:00
Jacob Haddon
315d32dfea removed 'local' from font-face to fix issues on Firefox on Linux 2024-09-13 20:56:49 -04:00
Jacob Haddon
038bb5e641 added more books to be processed 2024-09-13 20:16:55 -04:00
3 changed files with 55 additions and 16 deletions

View File

@ -32,7 +32,7 @@ use DateTime;
# While these have json formatting, they are JS files
my $complete_books_js = "complete_books.js";
my $book_pages_js = "book_pages2.js";
my $book_pages_js = "book_pages.js";
# number of lines in a page
my $number_of_lines = 31;
@ -68,6 +68,34 @@ my @books = (
url => "https://www.gutenberg.org/ebooks/121",
file => "books/northangerabbey.txt",
chapter_marker => "CHAPTER"
},
{
title => "The Picture of Dorian Gray",
author => "Oscar Wilde",
url => "https://www.gutenberg.org/ebooks/174",
file => "books/doriangray.txt",
chapter_marker => "CHAPTER"
},
{
title => "The Mysteries of Udolpho",
author => "Ann Ward Radcliffe",
url => "https://www.gutenberg.org/ebooks/3268",
file => "books/udolpho.txt",
chapter_marker => "CHAPTER"
},
{
title => "The Enchanted Castle",
author => "E. Nesbit",
url => "https://www.gutenberg.org/ebooks/34219",
file => "books/enchantedcastle.txt",
chapter_marker => "CHAPTER"
},
{
title => "Frankenstein",
author => "Mary Wollstonecraft Shelley",
url => "https://www.gutenberg.org/ebooks/84",
file => "books/frankenstein.txt",
chapter_marker => "Chapter"
}
); # books hash
@ -77,6 +105,7 @@ my $json = new JSON;
# Make the books into pages
###################################
# iterate over books
my $k = 0;
foreach (@books) {
@ -88,9 +117,11 @@ foreach (@books) {
my @chapters = split('\n' . $books[$k]{'chapter_marker'}, $book);
# go through each chapter and make pages based on number of desired lines
#iterate over chapters
my $j = 0;
my @page_text;
foreach (@chapters) {
my @chapter_lines = split(/\r\n/, $chapters[$j]);
@ -175,6 +206,9 @@ for ( my $l; $l < $number_of_pages; $l++){
# pull out a random chapter from that book
my $chapter_select = int(rand($chapter_list));
# pop off the last page, as it may be blank, or short
pop @{$books[$book_list]{'pages'}[$chapter_select]};
# get the number of pages in the chapter
my $page_list = @{$books[$book_list]{'pages'}[$chapter_select]};
# pull out a random page from the chapter

View File

@ -217,9 +217,16 @@ $(document).ready(function(){
<div id="poem_list"></div>
</section>
<section>
<h2>More Blackout Poetry Awaits!</h2>
<p>Check out our site for more blackout poetry, including HIDE AND SEEK a Blackout Poetry workbook by Bram Stoker nominated poet Jessica McHugh!</p>
<p><a href="http://apokrupha.com/blackout">apokrupha.com/blackout</a></p>
</section>
<footer>
<h2>About</h2>
<p>This site made with <a href="https://jquery.com/">jQuery</a>, PHP and <a href="https://www.barebones.com/products/bbedit/">BBEdit</a> with help from <a href="https://espressoapp.com/">Espresso</a>.</p>
<p><a href="https://code.jacobhaddon.com/jake/smhn">Code</a> by Jacob Haddon - license <a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPLv3.0</a> - <a href="https://Apokrupha.com/BlackOut">Apokrupha.com/Blackout</a></p>
<p><a href="https://code.jacobhaddon.com/jake/dbpc">Code</a> by Jacob Haddon - license <a href="https://www.gnu.org/licenses/gpl-3.0.en.html">GPLv3.0</a> - <a href="https://Apokrupha.com/BlackOut">Apokrupha.com/Blackout</a></p>
</footer>
<!--Help Section-->
@ -274,7 +281,7 @@ $(document).ready(function(){
<h1>Contact</h1>
<p>webmaster@ </p>
<p>webmaster@dailyblackoutpoetrychallenge.com</p>
<p>We are intolerant of intolerance. If you see something hateful, transphobic, homophobic, racist, or the like, let us know.</p>

View File

@ -11,21 +11,19 @@ Written by Jacob Haddon https://jacobhaddon.com
*/
@font-face {
font-family: "lora";
src: local("Lora"),
url("fonts/Lora/webfonts/Lora-Regular.woff2") format('woff2'),
url("fonts/Lora/variable/Lora-VariableFont_wght.ttf") format('truetype');
font-style: normal;
font-weight: normal;
font-family: "lora";
src: url("fonts/Lora/webfonts/Lora-Regular.woff2") format('woff2'),
url("fonts/Lora/variable/Lora-VariableFont_wght.ttf") format('truetype');
font-style: normal;
font-weight: normal;
}
@font-face {
font-family: "lora";
src: local("Lora"),
url("fonts/Lora/webfonts/Lora-Italic.woff2") format('woff2'),
url("fonts/Lora/variable/Lora-Italic-VariableFont_wght.ttf")format('truetype');
font-weight: normal;
font-style: italic;
font-family: "lora";
src: url("fonts/Lora/webfonts/Lora-Italic.woff2") format('woff2'),
url("fonts/Lora/variable/Lora-Italic-VariableFont_wght.ttf")format('truetype');
font-style: italic;
font-weight: normal;
}
body {