mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
fhc header skiplink; cis4 skiplink css;
This commit is contained in:
@@ -227,3 +227,13 @@ function generateBackwardCompatibleJSMsIe($js)
|
||||
echo "<![endif]-->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an accessibility skipLink https://www.w3schools.com/accessibility/accessibility_skip_links.php
|
||||
*/
|
||||
function generateSkipLink($skipID)
|
||||
{
|
||||
$toPrint = '<a id="skiplink" href="';
|
||||
$toPrint.=$skipID;
|
||||
$toPrint.='" class="fhcSkipLink"></a>';
|
||||
echo $toPrint;
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ $includesArray = array(
|
||||
'tabulator5' => true, // TODO: upgrade to 6 when available
|
||||
'vue3' => true,
|
||||
'primevue3' => true,
|
||||
'skipID' => '#fhccontent',
|
||||
'vuedatepicker11' => true,
|
||||
'customCSSs' => array(
|
||||
'public/css/components/verticalsplit.css',
|
||||
|
||||
@@ -9,12 +9,15 @@
|
||||
$title = isset($title) ? $title : null;
|
||||
$refresh = isset($refresh) ? $refresh : null;
|
||||
$customCSSs = isset($customCSSs) ? $customCSSs : null;
|
||||
$skipID = isset($skipID) ? $skipID : null;
|
||||
?>
|
||||
<!-- Header start -->
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<?php if($skipID) generateSkipLink($skipID); ?>
|
||||
|
||||
<title><?php printPageTitle($title); ?></title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
|
||||
@@ -98,3 +98,41 @@
|
||||
padding-right: .375rem;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
|
||||
.fhcSkipLink {
|
||||
position: absolute;
|
||||
left: -10px;
|
||||
top: -10px;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fhcSkipLink::before {
|
||||
content: "Skip to main content"
|
||||
}
|
||||
|
||||
.fhcSkipLink:focus {
|
||||
position: absolute;
|
||||
z-index: 9999999;
|
||||
top: var(--fhc-cis-header-height);
|
||||
left: var(--fhc-cis-menu-width);
|
||||
height: 100px;
|
||||
width: 800px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #0044cc;
|
||||
background-color: #ffeb3b;
|
||||
text-decoration: none;
|
||||
padding: 12px 18px;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
fhcSkipLink:hover {
|
||||
background-color: #ffcc00;
|
||||
color: #002b80;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
@@ -227,7 +227,8 @@ const app = Vue.createApp({
|
||||
},
|
||||
handleClick(event) {
|
||||
const target = event.target.closest('a');
|
||||
|
||||
|
||||
if(target?.id == 'skiplink') return
|
||||
if (target && this.isInternalRoute(target.href)) {
|
||||
const url = new URL(target.href)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user