diff --git a/config/phpstan/phpstan.neon b/config/phpstan/phpstan.neon index cb223de9..311a7721 100644 --- a/config/phpstan/phpstan.neon +++ b/config/phpstan/phpstan.neon @@ -28,3 +28,4 @@ parameters: dynamicConstantNames: - DONATION_HOLIDAY_ALERT_ON - DONATION_ALERT_ON + - DONATION_DRIVE_ON diff --git a/lib/Constants.php b/lib/Constants.php index 2e941567..166b08e0 100644 --- a/lib/Constants.php +++ b/lib/Constants.php @@ -44,7 +44,8 @@ const AVERAGE_READING_WORDS_PER_MINUTE = 275; 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', rand(1, 4) == 2); +define('DONATION_ALERT_ON', DONATION_HOLIDAY_ALERT_ON || rand(1, 4) == 2); +define('DONATION_DRIVE_ON', false); // No trailing slash on any of the below constants. const SITE_URL = 'https://standardebooks.org'; diff --git a/lib/HttpInput.php b/lib/HttpInput.php index 0e6d03c8..0dfae587 100644 --- a/lib/HttpInput.php +++ b/lib/HttpInput.php @@ -1,7 +1,7 @@ diff --git a/templates/DonationProgress.php b/templates/DonationProgress.php new file mode 100644 index 00000000..f2459119 --- /dev/null +++ b/templates/DonationProgress.php @@ -0,0 +1,61 @@ + 0 && $current >= $target){ + $stretchOn = true; + $totalCurrent = $current + $stretchCurrent; + $totalTarget = $target + $stretchTarget; +} + +?> + diff --git a/templates/EbookGrid.php b/templates/EbookGrid.php index 542eb13b..ccf30e2b 100644 --- a/templates/EbookGrid.php +++ b/templates/EbookGrid.php @@ -4,13 +4,9 @@ if($view == ''){ $view = VIEW_GRID; } -if(!isset($collection)){ - $collection = null; -} +$collection = $collection ?? null; -if(!isset($ebooks)){ - $ebooks = []; -} +$ebooks = $ebooks ?? []; ?> class="list" typeof="schema:BookSeries" about="Url ?>"> diff --git a/templates/Header.php b/templates/Header.php index 751932e0..dd32eb85 100644 --- a/templates/Header.php +++ b/templates/Header.php @@ -1,21 +1,9 @@ \n"); ?> diff --git a/www/about/index.php b/www/about/index.php index c761d356..5e0d56f3 100644 --- a/www/about/index.php +++ b/www/about/index.php @@ -4,6 +4,9 @@ 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.

@@ -101,6 +104,14 @@ require_once('Core.php');

Corporate Sponsors

    + +
  1. + + +

    Threadable

    +
    +
  2. +
  3. @@ -111,11 +122,26 @@ require_once('Core.php');

Patrons Circle

-

Join the Patrons Circle to support free literature and to have a direct voice in shaping the future of the Standard Ebooks catalog.

+

Join the Patrons Circle to support beautiful, free, and unrestricted digital literature, and to have a direct voice in shaping the future of the Standard Ebooks catalog.

    +
  1. +

    Jon Allen

    +
  2. +
  3. +

    David Ballenger

    +
  4. Michael Barrineau

  5. +
  6. +

    Leland Blanton

    +
  7. +
  8. +

    Keith Bradner

    +
  9. +
  10. +

    Chris Brooks

    +
  11. Derrick Burns

  12. @@ -131,6 +157,21 @@ require_once('Core.php');
  13. Maxwell Collins-Shenfield

  14. +
  15. +

    Liza Daly

    +
  16. +
  17. +

    In memory of Georgia Dawson

    +
  18. +
  19. +

    Mahdi Dibaiee

    +
  20. +
  21. +

    Jeffrey Dlouhy

    +
  22. +
  23. +

    Christian Eager

    +
  24. Alec Feather

  25. @@ -140,12 +181,21 @@ require_once('Core.php');
  26. Mac Foster

  27. +
  28. +

    Michael Ham

    +
  29. Carey Handfield

  30. +
  31. +

    Richard Healey

    +
  32. Curtis Hendzell

  33. +
  34. +

    Stephen Heywood

    +
  35. David Howell

  36. @@ -155,20 +205,62 @@ require_once('Core.php');
  37. Jared Joslin

  38. +
  39. +

    Leonard Kirke

    +
  40. +
  41. +

    Eric Korhonen

    +
  42. +
  43. +

    Brendan LeFebvre

    +
  44. +
  45. +

    Monica & Matthew Levine

    +
  46. +
  47. +

    Lance Linimon

    +
  48. +
  49. +

    James Luke

    +
  50. Patrick Greeley Mahoney

  51. +
  52. +

    Judith Moore

    +
  53. +
  54. +

    Ozan Ocal

    +
  55. Andrew Roach

  56. +
  57. +

    Rollin Salsbery

    +
  58. Brandon Sowers

  59. +
  60. +

    Mark Swenson

    +
  61. +
  62. +

    Joshua Tompkins

    +
  63. +
  64. +

    Ted van der Togt

    +
  65. +
  66. +

    Nathan West

    +
  67. +
  68. +

    Blake Westerdahl

    +
  69. Patrick Weyer

  70. -

    Anonymous × 5

    +

    Anonymous × 19

