Skip to content

Instantly share code, notes, and snippets.

View pketh's full-sized avatar
🐢
https://kinopio.club

Pirijan pketh

🐢
https://kinopio.club
View GitHub Profile
@pketh
pketh / gist:7707387
Last active December 29, 2015 17:59
using jquery and easing js, smooth scroll to a specific anchor links
// smooth scroll to a specific section on the same page
function smoothScroll (selector) {
$('html, body').animate(
{
scrollTop: jQuery(selector).offset().top
},
600,
'easeOutCubic', // curves from http://easings.net/
function(){
$('#company').focus();
@pketh
pketh / parallax.js
Created September 24, 2013 15:50
simple parallax scrolling using jquery
//simple version targetting a position: absolute div
$(window).on("scroll",function(){
$('.target').css({"top" : ( .5 * $(window).scrollTop() ) + 100 })
// the .5 refers to parallax speed (higher is faster)
// the 100 refers to the initial start position offset (higher is further down)
})
// version with additional fading out as you scroll down
@pketh
pketh / paragraphs-date.js
Last active December 17, 2015 12:59
Date converter hack for the 'paragraphs' osx static blogging platform. Currently, it only outputs dates in a single format. This hack gives you friendly, flexible formatting.
$(document).ready(function(){
$( ".date" ).each(function( ) {
var month = $(this).text().substring(0,2);
var day = $(this).text().substring(7,9);
var year = $(this).text().substring(9,11);
if (month == 01) {
var month = 'Jan';
@pketh
pketh / gist:4152195
Created November 27, 2012 03:32
Simple Mobile First @media queries
/*
=============================
# Mobile First @media queries
=============================
*/
/* styles for iphone portrait go up here*/
/* Smartphones (landscape) ----------- */
@media only screen