Skip to content

Instantly share code, notes, and snippets.

View gu-stav's full-sized avatar
🍿

Gustav Hansen gu-stav

🍿
View GitHub Profile
@gu-stav
gu-stav / Readme.md
Last active January 7, 2020 21:57
An accessible HTML-Stepper Component.

#Accessible HTML-Stepper#

It will provide some label-magic through aria-label, so that the buttons actually have a meaning, even if you can't see them.

Styling is not part of it, so you can use whatever you want. The plugin itself doesn't know anything about responsiveness. It does not depend on any plugins.

TODOs/ Ideas

  • Option for limiting the total & minimal Amount
  • Provide Web-Component
  • Let users pass in a set of elements
@gu-stav
gu-stav / notes.md
Created May 12, 2014 09:32
codefront.io
@gu-stav
gu-stav / test.js
Created September 4, 2013 06:15
nodejs - domains. Taken from http://nodetuts.com/08-domains.html
var EventEmitter = require('events').EventEmitter;
var domain = require('domain');
var fs = require('fs');
var a;
var server = require('http').createServer();
server.on('request', function(req, res) {
var d = domain.create();
@gu-stav
gu-stav / keep-focus.js
Created July 2, 2013 07:02 — forked from drublic/keep-focus.js
Keep the focus inside a lightbox/ element. Elegant solution.
var tabbableElements = 'a[href], area[href], input:not([disabled]),' +
'select:not([disabled]), textarea:not([disabled]),' +
'button:not([disabled]), iframe, object, embed, *[tabindex],' +
'*[contenteditable]';
var keepFocus = function (context) {
var allTabbableElements = context.querySelectorAll(tabbableElements);
var firstTabbableElement = allTabbableElements[0];
var lastTabbableElement = allTabbableElements[allTabbableElements.length - 1];