Inspired from Giantbomb's own Login button. I made this to learn how they did it; turns it out it's quite simple but with a powerful elegance behind it.
A Pen by Sergio Tapia Gutierrez on CodePen.
| <script type="text/javascript"> | |
| var listaProdutos = []; | |
| for(var i = 0; i < document.getElementsByClassName("id-produto").length; i++) | |
| { | |
| if(i < 3) | |
| { | |
| listaProdutos.push(document.getElementsByClassName("id-produto")[i].innerHTML); | |
| } | |
| } |
| /** | |
| * Convert mouse events into touch events. | |
| * From: http://ross.posterous.com/2008/08/19/iphone-touch-events-in-javascript/ | |
| */ | |
| function touchHandler(event) { | |
| var touch = event.changedTouches[0]; | |
| var simulatedEvent = document.createEvent("MouseEvent"); | |
| simulatedEvent.initMouseEvent({ | |
| touchstart: "mousedown", |
| CSS Escalavél | |
| /** CSS Reset **/ | |
| http://meyerweb.com/eric/tools/css/reset/ | |
| /** GuideLine @mdo | |
| http://mdo.github.io/code-guide/ | |
| /** Modularização folhas de estilo **/ | |
| http://codepen.io/chriscoyier/blog/codepens-css#organization-files |
| .DS_Store | |
| log/*.log | |
| tmp/**/* | |
| config/database.yml | |
| db/*.sqlite3 |
| $("#user_picture").change -> | |
| userPictureFileName = $(this).val().split('\\').pop(); | |
| $("#user_picture_text").html(userPictureFileName) | |
| files = this.files | |
| reader = new FileReader() | |
| reader.readAsDataURL(files[0]) | |
| reader.onloadend = -> | |
| $("#profile_pic").css("background-image", "url(" + this.result + ")") | |
| $("#user_cover_photo").change -> |
| 'use strict'; | |
| module.exports = function(grunt) { | |
| // load all grunt tasks | |
| require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
| // configurable paths | |
| var paths = { |
| 'use strict'; | |
| module.exports = function(grunt) { | |
| // load all grunt tasks | |
| require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
| // configurable paths | |
| var paths = { |
| #AngularJS Application List (sorted alphabetically) | |
| Here is a list of some Angular Free Application / snippets to help you out with your projects | |
| angular git://github.com/angular/bower-angular.git | |
| 25th-angular-utils git://github.com/25th-floor/angular-utils.git | |
| 28.io-angularjs git://github.com/28msec/28.io-angularjs.git | |
| 4vanger-angular-l10n git://github.com/4vanger/angular-l10n.git | |
| Angular-NestedSortable git://github.com/JimLiu/Angular-NestedSortable.git | |
| Angular-localStorage git://github.com/agrublev/Angular-localStorage.git |