Skip to content

Instantly share code, notes, and snippets.

View gangsthub's full-sized avatar
Creative developer

Paul Melero gangsthub

Creative developer
View GitHub Profile
@gangsthub
gangsthub / rAF.js
Created August 25, 2014 01:25 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];

Mobile first - hide on scroll menu

Mobile first responsive navigation. On scroll the navigation slides up, on up scroll the menu is slides down.

Small screen menu icon animates to a X when menu is visible.

In the wild:

http://vanamco.com/ http://mailchimp.com/

TremulaJS Boilerplate

TremulaJS is a client-side javascript UI component providing Bézier-based content-stream interactions with momentum & physics effects for mouse, scroll and and touch UIs.

This Pen allows you to experiment using different config file settings.

A Pen by Garris on CodePen.

License.

Only Web-kit experiment called Julia.js

This is an experiment I'm working on, I want to call it Julia.js.

The only thing thats will cause not working fine on firefox is the -webkit-background-clip: text; thing. Any ideas?

Also I'm planning to add a "save button" via canvas... ;)

Inspired by: Glen Maddern's Pen wxaGg.

@gangsthub
gangsthub / Preventing draggable images or selection on every image
Created February 24, 2015 17:28
Preventing downloading images by blocking right click on DOM elements and CSS in modern browsers (made for http://erikaabenia.com/)
img {
/* Preventing draggable images or selection on every image. Use at your own risk. */
-webkit-user-select:none;
-webkit-touch-callout:none; /*Safari, safari mobile; iPhone OS*/
-khtml-user-select: none;
-ms-user-select: none;
-o-user-select: none;
user-select: none;
}

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@gangsthub
gangsthub / Hard Cross Browser Opacity
Last active August 29, 2015 14:21
Two versions: with and without `!important`
// Inspired in:
// https://css-tricks.com/snippets/css/cross-browser-opacity/
// http://zerosixthree.se/8-sass-mixins-you-must-have-in-your-toolbox/
// Usage: `@include hardOpacity(1);`, `@include hardOpacity(.5);`
@mixin hardOpacity($valueOpacity) {
$unitOp: unit($valueOpacity);
$valOp: parseInt($valueOpacity);
@gangsthub
gangsthub / placeholders.scss
Last active April 4, 2016 10:05
Styling placeholders Cross Browser SCSS mixin
// Usage example:
// input[type="text"] {
// @include placeholders {
// color: currentColor;
// }
// }
//
// See: https://css-tricks.com/almanac/selectors/p/placeholder/
@gangsthub
gangsthub / dropdown-on-click.js
Last active May 4, 2016 19:30
Drop it like its hot
$(function(){
// dropdown function to pass to "dropdown actions"
// if you want the containers to be shown by default, add to the the class `.shown` in the markup
// Author: Paul Melero
// Url: https://gist.github.com/gangsthub/157a833258b43cfbeb64148b6d0dcc7c/
// Scroll func
var scrollSpeed = 500,