This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function f (min, max, length) { | |
var arr = [], | |
i = 0; | |
for (; i < length; i++) { | |
arr.push( | |
i % (max - min + 1) + min | |
); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint multistr: true */ | |
// 全ての艦名 (改造艦は含まない) | |
var allKanmusu = | |
"長門, 陸奥, 伊勢, 日向, 雪風,\ | |
赤城, 加賀, 蒼龍, 飛龍, 島風,\ | |
吹雪, 白雪, 初雪, 深雪, 叢雲,\ | |
磯波, 綾波, 敷波, 大井, 北上,\ | |
金剛, 比叡, 榛名, 霧島, 鳳翔,\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addClass(elem, newClassName) { | |
var className, classes, classesLength; | |
if(typeof elem === 'string') { elem = document.getElementById(elem); } | |
if(elem === null || elem.nodeType !== 1 || typeof newClassName !== 'string') { return null; } | |
className = elem.className; | |
classes = newClassName.split(' '), | |
classIndex = classes.length; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; | |
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) { |