Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@gauntface/dpad-nav
Advanced tools
A JS / TS library to make it easy to add d-pad navigation to a web app.
This library is designed to make it quick a simple to support D-Pad Navigation in a web app.
To support D-Pad navigation with this library, you need to do the following:
<script src="./scripts/dpad-nav-lib.min.js" />
<div class="grid-item dpad-focusable" tabindex="0">
<img class="thumb" src="./images/thumbs/thumb01.jpg" />
<div class="title">Item 1</div>
</div>
.grid-item:focus {
outline: none;
background-color: rgb(149, 165, 166);
}
.grid-item.clickdown {
background-color: rgb(189, 195, 199);
}
You should now be supporting D-Pad navigation.
This library will trigger a normal focus and click event.
element.addEventListener('focus', function(e) {
console.log('Element Focused');
}, true);
element.addEventListener('click', function() {
console.log('Element Clicked');
}, true);
The way the library works is that on page load or page resize, it will calculate the graph of where each nodes closest neighbours are, based purely on each elements position in the viewport.
What the library does not do, is recalculate the graph if you add or remove elements. To support this, you need to update the elements in the graph and their connections, which is done by calling:
window.dpadFocusController.reset();
With the tabindex property you can determine the order in which a view is focused when you hit the tab key. The ordering is ignored by this library, tabindex is needed to ensure the browser allows an element to gain focus, however the order will still be applied if you hit tab on the keyboard.
There is a debug option to display lines which indicate the link between each node.
window.dpadFocusController.toggleDebugMode();
FAQs
A JS / TS library to make it easy to add d-pad navigation to a web app.
The npm package @gauntface/dpad-nav receives a total of 182 weekly downloads. As such, @gauntface/dpad-nav popularity was classified as not popular.
We found that @gauntface/dpad-nav demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.