A collection of freaking awesome HTML5 demos (work in progress).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ | |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), | |
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) | |
})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); | |
ga('create', 'UA-XXXX-Y', 'auto'); | |
ga('send', 'pageview'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var forms = $("form"); | |
forms.on("submit", function(){ | |
var form = $(this); | |
ga("send", "event", "forms", | |
form.attr("name") || form.attr("id"), | |
"submit"; | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var $window = $(window), | |
$document = $(document), | |
scrollEnd = function(){ | |
if(($window.height() + $window.scrollTop() + 20) >= $document.height()){ | |
ga("send", "event", "scroll", document.location.pathname, "100%"); | |
$window.off("scroll", scrollEnd); | |
} | |
}; | |
$window.on("scroll", scrollEnd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var links = $("a"), | |
fistClick = function(){ | |
var link = $(this); | |
ga("send", "event", | |
"first-click", | |
document.location.pathname, | |
link.text() + "|" + link.attr("href") | |
); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
$("a").on("mousedown", function(){ | |
if(this.protocol === "http:" || this.protocol === "https:"){ | |
if(this.hostname !== document.location.hostname){ | |
ga("send", "event", "external-links", document.location.pathname, this.href); | |
} | |
} | |
}); | |
})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ==|======================================================================= | |
Grid // http://semantic.gs/ | |
========================================================================== */ | |
/* Altere estes valores de acordo com a largura das colunas, | |
largura das margens e o número de colunas do seu grid.*/ | |
@column-width: 60; | |
@gutter-width: 20; | |
@columns: 12; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do (window, document) -> | |
iframes = document.getElementsByTagName("iframe") | |
youTubeIframes = [] | |
regex = /.*youtube.*\/(embed|v)\/(.+)\?.*/ | |
window.youtube = window.youtube or {} | |
youtube.movies = youtube.movies or {} | |
category = youtube.movies.category = if youtube.movies.category then youtube.movies.category else "youtube" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @function bitLy | |
* @param {string} long_url - Long URL to shorten | |
* @param {function} func - receives short url | |
*/ | |
function bitLy(long_url, func){ | |
$.getJSON( | |
"http://api.bitly.com/v3/shorten?callback=?", | |
{ | |
"format": "json", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% | |
String requestURL = request.getRequestURL().toString(); | |
String queryString = request.getQueryString(); | |
String redirectUrl = "http://redirect.to/path"; | |
if (queryString != null) redirectUrl += "?" + queryString; | |
response.setStatus(301); | |
response.setHeader( "Location", redirectUrl); | |
response.setHeader( "Connection", "close" ); | |
%> |
OlderNewer