Skip to content

Instantly share code, notes, and snippets.

View mach3's full-sized avatar
🏠
Working from home

まっは mach3

🏠
Working from home
View GitHub Profile
@mach3
mach3 / grunt-pngquant.js
Last active December 25, 2015 05:59
更新時刻を保持するpngquantタスク
/**
* Grunt task for pngquant
* -----------------------
*/
// @example:
//
// pngquant: {
// options: {
// preserve_mtime: true
@mach3
mach3 / jquery-attrs.js
Created September 17, 2013 18:37
html要素に設定した属性を全て取得するやつ
(function($, undefined){
/**
* Get all custom attributes
* @param HTMLElement el
* @return Object
*/
$.getAttributes = function(el){
var $el, data, add, i;
$el = $(el);
@mach3
mach3 / jquery-transition.js
Last active December 22, 2015 21:58
CSSのTransitionを$.fn.animateっぽく使うやつ。Transition非対応環境で$.fn.animateでそれっぽくフォールバックする。
(function($){
/**
* Detect support of css transition, event name
*/
$.support.transitionInfo = (function(){
var el, names, name, info = null;
el = document.createElement("div");
names = {
"WebkitTransition": "webkitTransitionEnd",
@mach3
mach3 / jquery.swipeevents.js
Created September 4, 2013 12:38
スワイプイベントを発火するやつを試作
(function($){
/**
* Detect supports
*/
$.support.touchEvents = "ontouchstart" in document;
$.support.msPointerEvents = window.navigator.msPointerEnabled;
/**
* Swipe event object
@mach3
mach3 / assets.js
Last active December 21, 2015 19:29
harvestは根本的な不具合があったので、ローダーだけクラスにしてみた
(function(win, doc){
var Assets = function(){
this.items = [];
this.nodes = [];
this.attrs = {
callback: null,
append: true
};
};
@mach3
mach3 / harvest.js
Created August 24, 2013 20:30
シンプルなスクリプトローダーの試作版
(function(win, doc){
/**
* Namespace
* ---------
*/
var ns = win._harvest = {};
/**
* Loader
@mach3
mach3 / peekaboo-02.js
Last active December 21, 2015 00:38
表示領域に要素が入ったら何かするための係の人。
(function($, win, doc){
$.peekaboo = {
DATA_INIT: "peekabooInit",
DATA_MODE_FULL: "peekabooFullMode",
DATA_SHOW: "peekabooShow",
EVENT_SHOW: "peekabooShow",
EVENT_HIDE: "peekabooHide",
@mach3
mach3 / zenhan.js
Created August 12, 2013 17:32
文字列内の数字・アルファベット・基本的な記号を全角半角変換する係の人。
(function(global){
/**
* ZenHan
* ------
*/
var ZenHan = Backbone.Model.extend({
/**
* Attributes:
@mach3
mach3 / vmlimage.js
Created August 10, 2013 17:59
IMG要素を元にVMLで画像表示するだけ。属性・スタイル変更やイベントにも対応。
(function($, doc){
/**
* vmlImage
* --------
*/
var vmlImage = {
/**
* Attributes:
@mach3
mach3 / README.md
Last active December 19, 2015 09:39
ある数値を監視してブレークポイントリスト内の位置を返す人。またぐとファイヤーする。

ある数値を監視してブレークポイントリスト内のインデックスと値を返す人。
ブレークポイントをまたいだらファイヤーします。
Backbone.js使えば半分以下になるに違いない。

きがむいたらちゃんと体裁を整える。