From d79fb0f0ce4744974d45d7d4e80c3af8c2cca717 Mon Sep 17 00:00:00 2001 From: Jonas Kohl Date: Sun, 21 Jul 2024 13:23:33 +0200 Subject: Switch to more flexible params system and add active navlink state --- src/pages/about.php | 3 ++- src/pages/index.php | 3 ++- src/pages/not_found.php | 2 +- src/static/nava.gif | Bin 0 -> 1778 bytes src/static/style.css | 8 ++++++++ src/template.php | 13 +++++++++---- 6 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 src/static/nava.gif (limited to 'src') diff --git a/src/pages/about.php b/src/pages/about.php index 99d8e25..9e7b31b 100644 --- a/src/pages/about.php +++ b/src/pages/about.php @@ -9,7 +9,8 @@ $age = date_diff( ?> -About me +About me +about

About me

diff --git a/src/pages/index.php b/src/pages/index.php index 3b15088..cb9b417 100644 --- a/src/pages/index.php +++ b/src/pages/index.php @@ -1,3 +1,4 @@ -hozyro's site +hozyro's site +home diff --git a/src/pages/not_found.php b/src/pages/not_found.php index b71d6c3..abe4c3f 100644 --- a/src/pages/not_found.php +++ b/src/pages/not_found.php @@ -1,2 +1,2 @@ -Not found +Not found

The requested page could not be found.

diff --git a/src/static/nava.gif b/src/static/nava.gif new file mode 100644 index 0000000..005f34b Binary files /dev/null and b/src/static/nava.gif differ diff --git a/src/static/style.css b/src/static/style.css index 0b94ca4..1c1cd5e 100644 --- a/src/static/style.css +++ b/src/static/style.css @@ -53,6 +53,14 @@ a { color: #05456a; background: url("navh.gif"); } +.navCell.active { + border-left-color: #000; + border-right-color: #7d9cb0; +} +.navCell.active a { + color: #fffca2; + background: url("nava.gif"); +} #mainCell { border: 1px solid #000; border-top: none; diff --git a/src/template.php b/src/template.php index 6e2ad0c..ca781b9 100644 --- a/src/template.php +++ b/src/template.php @@ -1,9 +1,14 @@ - + (($params["active-link"] ?? null) === $ln) ? ' active' : ''; + +?> - <?= htmlentities($title) ?> + <?= htmlentities($params["title"] ?? "") ?> @@ -27,7 +32,7 @@ - -