diff --git a/www/contribute/index.php b/www/contribute/index.php index 32280322..451d03df 100644 --- a/www/contribute/index.php +++ b/www/contribute/index.php @@ -4,6 +4,9 @@ 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 6393e269..131499d7 100644 --- a/www/css/core.css +++ b/www/css/core.css @@ -592,7 +592,6 @@ h1 + section > h2:first-child{ } - a.button, .ebooks nav > a, form button{ @@ -612,7 +611,6 @@ form button{ cursor: pointer; white-space: nowrap; font-size: 1rem; - height: calc(1.4rem + 2rem + 2px); hyphens: none; line-height: 1.2; } @@ -1036,7 +1034,7 @@ section#description h2{ display: none; } -section#description p:first-of-type{ +section#description > p:first-of-type{ margin-top: 0; } @@ -1809,12 +1807,15 @@ main.ebooks nav ol li.highlighted:nth-last-child(2)::after{ line-height: 1; } -.masthead ol.donors{ - grid-template-columns: repeat(auto-fill, minmax(10rem, max-content)); -} - .masthead ol.donors.patrons{ font-style: italic; + display: block; + columns: 3; + margin-left: -.25rem; +} + +.masthead ol.donors.patrons li{ + padding: .25rem; } .masthead ol.donors.patrons li:last-child{ @@ -1943,6 +1944,7 @@ article.ebook section aside.donation{ background-color: rgba(255, 255, 255, .5); font-style: italic; hyphens: none; + box-sizing: border-box; } aside.donation::before{ @@ -1953,6 +1955,7 @@ aside.donation::before{ width: calc(1rem + 2px); top: 0; left: 0; + -webkit-clip-path: polygon(0% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 100%, 0% 100%); transform: rotate(90deg); border-radius: 0 0 0 .25rem; @@ -1967,6 +1970,7 @@ aside.donation::after{ width: 1rem; top: 0; left: 0; + -webkit-clip-path: polygon(0% 0%, 100% 100%, 0% 100%); clip-path: polygon(0% 0%, 100% 100%, 0% 100%); transform: rotate(90deg); border-radius: 0 0 0 .25rem; @@ -2051,6 +2055,184 @@ abbr.acronym{ font-variant: all-small-caps; } +aside header{ + font-family: "League Spartan", Arial, sans-serif; + font-style: normal; + text-transform: uppercase; + margin-bottom: 2rem; + font-size: 1.5rem; +} + +.progress{ + position: relative; + font-size: 0; +} + +.progress > div{ + position: absolute; + width: 100%; + height: 100%; + display: flex; + justify-content: center; +} + +.donation a.button{ + display: inline-block; + white-space: normal; + text-align: center; +} + +.donation > p{ + font-style: normal; +} + +.progress + p{ + margin-top: 2rem; + hyphens: auto; +} + +.progress p{ + font-size: 1rem; + font-family: "League Spartan", Arial, sans-serif; + left: 0; + background: rgba(0, 0, 0, .1); + font-style: normal; + border-radius: .25rem; + padding: .25rem .5rem; + color: #fff; + display: block; + align-self: center; + justify-self: center; + justify-content: center; + text-shadow: 1px 1px 0px rgba(0, 0, 0, .5); + border: 1px solid var(--border); + margin-top: 0; +} + +.progress p.start{ + margin-right: auto; + margin-left: 1rem; + border: none; + background: transparent; + padding: 0; + font-size: .75rem; +} + +.progress p.target{ + margin-left: auto; + margin-right: 1rem; + border: none; + background: transparent; + padding: 0; + font-size: .75rem; +} + +.progress > div{ + /* Animate the div instead of the bar itself, because animating the bar triggers an + FF bug that causes infinite requsts to stripes.svg */ + background: url('/images/stripes.svg') transparent; + background-position: 0 0; + animation: progress 2s linear infinite; + z-index: 3; +} + +progress{ + -webkit-appearance: none; + appearance: none; + height: 3rem; + border: 1px solid var(--input-border); + border-radius: .25rem; + width: 100%; + background: var(--body-bg); + overflow: hidden; +} + +progress::-webkit-progress-bar{ + background: var(--body-bg); +} + +progress::-webkit-progress-value{ + background: var(--button); + box-shadow: 1px 0 1px rgba(0, 0, 0, .25); +} + +progress::-moz-progress-bar{ + background: var(--button); + box-shadow: 1px 0 1px rgba(0, 0, 0, .25); +} + +p.stretch-base{ + position: absolute; + border: none; + background: none; + padding: 0; + left: 70.5%; + font-size: .75rem; +} + +progress.stretch{ + --starting-pos: 71.5%; + position: absolute; + left: var(--starting-pos); + top: 0; + width: calc(100% - var(--starting-pos) + 1px); + border-top-left-radius: 0; + border-bottom-left-radius: 0; + overflow: auto; /* enable drop shadow glow */ + border-left: none; +} + +progress.stretch::-webkit-progress-value{ + background: #f2d745; + box-shadow: none; + filter: drop-shadow(0 0 10px #f2d745); + border-right: 1px solid #E9C91F; + border-left: 5px solid #E9C91F; +} + +progress.stretch::-moz-progress-bar{ + background: #f2d745; + box-shadow: none; + filter: drop-shadow(0 0 10px #f2d745); + border-right: 1px solid #E9C91F; + border-left: 5px solid #E9C91F; +} + +aside button.close{ + font-size: 0; + border: none; + box-shadow: none; + padding: 0; + position: absolute; + top: 1rem; + right: 1rem; + background: url('/images/close.svg') transparent; + background-size: cover; + height: 1rem; + width: 1rem; + opacity: .75; +} + +aside button.close:hover{ + opacity: 1; +} + +aside button.close:active{ + left: auto; + top: calc(1rem + 1px); + right: calc(1rem - 1px); +} + +@keyframes progress{ + 0%{ + background-position: -60px 0px; + } + + 100%{ + background-position: 0 0; + } +} + .downloads-container{ display: flex; } @@ -2497,6 +2679,12 @@ abbr.acronym{ text-align: justify; } + aside.donation p:last-child, + article.ebook section aside.donation p:last-child, + aside.donation header p{ + text-align: center; + } + body > header{ padding: 1rem 0; } @@ -2581,6 +2769,10 @@ abbr.acronym{ form[action*="list-manage.com"] fieldset{ grid-column: 1 / span 2; } + + .masthead ol.donors.patrons{ + columns: 2; + } } @media(max-width: 500px){ @@ -2663,13 +2855,13 @@ abbr.acronym{ text-align: left; } - form[action="/settings"] button{ + form[action="/settings"] button:not(.close){ display: block; margin-top: 1rem; margin-left: 0; } - form[action="/settings"] button, + form[action="/settings"] button:not(.close), form[action="/settings"] span, form[action="/settings"] select{ width: 100%; @@ -2703,6 +2895,17 @@ abbr.acronym{ footer ul li::after{ display: none; } + + .progress p.start, + .progress p.target, + .progress p.stretch-base{ + display: none; + } + + .progress p{ + border: none; + background: transparent; + } } @media(max-width: 380px){ @@ -2776,6 +2979,10 @@ abbr.acronym{ max-width: 50%; margin-bottom: 1rem; } + + .masthead ol.donors.patrons{ + columns: 1; + } } @supports not(hyphens: auto){ diff --git a/www/css/dark.css b/www/css/dark.css index 76a245a8..d93b729a 100644 --- a/www/css/dark.css +++ b/www/css/dark.css @@ -80,3 +80,7 @@ label.search::before{ h1,h2,h3,h4,h5,h6{ text-shadow: 2px 2px 0 rgba(0, 0, 0, .75); } + +aside button.close{ + filter: invert(1); +} diff --git a/www/donate/index.php b/www/donate/index.php index 9460cc15..eb4a46b0 100644 --- a/www/donate/index.php +++ b/www/donate/index.php @@ -7,6 +7,9 @@ require_once('Core.php');

Donate to Standard Ebooks

and help bring the beauty of literature to the digital age

+ + false]) ?> + @@ -23,27 +26,29 @@ require_once('Core.php');

Join the Patrons Circle

-

Start a monthly donation of $10/month or more to become a member of the Patrons Circle. For less than the cost of a meal out, Patrons Circle members have a direct voice in shaping the future of the Standard Ebooks catalog.

+

Members of the Patrons Circle are steadfast supporters of free, unrestricted, and beautifully presented digital literature. Besides helping support the creation of gorgeous ebooks for everyone to enjoy, they also have a direct voice in shaping the future of the Standard Ebooks catalog.

+

Join the Patrons Circle with a donation of $10/month or more, or join for one year with a one-time donation of $100 or more.

-

+

Donate $10/month or more + Donate $100 or more