Skip to content

Instantly share code, notes, and snippets.

View cscuderi's full-sized avatar
🇮🇹

Carlin cscuderi

🇮🇹
View GitHub Profile
@cscuderi
cscuderi / animate-svg-path.js
Created September 1, 2014 00:52
Animate SVG path
var path = document.querySelector('.squiggle-animated path');
var length = path.getTotalLength();
// Clear any previous transition
path.style.transition = path.style.WebkitTransition =
'none';
// Set up the starting positions
path.style.strokeDasharray = length + ' ' + length;
path.style.strokeDashoffset = length;
// Trigger a layout so styles are calculated & the browser
// picks up the starting position before animating
@cscuderi
cscuderi / ie7-pseudo.css
Created January 3, 2014 18:13
Adds support for :before and :after (in the form of .before and .after classes) to IE7. Use with Modernizr.
.lt-ie8 .class-selector {
*zoom: expression(
this.runtimeStyle.zoom="1",
this.insertBefore(
document.createElement("div"),
this.childNodes[0]
).className="before",
this.appendChild(
document.createElement("div")
).className="after"
@cscuderi
cscuderi / sliding-menu.html
Last active January 1, 2016 07:59
A nice CSS3 sliding menu with fallback for older browsers.
<div id="outer-wrap">
<div id="inner-wrap">
<a id="nav-open-btn" class="menu-toggle" href="#nav">Toggle navigation</a>
<nav id="nav" class="main" role="navigation">
<div class="block">
<h2>Menu</h2>
<ul>
<li><a href="#">Information</a></li>
@cscuderi
cscuderi / 60fps.css
Last active December 30, 2015 01:09
JavaScript that toggles a universal class on scroll to disable pointer events. Removes the class when the user stops scrolling. From http://www.thecssninja.com/javascript/pointer-events-60fps
.disable-hover,
.disable-hover * {
pointer-events: none !important;
}