myPrayerJournal/src/start.php

55 lines
2.6 KiB
PHP
Raw Normal View History

2024-06-21 03:06:31 +00:00
<?php declare(strict_types=1);
const MPJ_VERSION = '4.0.0';
function html_head(string $title): void
{ ?>
<!DOCTYPE html>
<head lang=en>
<meta name=viewport content="width=device-width, initial-scale=1">
<meta name=description content="Online prayer journal - free w/Google or Microsoft account">
<title><?=$title?> &#xab; myPrayerJournal</title>
<link href=https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css rel=stylesheet
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin=anonymous>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel=stylesheet>
<link href=/style/style.css rel=stylesheet>
</head><?php
}
function page_link(string $href, string $text, array $attrs = []): void
{ ?>
<a href="<?=$href?>" hx-get="<?=$href?>" hx-target="#top" hx-swap=innerHTML hx-push-url=true<?php
foreach ($attrs as $key => $value) echo " $key=\"" . htmlspecialchars($value) . "\""; ?>><?=$text?></a><?php
}
function html_foot(): void
{
$version = MPJ_VERSION;
while (!str_ends_with($version, '.0')) $version = substr($version, 0, strlen($version) - 2); ?>
<footer class=container-fluid>
<p class="text-muted text-end">
myPrayerJournal <?=$version?><br>
<em>
<small><?php
page_link('/legal/privacy-policy', 'Privacy Policy');
echo ' &bull; ';
page_link('/legal/terms-of-service', 'Terms of Service');
echo ' &bull; '; ?>
<a href=https://git.bitbadger.solutions/bit-badger/myPrayerJournal target=_blank
rel=noopener>Developed</a> and hosted by
<a href=https://bitbadger.solutions target=_blank rel=noopener>Bit Badger Solutions</a>
</small>
</em>
Htmx.Script.minified
<script>if (!htmx) document.write('<script src=\"/script/htmx.min.js\"><\/script>')</script>
<script async src=https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin=anonymous></script>
<script>
setTimeout(function () {
if (!bootstrap) document.write('<script src=\"/script/bootstrap.bundle.min.js\"><\/script>')
}, 2000)
</script>
<script src=/script/mpj.js></script>
</footer><?php
}