mirror of
https://github.com/standardebooks/web.git
synced 2025-07-18 20:36:38 -04:00
Fix donation progress bar
This commit is contained in:
parent
d146550bf3
commit
616b9677a9
6 changed files with 14 additions and 11 deletions
|
@ -91,7 +91,7 @@ Define conf_rewrite_root ${web_root}/config/apache/rewrites
|
|||
SSLCertificateFile /etc/letsencrypt/live/${domain}/fullchain.pem
|
||||
SSLCertificateKeyFile /etc/letsencrypt/live/${domain}/privkey.pem
|
||||
Header always set Strict-Transport-Security "max-age=15768000"
|
||||
Header set Content-Security-Policy "default-src 'self';"
|
||||
Header set Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline';"
|
||||
|
||||
<Directory "${web_root}/www/">
|
||||
# Disable .htaccess files
|
||||
|
|
|
@ -73,7 +73,7 @@ Define conf_rewrite_root ${web_root}/config/apache/rewrites
|
|||
SSLCertificateFile ${web_root}/config/ssl/${domain}.crt
|
||||
SSLCertificateKeyFile ${web_root}/config/ssl/${domain}.key
|
||||
Header always set Strict-Transport-Security "max-age=15768000"
|
||||
Header set Content-Security-Policy "default-src 'self';"
|
||||
Header set Content-Security-Policy "default-src 'self'; style-src 'self' 'unsafe-inline';"
|
||||
|
||||
<Directory "${web_root}/www/">
|
||||
# Disable .htaccess files
|
||||
|
|
|
@ -101,7 +101,7 @@ const DONATION_DRIVE_DATES = [
|
|||
NOW < new DateTimeImmutable('January 7') ? new DateTimeImmutable('November 25 -1 year') : new DateTimeImmutable('November 25'),
|
||||
NOW < new DateTimeImmutable('January 7') ? new DateTimeImmutable('January 7') : new DateTimeImmutable('January 7 +1 year'),
|
||||
75,
|
||||
25
|
||||
50
|
||||
)
|
||||
];
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ class DonationDrive{
|
|||
if(!isset($this->_TargetDonationCount)){
|
||||
$this->_TargetDonationCount = $this->BaseTargetDonationCount;
|
||||
|
||||
if($this->DonationCount > $this->BaseTargetDonationCount){
|
||||
if($this->DonationCount >= $this->BaseTargetDonationCount){
|
||||
$this->_TargetDonationCount = $this->_TargetDonationCount + $this->StretchTargetDonationCount;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,6 +40,10 @@ else{
|
|||
$timeString = 'Only ' . $timeString;
|
||||
}
|
||||
}
|
||||
|
||||
if($donationDrive->IsStretchEnabled){
|
||||
$stretchStartingPosition = round( ($donationDrive->BaseTargetDonationCount / $donationDrive->TargetDonationCount) * 100, 0, PHP_ROUND_HALF_DOWN);
|
||||
}
|
||||
?>
|
||||
<aside class="donation closable">
|
||||
<? if($autoHide){ ?>
|
||||
|
@ -62,7 +66,7 @@ else{
|
|||
<p>Help us meet our stretch goal of<br/> <?= number_format($donationDrive->TargetDonationCount) ?> new patrons by <?= $deadline ?></p>
|
||||
</header>
|
||||
<? } ?>
|
||||
<div class="progress">
|
||||
<div class="progress"<? if($donationDrive->IsStretchEnabled){ ?> style="--stretch-starting-position: <?= $stretchStartingPosition ?>%; --stretch-base-counter-position: <?= $stretchStartingPosition - 1 ?>%"<? } ?>>
|
||||
<div aria-hidden="true">
|
||||
<p class="start">0</p>
|
||||
<p><?= number_format($donationDrive->DonationCount) ?>/<?= number_format($donationDrive->TargetDonationCount) ?></p>
|
||||
|
@ -77,7 +81,7 @@ else{
|
|||
<? } ?>
|
||||
</div>
|
||||
<? if($donationDrive->IsStretchEnabled){ ?>
|
||||
<p>When we started this drive, we set a goal of <?= number_format($donationDrive->BaseTargetDonationCount) ?> Patrons Circle members by <?= $deadline ?>. Thanks to the incredible generosity of literature lovers like you, we hit that goal!</p>
|
||||
<p>When we started this drive, we set a goal of <?= number_format($donationDrive->BaseTargetDonationCount) ?> Patrons Circle members by <?= $deadline ?>. Thanks to the incredible generosity of literature lovers like you, we hit that goal faster than we hoped!</p>
|
||||
<p>Since there’s still some time left in our drive, we thought we’d challenge our readers to help us reach our stretch goal of <?= number_format($donationDrive->TargetDonationCount) ?> patrons, so that we can continue on a rock-solid financial footing. Will you help us with a donation, and support free and unrestricted digital literature?</p>
|
||||
<? }else{ ?>
|
||||
<p>It takes a huge amount of resources and highly-skilled work to create and distribute each of our free ebooks, and we need your support to keep it up. That’s why we want to welcome <?= number_format($donationDrive->TargetDonationCount) ?> new patrons by <?= $deadline ?>. It’s our patrons who keep us on the stable financial footing we need to continue producing and giving away beautiful ebooks.</p>
|
||||
|
|
|
@ -2861,21 +2861,20 @@ progress::-moz-progress-bar{
|
|||
box-shadow: 1px 0 1px rgba(0, 0, 0, .25);
|
||||
}
|
||||
|
||||
p.stretch-base{
|
||||
div.progress p.stretch-base{
|
||||
position: absolute;
|
||||
border: none;
|
||||
background: none;
|
||||
padding: 0;
|
||||
left: 70.5%;
|
||||
left: var(--stretch-base-counter-position);
|
||||
font-size: .75rem;
|
||||
}
|
||||
|
||||
progress.stretch{
|
||||
--starting-pos: 71.5%;
|
||||
position: absolute;
|
||||
left: var(--starting-pos);
|
||||
left: var(--stretch-starting-position);
|
||||
width: calc(100% - var(--stretch-starting-position) + 1px);
|
||||
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue