Tweak PD Day banner

This commit is contained in:
Alex Cabal 2024-12-31 14:59:03 -06:00
parent 6ad882e2cc
commit fcb5240585
2 changed files with 7 additions and 2 deletions

View file

@ -14,7 +14,7 @@ $isErrorPage = $isErrorPage ?? false;
$downloadUrl = $downloadUrl ?? null;
$canonicalUrl = $canonicalUrl ?? null;
$css = $css ?? [];
$showPublicDomainDayBanner = PD_NOW < new DateTimeImmutable('January 14', LATEST_CONTINENTAL_US_TZ) && !(HttpInput::Bool(COOKIE, 'hide-public-domain-day-banner') ?? false);
$showPublicDomainDayBanner = PD_NOW > new DateTimeImmutable('January 1, 8:00 AM', new DateTimeZone('America/Chicago')) && PD_NOW < new DateTimeImmutable('January 14', LATEST_CONTINENTAL_US_TZ) && !(HttpInput::Bool(COOKIE, 'hide-public-domain-day-banner') ?? false);
// As of Sep. 2022, all versions of Safari have a bug where if the page is served as XHTML, then `<picture>` elements download all `<source>`s instead of the first supported match.
// So, we try to detect Safari here, and don't use multiple `<source>` if we find Safari.
@ -110,7 +110,7 @@ if(!$isXslt){
<div class="confetti"></div>
<div class="confetti"></div>
</div>
<a href="/blog/public-domain-day-<?= PD_DAY_YEAR ?>"><strong>Happy Public Domain Day <?= PD_DAY_YEAR ?>!</strong> See whats free to read starting January 1.</a>
<a href="/blog/public-domain-day-<?= PD_DAY_YEAR ?>"><strong>Happy Public Domain Day <?= PD_DAY_YEAR ?>!</strong> See whats free to read on January 1.</a>
<form action="/settings" method="<?= Enums\HttpMethod::Post->value ?>">
<input type="hidden" name="_method" value="<?= Enums\HttpMethod::Patch->value ?>" />
<input type="hidden" name="hide-public-domain-day-banner" value="true" />

View file

@ -3210,6 +3210,11 @@ hr + p{
box-shadow: 0 0 1rem rgba(0, 0, 0, .75);
}
.public-domain-day-banner a{
margin-left: -2.5rem;
font-size: larger;
}
.public-domain-day-banner button.close{
background-image: url('/images/close-dark.svg');
top: 2px;