diff --git a/lib/Constants.php b/lib/Constants.php index f5624be6..9f4ee640 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -77,6 +77,7 @@ define('PD_YEAR', intval(gmdate('Y')) - 96); define('DONATION_HOLIDAY_ALERT_ON', time() > strtotime('November 15, ' . gmdate('Y')) || time() < strtotime('January 7, ' . gmdate('Y'))); define('DONATION_ALERT_ON', DONATION_HOLIDAY_ALERT_ON || rand(1, 4) == 2); define('DONATION_DRIVE_ON', false); +define('DONATION_DRIVE_COUNTER_ON', false); const GITHUB_SECRET_FILE_PATH = SITE_ROOT . '/config/secrets/se-vcs-bot@github.com'; // Set in the GitHub organization global webhook settings. const GITHUB_WEBHOOK_LOG_FILE_PATH = '/var/log/local/webhooks-github.log'; // Must be writable by `www-data` Unix user. diff --git a/templates/DonationCounter.php b/templates/DonationCounter.php new file mode 100644 index 00000000..bad77a0f --- /dev/null +++ b/templates/DonationCounter.php @@ -0,0 +1,66 @@ + $end){ + return; +} + +$deadline = $end->format('F j'); +$timeLeft = $now->diff($end); +$timeString = ''; +if($timeLeft->d < 1 && $timeLeft->h < 20){ + $timeString = 'Just hours'; +} +elseif($timeLeft->d >= 1 && $timeLeft->h <= 12){ + $timeString = $timeLeft->d . ' day'; + if($timeLeft->d > 1){ + $timeString .= 's'; + } + else{ + $timeString = 'Only ' . $timeString; + } +} +else{ + $timeString = ($timeLeft->d + 1) . ' day'; + if($timeLeft->d + 1 > 1){ + $timeString .= 's'; + } + else{ + $timeString = 'Only ' . $timeString; + } +} + +$digits = str_split(str_pad($current, 3, "0", STR_PAD_LEFT)) + +?> + diff --git a/templates/DonationProgress.php b/templates/DonationProgress.php index f2459119..270ff9a4 100644 --- a/templates/DonationProgress.php +++ b/templates/DonationProgress.php @@ -1,11 +1,12 @@ 0 && $current >= $target){

We want to make Standard Ebooks a sustainable project that can support the huge amount of work it takes to maintain and operate. Welcoming new Patrons Circle members by will help put us on the stable financial footing we need to continue producing beautiful ebooks as we enter the new year.

Will you help us reach that goal, and support free and unrestricted digital literature?

-

Join the patrons circle

+ diff --git a/www/about/index.php b/www/about/index.php index a65a75ce..bb388337 100644 --- a/www/about/index.php +++ b/www/about/index.php @@ -4,9 +4,8 @@ require_once('Core.php');

About Standard Ebooks

- + -

Standard Ebooks is a volunteer-driven effort to produce a collection of high quality, carefully formatted, accessible, open source, and free public domain ebooks that meet or exceed the quality of commercially produced ebooks. The text and cover art in our ebooks is already believed to be in the U.S. public domain, and Standard Ebooks dedicates its own work to the public domain, thus releasing the entirety of each ebook file into the public domain. All the ebooks we produce are distributed free of cost and free of U.S. copyright restrictions.

Standard Ebooks is organized as a “low-profit L.L.C.,” or “L3C,” a kind of legal entity that blends the charitable focus of a traditional not-for-profit with the ease of organization and maintenance of a regular L.L.C. Our only source of income is donations from readers like you.

diff --git a/www/contribute/index.php b/www/contribute/index.php index 451d03df..b55c4b2a 100644 --- a/www/contribute/index.php +++ b/www/contribute/index.php @@ -4,9 +4,8 @@ require_once('Core.php');

Get Involved

- + -

Help create ebooks that are a pleasure to read

Standard Ebooks is a volunteer-driven project, and there’s room for people of all skill levels to contribute.

