summaryrefslogtreecommitdiff
path: root/src/web/lib/aria.php
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2026-02-23 22:57:27 -0500
committerFreya Murphy <freya@freyacat.org>2026-02-23 22:57:27 -0500
commitf373ead95fb5beb962c376b5b7b46dfde8ac4e57 (patch)
treec99df23521ff2a5e5e2e4627c525a5e99dc2e3ae /src/web/lib/aria.php
parentadd 96x96 logo (diff)
downloadwebsite-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.tar.gz
website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.tar.bz2
website-f373ead95fb5beb962c376b5b7b46dfde8ac4e57.zip
update website to work with crimson framework
Diffstat (limited to 'src/web/lib/aria.php')
-rw-r--r--src/web/lib/aria.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/web/lib/aria.php b/src/web/lib/aria.php
new file mode 100644
index 0000000..0e06b97
--- /dev/null
+++ b/src/web/lib/aria.php
@@ -0,0 +1,17 @@
+<?php /* Copyright (c) 2024 Freya Murphy */
+
+function aria_section(string $id, ?string $title = NULL): string
+{
+ $out = '';
+ if ($title) {
+ $idh = $id . '_heading';
+ $out .= sprintf('<div id="%s" class="section" role="region" aria-labelledby="%s">',
+ $id, $idh);
+ $out .= sprintf('<h2 class="heading" id="%s">%s</h2>',
+ $idh, $title);
+ } else {
+ $out .= sprintf('<div id="%s" class="section" role="region">',
+ $id);
+ }
+ return $out;
+}