Skip to content

Instantly share code, notes, and snippets.

View nfreear's full-sized avatar

Nick Freear nfreear

View GitHub Profile
@nfreear
nfreear / text-fragments.uri.html
Created April 26, 2021 16:35
URL text fragment examples / demos
<!doctype html> <title> Text fragment examples/demos </title>
<h1> Text fragment examples/demos </h1>
<ul>
<li><a href="https://web.dev/text-fragments/#:~:text=BOLDLY">BOLDLY</a>
<li><a href="https://wicg.github.io/scroll-to-text-fragment/#:~:text=USE%20CASE">USE CASE</a>
<li> ... ?!
<li><a href="https://accessibilityassociation.org/cpwacertificants#:~:text=Daniel%20Mclaughlan%2C%20AbilityNet">D Mclaughlan, AbilityNet</a>
@nfreear
nfreear / accessibility.file-error-handling.js.html
Created April 26, 2021 08:18
Error handling demo — missing files / HTML + Javascript
<!doctype html> <title> Error handling demo </title>
<link rel="stylesheet" href="404-missing-stylesheet.css" onerror="console.warn('> CSS Error.')" />
<style>
body { margin: 1rem auto; max-width: 32rem; }
img,
audio,
video {
@nfreear
nfreear / accessibility.iet-contrast-fix.css.html
Last active April 21, 2021 10:17
Demo of colour contrast fixes for IET home-page / 19-April-2021.
<!doctype html><html lang="en"><meta charset=utf-8 ><title> IET contrast fixes demo </title>
<style>
:root {
--grid: 35rem;
--fix-a-opacity: 0.52;
--fix-b-link-color: #44B4F8;
}
body { margin: 1rem auto; max-width: var(--grid); }
@nfreear
nfreear / accessibility.wai-aria.ajax-loading-demo.js.html
Last active April 21, 2021 07:18
Accessibility - "More" button loading behaviour demo - Ajax - WAI-ARIA | https://w3.org/TR/wai-aria-practices/#no_aria_better_bad_aria
<!doctype html><html lang="en"><meta charset="utf-8">
<title> "More" button loading demo (WAI-ARIA) </title>
<style>
body { margin: 1rem auto; max-width: 35rem; padding: .5rem; }
main { font: 1rem/1.5 sans-serif; position: relative; }
/* Accessibility / Usability - visually indicate new content.
@nfreear
nfreear / accessibility.sr-only.css.html
Created April 20, 2021 10:56
Accessibility - "sr-only" / "visually-hidden" - Hide SMALL amounts of additional information from all BUT screen reader users.
<!doctype html><html lang="en"><meta charset="utf-8"> <title> "sr-only" demo </title>
<style>
body { margin: 1rem auto; max-width: 35rem; }
pre { background: #f8f8f8; border: 1px solid #ccc; margin: 2rem 0; padding: .7rem; }
/* Accessibility.
Hide from all BUT screen reader users - Aka "visually-hidden".
@nfreear
nfreear / interactiveaccessibility.com--keyboard-trap-example.html
Created March 8, 2021 16:42
Interactive Accessibility -- Keyboard traps
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
SOURCE :~ https://interactiveaccessibility.com/education/training/ex7.1.html
-->
<html lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Training Examples - Keyboard Traps</title>
<link rel="stylesheet" href="css/formee-structure.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/formee-style.css" type="text/css" media="screen" />
@nfreear
nfreear / npm-outdated-filter-wanted.js
Last active March 3, 2021 10:10
NPM: outdated filter "wanted" (Node / Javacript utility)
/**
* NPM-Outdated-filter-wanted.js
*
* @author NDF, 02-Mar-2021.
*/
const exec = require('child_process').exec;
exec('npm outdated --json', (err, stdout, stderr) => {
if (err instanceof Error && !stdout) {
@nfreear
nfreear / php-license-report-csv.js
Last active February 25, 2021 11:05
Parse PHP composer.json and composer.lock files to extract license information.
/**
* Work-in-progress!
*
* Parse PHP composer.json and composer.lock files to extract license information.
*
* OUTPUT: CSV output to standard error.
*
* @author Nick Freear, 24-Feb-2021.
*/
@nfreear
nfreear / covid-widget-banner.html
Created February 18, 2021 14:05
COVID widget / banner
<!doctype html> <title> COVID widget / banner </title>
<style>
#covid-widget-nhs {
position: relative;
max-width: calc( 800px - ( 30px * 2 ) );
height: 450px;
}
#covid-widget-nhs iframe {
position: absolute; height: 100%; width: 100%; border: 2px solid #015eb8;