diff --git a/www/css/core.css b/www/css/core.css index 938094c0..e1355722 100644 --- a/www/css/core.css +++ b/www/css/core.css @@ -51,6 +51,14 @@ font-display: swap; } +@font-face{ + font-family: "Bebas Neue"; + src: url("/fonts/bebas-neue-subset.woff2") format("woff2"); + font-weight: normal; + font-style: normal; + font-display: swap; +} + :root{ --light-body-bg: #e9e7e0; --light-body-text: #222; @@ -2112,6 +2120,63 @@ aside header{ font-style: normal; } +.donation.counter > p:not(.donate-button){ + text-align: justify; + max-width: 80ch; + margin: 1rem auto; + hyphens: auto; +} + +.flipboard{ + font-style: normal; + font-size: 2rem; + margin: 2rem auto; + line-height: 1; + font-family: "League Spartan"; + text-transform: uppercase; +} + +.flipboard span{ + background: #222; + border: 1px solid #222; + box-shadow: 1px 1px 0px rgba(255,255,255,.5) inset; + border-radius: 5px; + color: #fff; + padding: .25rem 1rem 0 1rem; + line-height: 1; + position: relative; + text-shadow: 2px 2px 0px #000; + width: 1em; + padding: .5em .25em; + display: inline-block; +} + +.flipboard span + span{ + margin-left: .1em; +} + +.flipboard span::before{ + position: absolute; + content: ""; + top: calc(50% - 5px); + left: 0; + height: 10px; + width: calc(100% - 4px); + border-left: 2px solid #aaa; + border-right: 2px solid #aaa; +} + +.flipboard span::after{ + position: absolute; + content: ""; + top: 50%; + left: 0; + height: 50%; + background: linear-gradient(180deg, rgb(255, 255, 255, .3) 0%, rgba(0,0,0,0) 75%); + width: 100%; + border-top: 1px solid #000; +} + .progress + p{ margin-top: 2rem; hyphens: auto; @@ -2225,18 +2290,23 @@ progress.stretch::-moz-progress-bar{ } aside button.close{ + display: block; font-size: 0; border: none; box-shadow: none; padding: 0; position: absolute; - top: 1rem; - right: 1rem; + top: 0; + right: 0; background: url('/images/close.svg') transparent; - background-size: cover; - height: 1rem; - width: 1rem; + background-size: 1rem 1rem; + background-position: center; + background-repeat: no-repeat; + height: 3rem; + width: 3rem; + padding: 1rem; opacity: .75; + margin: 0; } aside button.close:hover{ @@ -2245,8 +2315,8 @@ aside button.close:hover{ aside button.close:active{ left: auto; - top: calc(1rem + 1px); - right: calc(1rem - 1px); + top: 1px; + right: -1px; } @keyframes progress{ @@ -2705,6 +2775,14 @@ aside button.close:active{ text-align: justify; } + aside.donation .flipboard{ + text-align: center; + } + + aside.donation .flipboard span{ + margin-bottom: 1rem; + } + aside.donation p:last-child, article.ebook section aside.donation p:last-child, aside.donation header p{ @@ -2899,6 +2977,10 @@ aside button.close:active{ main.ebooks > ol{ grid-gap: 2rem; } + + aside.donation .flipboard{ + font-size: 1rem; + } } @media(max-width: 420px){ diff --git a/www/css/dark.css b/www/css/dark.css index d93b729a..0599cf35 100644 --- a/www/css/dark.css +++ b/www/css/dark.css @@ -84,3 +84,8 @@ h1,h2,h3,h4,h5,h6{ aside button.close{ filter: invert(1); } + +aside.donation .flipboard span{ + border-color: rgba(255,255,255,.5); + box-shadow: none; +} diff --git a/www/donate/index.php b/www/donate/index.php index 7e3a39b2..7c4204ef 100644 --- a/www/donate/index.php +++ b/www/donate/index.php @@ -7,9 +7,8 @@ require_once('Core.php');

Donate to Standard Ebooks

and help bring the beauty of literature to the digital age

- - false]) ?> - + false, 'showDonateButton' => false]) ?> + false, 'showDonateButton' => false]) ?> diff --git a/www/ebooks/ebook.php b/www/ebooks/ebook.php index 358111db..5cea2590 100644 --- a/www/ebooks/ebook.php +++ b/www/ebooks/ebook.php @@ -138,9 +138,9 @@ catch(Exceptions\InvalidEbookException $ex){

Description

- + - + LongDescription === null){ ?> diff --git a/www/ebooks/index.php b/www/ebooks/index.php index eeeed234..7e3f8b71 100644 --- a/www/ebooks/index.php +++ b/www/ebooks/index.php @@ -135,9 +135,9 @@ catch(Exceptions\InvalidCollectionException $ex){ ?> $pageTitle, 'highlight' => 'ebooks', 'description' => $pageDescription]) ?>

- + - +