Skip to content

Instantly share code, notes, and snippets.

View tanshio's full-sized avatar
🤢
😭

Shota Tanno tanshio

🤢
😭
View GitHub Profile
@tanshio
tanshio / gulpfile.js
Created July 16, 2014 05:32
gulp20140716
/**
*
* Web Starter Kit
* Copyright 2014 Google Inc. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@tanshio
tanshio / function.php
Created July 18, 2014 17:28
my_theme_switcher
// 特定のURL、固定ページのみ「theme」を切り替える
// http://ja.forums.wordpress.org/topic/13483
function my_theme_switcher($theme){
// yes, it's hardcoded!
if ( $_SERVER['REQUEST_URI'] == 'HOMEからのパス' ) { // /lp/2014/
$overrideTheme = wp_get_theme('テーマ名');
if ( $overrideTheme->exists() ) {
return $overrideTheme['テーマ名'];
} else {
@tanshio
tanshio / gulpfile.js
Created July 31, 2014 07:50
gulp20140731
'use strict';
var gulp = require('gulp'),
$ = require('gulp-load-plugins')(),
jade = require('gulp-jade'),
browserSync = require('browser-sync'),
reload = browserSync.reload,
runSequence = require('run-sequence');
gulp.task('jade', function() {
@tanshio
tanshio / vender.js
Created August 7, 2014 22:02
vender
var vender = (/webkit/i).test(navigator.appVersion) ? 'webkit' :
(/firefox/i).test(navigator.userAgent) ? 'moz' :
(/trident/i).test(navigator.userAgent) ? 'ms' :
'opera' in window ? 'O' : '';
@tanshio
tanshio / ease.js
Created August 8, 2014 09:07
easejs
var date = new Date();
//t=now-date
//b=最初の値
//c=最後の値
//d=何秒
Math.ease = function(t, b, c, d, s) {
if(s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
@tanshio
tanshio / smoothscroll.js
Created August 13, 2014 23:37
smoothscroll.js
Math.ease = function (t, b, c, d) {
t /= d/2;
if (t < 1) return c/2*t*t*t + b;
t -= 2;
return c/2*(t*t*t + 2) + b;
};
function smoothScroll(hash){
var date = new Date(),
@tanshio
tanshio / loop.js
Created August 15, 2014 13:30
配列.js
for (var i = 0, item; item = 配列[i++];) {
// item について何かする
}
@tanshio
tanshio / lightbox.js
Created August 15, 2014 13:45
lightbox.js
lightbox = (function(){
var lightboxList = document.querySelectorAll('.js-gallery img'),
lightboxLength = lightboxList.length;
for (var i = 0; i < lightboxLength; i++) {
lightboxList[i].setAttribute('deta-lb-number',i);
lightboxList[i].addEventListener('click', lightboxShow, false);
}
@tanshio
tanshio / deleteVender.js
Created August 15, 2014 20:35
deleteVender.js
function deleteVendor(vendor){
var re = /^webkit|^moz|^ms|^O/g,
str = vendor,
newstr = str.replace(re, "");
return newstr.toLowerCase();
}
@tanshio
tanshio / fadePage.js
Last active August 29, 2015 14:05
fadePage.js
;(function(window,config){
function deleteVendor(vendor){
var re = /^webkit|^moz|^ms|^O/g,
str = vendor,
noVendor = str.replace(re, "");
return noVendor.toLowerCase();
}