Skip to content

Instantly share code, notes, and snippets.

View joe-watkins's full-sized avatar

Joe Watkins joe-watkins

View GitHub Profile
<!-- standard -->
<svg class="search-icon">
<use xlink:href="#icon-search-glass"></use>
<image class="search-icon" src="images/svg/search-glass.png">
</svg>
<!-- Assistive Technology ingore -->
<svg class="search-icon" aria-hidden="true">
<use xlink:href="#icon-search-glass"></use>
<image class="search-icon" src="images/svg/search-glass.png">
// Add percentage of white to a color
@function tint($color, $percent){
@return mix(white, $color, $percent);
}
// Add percentage of black to a color
@function shade($color, $percent){
@return mix(black, $color, $percent);
}
@joe-watkins
joe-watkins / gist:00a1bd83fec29048f4ed
Last active April 22, 2016 06:28
toggleAria.js - a small plugin for swapping boolean aria attributes easier
/*!
* toggleAria.js
* Author: Joe Watkins
* usage:
HTML
<button aria-pressed="false">Show Content</button>
$("button").on("click", function(){
$(this).toggleAria({aria: "pressed"});
@joe-watkins
joe-watkins / gist:c67139c1276aae8f258d
Last active August 29, 2015 14:09
svgFallbacks.js - offer png fallback for inline svg - uses Modernizr
/*!
* svgFallbacks.js
* Author: Joe Watkins - joe-watkins.io
* Requires - Modernizr for inlinesvg test
* Usage:
* 1. add a class to <img> eg.
* <img class="svg" src="path/file.svg">
*
* 2. add png fallback for older browsers via data attribute
* <img class="svg" src="path/image.svg" data-svg-fallback="/path/image.png" alt="cool icon">
@joe-watkins
joe-watkins / tableToD3Chart.js
Last active March 15, 2018 15:00
Table to D3/C3 Chart Demo - Making data for visualizations more accessible with dom scraping patterns
/*!
* tableToD3Chart();
* Author: Joe Watkins - joe@emergeinteractive.com
*
* Scrape the dom for data and create C3/D3 based charts
*
* Defaults:
* chartTitleWrapper = the element wrapping text for chart label
* chartType = line, pie, donut, bar, spline, scatter etc. - see C3 docs
* useDom = true/false - if you don't want to scrape dom and want to define data use false
@joe-watkins
joe-watkins / index.html
Created March 8, 2014 15:28
A Pen by Joe Watkins.
<h1>Thank you!</h1>
<p>You just did awesome! Now share it with your friends :)</p>
<div class="easy-share"
data-title="This is the title"
data-url="http://codepen.com"
data-tweet="The tweet goes here"
data-hash-tags="taghere,another,tag">
</div>
@joe-watkins
joe-watkins / index.html
Created March 5, 2014 22:40
A Pen by Joe Watkins.
<h1>jojoTabs.js<span>Easy Responsive &amp; Accessible Tabs</h1>
<ul role="tablist">
<li id="tab_1" aria-controls="panel_1" aria-selected="true" role="tab">Tab 1</li>
<li id="tab_2" aria-controls="panel_2" role="tab">Tab 2</li>
<li id="tab_3" aria-controls="panel_3" role="tab">Tab 3</li>
<li id="tab_4" aria-controls="panel_4" role="tab">Tab 4</li>
</ul>
<div id="panel_1" aria-labelledby="tab_1" aria-hidden="false" role="tabpanel">
@joe-watkins
joe-watkins / Calc()-Gutter-Test.markdown
Created February 22, 2014 18:06
A Pen by Joe Watkins.

Calc() Gutter Test

Using calc() to define column widths along with a gutter which is defined by margin vs padding.

A Pen by Joe Watkins on CodePen.

License.

@joe-watkins
joe-watkins / Responsive-Slider.markdown
Created February 19, 2014 03:37
A Pen by Joe Watkins.
@joe-watkins
joe-watkins / A-Pen-by-Joe-Watkins.markdown
Created February 19, 2014 03:37
A Pen by Joe Watkins.