Skip to content

Instantly share code, notes, and snippets.

View alvarotrigo's full-sized avatar

Álvaro alvarotrigo

View GitHub Profile
@alvarotrigo
alvarotrigo / animations.css
Created April 11, 2018 12:25
Tumblr animations
.blogs-post {
background: #fff;
border-radius: 3px;
margin: 0 0 20px;
width: 300px;
transform: translateX(200px);
}
.blogs-post-column{
opacity: 0;
transform: translateX(0);
@alvarotrigo
alvarotrigo / afterResponsive.js
Created April 11, 2018 12:23
Tumblr responsive disabling parallax
afterResponsive: function(isResponsive){
if(isResponsive){
$.fn.fullpage.parallax.destroy();
}else{
$.fn.fullpage.parallax.init();
}
}
@alvarotrigo
alvarotrigo / styles.css
Created April 11, 2018 12:22
Tumblr responsive site
.fp-responsive .fp-bg{
position: relative !important;
}
.fp-responsive #section-2{
padding: 30px 0;
}
.fp-responsive .content{
padding: 10%;
}
.fp-responsive .section-3-wrapper{
@alvarotrigo
alvarotrigo / callbacks.js
Created April 11, 2018 12:19
tumblr effects using fullpage.js callbacks
onLeave: function(index, nextIndex, direction){
if(nextIndex === 2){
animationCont++;
//forcing the gift to start again
$('.section-2-animation')
.css('background-image', 'url(animation3.gif?v='+animationCont+')');
}
},
afterLoad: function(anchorLink, index){
@alvarotrigo
alvarotrigo / init.js
Created April 11, 2018 12:16
Tumblr initialisation
$(document).ready(function() {
var animationCont = 0;
$('#fullpage').fullpage({
sectionsColor: ['#36465d', '#55c598', '#a77dc2', 'whitesmoke', '#ccddff', '#ccc'],
anchors: ['firstPage', 'secondPage', '3rdPage', '4thpage'],
menu: '#menu',
navigation: true,
navigationPosition: 'left',
easingcss3: 'cubic-bezier(.825,0,.5,1)',
@alvarotrigo
alvarotrigo / www
Created February 26, 2018 14:23
socketio2
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require('../app');
var debug = require('debug')('tasks:server');
var http = require('http');
@alvarotrigo
alvarotrigo / app.js
Created February 26, 2018 14:22
socketio
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var swig = require('swig');
var mysql = require('mysql');
var routes = require('./routes/index');
var tickets = require('./routes/tickets');
@alvarotrigo
alvarotrigo / iscroll.js handler for fullpage.js
Created November 20, 2015 10:01
iscroll.js handler for fullpage.js
// We only want the iScroll to translate on touch devices.
// On overscroll, at least on iPhone, it seems to trigger a window
// scroll event which allows moving to the next section.
// If that doesn't happen, we would need to incorporate iscroll-probe
// to get access to the onscroll event and do our own determining of
// whether or not to move to the next fullpage section.
var iscrollOptions = {
disableMouse: true,
@alvarotrigo
alvarotrigo / index.html
Created August 27, 2015 11:30
Offset canvas push menu
<div id="offmenu">
<ul>
<li>aaa</li>
<li>aaa</li>
<li>aaa</li>
<li>aaa</li>
</ul>
</div>
<i id="push" class="fa fa-bars"></i>
function User(userData) {
userData = userData || {};
this.name = ko.observable(userData.name);
//copying all non existent properties
for(var key in userData) {
if(!self.hasOwnProperty(key)) {
self[key] = userData[key];
}