Skip to content

Instantly share code, notes, and snippets.

@jedfoster
Created February 3, 2015 17:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jedfoster/b217eb041c14cfd19b89 to your computer and use it in GitHub Desktop.
Save jedfoster/b217eb041c14cfd19b89 to your computer and use it in GitHub Desktop.
Twitter // source http://jsbin.com/xewedumusi
<style id="jsbin-css">
svg a {
-webkit-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
-moz-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
-o-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
}
svg {
fill: dimgray;
font-family: "FuturaND-Bold", sans-serif;
}
svg a {
fill: #8d8d8d;
cursor: pointer;
}
svg a:hover {
fill: #ffd324;
}
</style>
<svg width="959px" height="94px" viewBox="0 0 959 94" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="Logo"><a xlink:href="http://jedfoster.com/" target="_parent">
<text id="JED-FOSTER" font-size="114.56" x="0" y="90">JED FOSTER</text></a>
<g id="CODE-DESIGN-FOR-THE-WEB" transform="translate(766.83, 0)" font-size="24.32">
<text id="CODE" x="113.2" y="22">CODE.</text>
<text id="DESIGN" x="83.9" y="56">DESIGN.</text>
<text id="FOR-THE-WEB" x="9.6" y="90">FOR THE WEB.</text>
</g>
</g>
</svg>
<!--script(src="http://code.jquery.com/jquery-2.1.1.min.js")-->
<script id="jsbin-javascript">
// console.log(navigator.userAgent);
// function isSafari() {
// return /^((?!chrome).)*safari/i.test(navigator.userAgent);
// }
// if(isSafari()) {
// var a = $('svg #Logo a');
// var href = a.attr('xlink:href');
// a.attr('data-href', href).attr('xlink:href', null);
// a.on('click', function(e) {
// e.preventDefault();
// window.location = $(this).data('href');
// });
// }
if(/^((?!chrome).)*safari/i.test(navigator.userAgent)) {
var a = document.querySelector('#Logo a');
var href = a.getAttributeNS('http://www.w3.org/1999/xlink', 'href');
a.setAttribute('data-href', href);
a.removeAttributeNS('http://www.w3.org/1999/xlink', 'href');
a.addEventListener('click', function(e) {
window.location = e.target.parentNode.getAttribute('data-href');
});
}
</script>
<script id="jsbin-source-html" type="text/html">svg(width='959px' height='94px' viewBox='0 0 959 94' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink')
g#Logo
a(xlink:href='http://jedfoster.com/' target='_parent')
text#JED-FOSTER(font-size='114.56' x='0' y='90') JED FOSTER
g#CODE-DESIGN-FOR-THE-WEB(transform='translate(766.83, 0)' font-size='24.32')
text#CODE(x='113.2' y='22') CODE.
text#DESIGN(x='83.9' y='56') DESIGN.
text#FOR-THE-WEB(x='9.6' y='90') FOR THE WEB.
//script(src="//code.jquery.com/jquery-2.1.1.min.js")</script>
<script id="jsbin-source-css" type="text/css">svg a {
-webkit-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
-moz-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
-o-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
}
svg {
fill: dimgray;
font-family: "FuturaND-Bold", sans-serif;
}
svg a {
fill: #8d8d8d;
cursor: pointer;
}
svg a:hover {
fill: #ffd324;
}
</script>
<script id="jsbin-source-javascript" type="text/javascript">// console.log(navigator.userAgent);
// function isSafari() {
// return /^((?!chrome).)*safari/i.test(navigator.userAgent);
// }
// if(isSafari()) {
// var a = $('svg #Logo a');
// var href = a.attr('xlink:href');
// a.attr('data-href', href).attr('xlink:href', null);
// a.on('click', function(e) {
// e.preventDefault();
// window.location = $(this).data('href');
// });
// }
if(/^((?!chrome).)*safari/i.test(navigator.userAgent)) {
var a = document.querySelector('#Logo a');
var href = a.getAttributeNS('http://www.w3.org/1999/xlink', 'href');
a.setAttribute('data-href', href);
a.removeAttributeNS('http://www.w3.org/1999/xlink', 'href');
a.addEventListener('click', function(e) {
window.location = e.target.parentNode.getAttribute('data-href');
});
}</script>
svg a {
-webkit-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
-moz-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
-o-transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease, text-shadow 0.25s ease, fill 0.25s ease;
}
svg {
fill: dimgray;
font-family: "FuturaND-Bold", sans-serif;
}
svg a {
fill: #8d8d8d;
cursor: pointer;
}
svg a:hover {
fill: #ffd324;
}
// console.log(navigator.userAgent);
// function isSafari() {
// return /^((?!chrome).)*safari/i.test(navigator.userAgent);
// }
// if(isSafari()) {
// var a = $('svg #Logo a');
// var href = a.attr('xlink:href');
// a.attr('data-href', href).attr('xlink:href', null);
// a.on('click', function(e) {
// e.preventDefault();
// window.location = $(this).data('href');
// });
// }
if(/^((?!chrome).)*safari/i.test(navigator.userAgent)) {
var a = document.querySelector('#Logo a');
var href = a.getAttributeNS('http://www.w3.org/1999/xlink', 'href');
a.setAttribute('data-href', href);
a.removeAttributeNS('http://www.w3.org/1999/xlink', 'href');
a.addEventListener('click', function(e) {
window.location = e.target.parentNode.getAttribute('data-href');
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment