Skip to content

Instantly share code, notes, and snippets.

View omniosi's full-sized avatar

Ornette Coleman omniosi

View GitHub Profile
@omniosi
omniosi / jsbin.qegik.html
Last active August 29, 2015 13:56
Illustrator SVG converted with http://readysetraphael.com/ to RaphaelJS with notes on how to make the file work correctly.
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="rsr"></div>
</body>
@omniosi
omniosi / jsbin.zaxiyoxi.css
Last active December 2, 2015 12:00
an animated opening and closing menu button made with RaphaelJS and inspired by http://www.hugeinc.com/. It even works in IE6!
#box{
background:lightgrey;
width:60px;
height:60px;
}
@omniosi
omniosi / jsbin.ripiq.css
Created February 28, 2014 19:43
a CSS-animated menu/close button inspired by http://www.hugeinc.com/
*{
-webkit-transition: opacity 100ms ease;
transition: opacity 100ms ease;
-webkit-transition: all 500ms ease;
transition: all 500ms ease;
}
#box{
background:lightgrey;
width:60px;
height:60px;
@omniosi
omniosi / jsbin.xamak.html
Last active August 29, 2015 13:56
animating arm tween with Raphael JS
<!DOCTYPE html>
<html>
<head>
<script src="http://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<div id="box"></div>
</body>
@omniosi
omniosi / jsbin.gesuf.html
Created February 13, 2014 17:12
function to reveal more
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<ul>
<li>One</li>
@omniosi
omniosi / custom console log
Created February 4, 2014 14:50
a function to call a console log to avoid console issues in IE
//custom console.log
function log(msg){
try{
console.log(msg);
}
catch(e){
}
}
@omniosi
omniosi / JS-code-timer
Last active December 23, 2015 00:19
You can use the console.time() and console.timeEnd() methods to measure how long a function or operation in your code takes to complete. You call console.time() at the point in your code where you want to start the timer and console.timeEnd() to stop the timer. The elapsed time between these two calls is displayed in the console. see: https://de…
console.time("Array initialize");
// code to measure
var array= new Array(1000000);
for (var i = array.length - 1; i >= 0; i--) {
array[i] = new Object();
};
console.timeEnd("Array initialize");
// console results = Array initialize: 461.127ms
@omniosi
omniosi / clearfix-break
Created September 9, 2013 20:55
a clearfix to create a break using css styling. see: http://css-tricks.com/snippets/css/clear-fix/
.group:after {
content: "";
display: table;
clear: both;
}
@omniosi
omniosi / namespacing
Created August 1, 2013 23:03
explaining how to lock your variables and functions to this code alone to make sure there is no interference with other code on the page or site.
<!DOCTYPE html>
<html>
<head>
<title>Name spacing</title>
</head>
<body>
<script type="text/javascript">
var namespace = {
firstname: 'Ornette',
@omniosi
omniosi / parallax-scrolling
Last active December 20, 2015 09:19
parallax scrolling
$(document).ready(function(){
$(window).bind('scroll',function(e){
parallax();
});
});
function parallax(){
var scrollPosition = $(window).scrollTop();
$('#stars').css('top',(0 - (scrollPosition * .2))+'px');
$('#images').css('top', (0 - (scrollPosition * .5)) + 'px');
}