This file contains 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
$.fn.haneru = function (x, y, takasa, duration) { | |
var self = this; | |
return self.queue(function () { | |
var offset = self.offset(); | |
var step = function (now, fx) { | |
if (fx.prop !== 'y') return; | |
self.css({ | |
left:fx.elem.x, | |
top:fx.elem.y - Math.sin(Math.PI * fx.pos) * takasa | |
}); |
This file contains 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
// comment 、 IP アドレス表記には未対応。 | |
var emailReg = /^([-!#-'*+/-9=?A-Z^-~]+(\.([-!#-'*+/-9=?A-Z^-~]+|"([!#-\[\]-~]|\\[\x00-~])+"))*|"([!#-\[\]-~]|\\[\x00-~])+")@([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*)$/; | |
// RFC 822 との互換性を考慮しない | |
var emailReg = /^([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*|"([!#-\[\]-~]|\\[\x00-~])+")@([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*)$/; | |
// ダブルクオート内であっても制御文字を許可しない | |
var emailReg = /^([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*|"([!#-\[\]-~]|\\[\x09 -~])+")@([-!#-'*+/-9=?A-Z^-~]+(\.[-!#-'*+/-9=?A-Z^-~]+)*)$/; | |
// ローカルパートにおけるピリオドの連続を許可する(ただし先頭のピリオドは許可しない) |
This file contains 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
// 先頭の数字は許可する(RFC的にはNG)、連続したハイフンは許可する(RFC的にはOKだが多くのレジストラは禁止している) | |
var domainReg = /^[0-9a-z]([-0-9a-z]*[0-9a-z])?(\.[0-9a-z]([-0-9a-z]*[0-9a-z])?)+$/i; |
This file contains 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
// 2016-09-23 リポジトリにしました。 | |
// https://github.com/tsmd/twitter-text-tweetlength-js |
This file contains 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
h1 {} | |
/* ====================================================== | |
// | |
// ほげほげほげ | |
// ふがふがふが | |
// | |
// ====================================================== */ | |
// ====================================================== |
This file contains 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 fromIntArray(array) { | |
var str = ''; | |
var octet = new Uint8Array(new Uint32Array(array).buffer); | |
for (var i = 0; i < octet.length; i++) { | |
str += String.fromCharCode(octet[i]); | |
} | |
return btoa(str); | |
} | |
function toIntArray(ascii) { |
This file contains 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 hiragana_random(size) { | |
var str = ''; | |
while (size--) { | |
str += String.fromCharCode(12353 + Math.floor(Math.random() * 82)); | |
} | |
return str; | |
} |
This file contains 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
@font-face { | |
font-family: Emoji; | |
src: local('Hiragino Kaku Gothic ProN'), | |
local(Meiryo); | |
} | |
@font-face { | |
font-family: Emoji; | |
src: local('Segoe UI Emoji'), | |
local('Segoe UI Symbol'), |
This file contains 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 isPinchZooming () { | |
const clientWidth = document.documentElement.clientWidth | |
const viewportWidth = window.visualViewport ? window.visualViewport.width : window.innerWidth | |
return clientWidth > viewportWidth | |
} |
This file contains 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 isStandalone () { | |
if ('standalone' in window.navigator) { | |
return window.navigator.standalone | |
} else { | |
return window.matchMedia('(display-mode: standalone)').matches | |
} | |
} |
OlderNewer