Force to use LF and add editorconfig

This commit is contained in:
Yuya Ochiai
2016-02-26 00:06:41 +09:00
parent 50084fe74f
commit 7defd861e8
3 changed files with 39 additions and 28 deletions

8
.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
root = true
[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true

View File

@@ -22,12 +22,15 @@ gulp.task('prettify:verify', ['prettify:sources:verify', 'prettify:jsx:verify'])
var prettify_options = { var prettify_options = {
html: { html: {
eol: '\n',
indentSize: 2 indentSize: 2
}, },
css: { css: {
eol: '\n',
indentSize: 2 indentSize: 2
}, },
js: { js: {
eol: '\n',
indentSize: 2, indentSize: 2,
braceStyle: "end-expand" braceStyle: "end-expand"
} }

View File

@@ -1,29 +1,29 @@
'use strict'; 'use strict';
var createDataURL = function(text) { var createDataURL = function(text) {
const scale = 2; // should rely display dpi const scale = 2; // should rely display dpi
const size = 16 * scale; const size = 16 * scale;
const canvas = document.createElement('canvas'); const canvas = document.createElement('canvas');
canvas.setAttribute('width', size); canvas.setAttribute('width', size);
canvas.setAttribute('height', size); canvas.setAttribute('height', size);
const ctx = canvas.getContext('2d'); const ctx = canvas.getContext('2d');
// circle // circle
ctx.fillStyle = "#FF1744"; // Material Red A400 ctx.fillStyle = "#FF1744"; // Material Red A400
ctx.beginPath(); ctx.beginPath();
ctx.arc(size / 2, size / 2, size / 2, 0, Math.PI * 2); ctx.arc(size / 2, size / 2, size / 2, 0, Math.PI * 2);
ctx.fill(); ctx.fill();
// text // text
ctx.fillStyle = "#ffffff" ctx.fillStyle = "#ffffff"
ctx.textAlign = 'center'; ctx.textAlign = 'center';
ctx.textBaseline = 'middle'; ctx.textBaseline = 'middle';
ctx.font = (11 * scale) + "px sans-serif"; ctx.font = (11 * scale) + "px sans-serif";
ctx.fillText(text, size / 2, size / 2, size); ctx.fillText(text, size / 2, size / 2, size);
return canvas.toDataURL(); return canvas.toDataURL();
}; };
module.exports = { module.exports = {
createDataURL: createDataURL createDataURL: createDataURL
}; };