Skip to content

Instantly share code, notes, and snippets.

@nekoneko-wanwan
nekoneko-wanwan / html2canvas_sample.js
Created October 27, 2015 02:27
キャプチャした画面を自分のCanvasに渡して操作する
// キャプチャしたCanvasのデータを自分のCanvasアクション関数に渡す
html2canvas(document.body, {
onrendered: function(canvas) {
var url = canvas.toDataURL('image/png');
var w = canvas.width;
var h = canvas.height;
myCanvasAction(url, w, h);
}
});
@nekoneko-wanwan
nekoneko-wanwan / start.html
Created October 26, 2015 04:14
シンプルなブランクのテンプレート
<!-- https://github.com/sixrevisions/html5-template -->
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
<title></title>
<meta name="description" content="">
<meta name="author" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@nekoneko-wanwan
nekoneko-wanwan / script.sh
Created October 23, 2015 09:30
現在いるディレクトリから、_(アンダーバー)の付いていない.scssファイルに、一括して_を付ける
#!/bin/bash
# _で始まらないscssファイル
for file in `find . -type f ! -name "_*" -and -name "*.scss"`
do
# echo 'allName:' $file
# echo 'dirName: ' ${file%/*}
# echo 'fileName: ' ${file##*/}
mv $file ${file%/*}/_${file##*/}
done
@nekoneko-wanwan
nekoneko-wanwan / fukidashi.js
Last active October 14, 2015 04:37
Canvasで漫画の吹き出しを再現
var cs = document.getElementById('myCanvas');
var ctx = cs.getContext('2d');
var csWidth = cs.width;
var csHeight = cs.height;
/**
* ランダムな整数を返す
* Math.round(四捨五入)に変更したので、max,minはそれぞれその値を含む
* @param max 最大値
* @param min 最小値
@nekoneko-wanwan
nekoneko-wanwan / canvas.js
Created October 3, 2015 05:25
Canvasで正多角形を書く
/**
* 円周上の座標を返す
* @param d 角度
* @param r 半径
* @param cx, cy 中心座標
*/
var getCircumPos = {
// x座標
x: function(d, r, cx) {
return Math.cos(Math.PI / 180 * d) * r + cx;
@nekoneko-wanwan
nekoneko-wanwan / star.css
Created September 25, 2015 09:39
CSSのみで星を作成し、くるくる回す
.wrapper {
overflow: hidden;
}
.star {
position: relative;
height: 200px;
width: 200px;
margin: 200px;
background-color: black;
animation: anim 3s infinite linear;
@nekoneko-wanwan
nekoneko-wanwan / tab.css
Last active September 15, 2015 05:21
使い勝手の良いタブメニューの作成
.tabs .is_active {
color: red;
}
.tab-content {
display: none;
}
.tab-content.is_show {
display: block;
}
@nekoneko-wanwan
nekoneko-wanwan / index.html
Last active August 29, 2015 14:27
Google MapとMarker clusterの連動基本
<!-- 省略 -->
<script src="https://maps.googleapis.com/maps/api/js"></script>
<script src="markerclusterer_compiled.js"></script>
<script src="map.js"></script>
<!-- 省略 -->
<!--
markerclusterer_compiled.js
src -> https://github.com/googlemaps/js-marker-clusterer
@nekoneko-wanwan
nekoneko-wanwan / 0_index.html
Last active April 13, 2016 07:02
Google Map V3 使い方基本
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="map"></div>
@nekoneko-wanwan
nekoneko-wanwan / chrome_devtools.md
Last active August 29, 2015 14:25
Chromeデベロッパーツールメモ

Chromeデベロッパーツールメモ

date: 2015/07/22時点
version: 43.0.2357.134 m