Skip to content

Commit 2a6fe24

Browse files
committed
update
1 parent 80a679e commit 2a6fe24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+4391
-591
lines changed

.browserslistrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR

.editorconfig

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Editor configuration, see https://editorconfig.org
2+
3+
## 打开文件时,EditorConfig 插件会在打开的文件的目录和每个父目录中查找名为 .editorconfig 的文件。
4+
## 如果到达根文件路径或找到具有 root=true 的 EditorConfig 文件,将停止对 .editorconfig 文件的搜索。
5+
## 如果 root=true 没有配置, EditorConfig 插件将会在工程之外寻找 .editorconfig 文件
6+
root = true
7+
8+
## 使用规则匹配文件
9+
## * 匹配任何字符串,路径分隔符 (/) 除外
10+
## ** 匹配任意字符串
11+
## ? 匹配任何单个字符
12+
## [name] 匹配给定的字符串中的任何单个字符
13+
## [!name] 匹配不在给定字符串中的任何单个字符
14+
## {s1,s2,s3} 匹配任意给定的字符串
15+
## {num1..num2} 匹配num1和num2之间的任何整数,其中num1和num2可以是正数或负数
16+
## 如规则[*.{js}]只对 .js 文件生效。一般来说,我们配置 [*] 对所有文件生效。
17+
[*]
18+
19+
## 设置为latin1、utf-8、utf-8-bom、utf-16be或utf-16le来控制字符集。
20+
charset = utf-8
21+
22+
## 缩进方式。 值可以是tab或者space
23+
indent_style = space
24+
25+
## 缩进大小。当设置为tab时,会取tab_width的值。
26+
indent_size = 2
27+
28+
## 通常不需要设置。当indent_size=tab时才会生效。
29+
tab_width = 2
30+
31+
## 设置为lf、cr或crlf以控制如何表示换行符。
32+
end_of_line = lf
33+
34+
## 设置为true以确保文件在保存时以换行符结束,设置为false以确保不以换行符结束。
35+
insert_final_newline = true
36+
37+
## 设置为true以删除换行符之前的任何空格字符,设置为false以确保不会。
38+
trim_trailing_whitespace = true
39+
40+
[*.ts]
41+
quote_type = single
42+
43+
[*.md]
44+
max_line_length = off
45+
trim_trailing_whitespace = false

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
es6: true,
5+
browser: true,
6+
node: true,
7+
},
8+
parser: "babel-eslint",
9+
globals: {
10+
__DEV__: true,
11+
If: true,
12+
For: true,
13+
POBrowser: true,
14+
},
15+
};

.prettierrc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"tabWidth": 2,
3+
"semi": true,
4+
"singleQuote": true,
5+
"jsxSingleQuote": true,
6+
"bracketSpacing": true,
7+
"jsxBracketSameLine": true,
8+
"printWidth": 140,
9+
"endOfLine": "auto",
10+
"proseWrap": "preserve",
11+
"trailingComma": "es5",
12+
"useTabs": false
13+
}

.stylelintignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/*.min.css
2+
3+
.vscode/
4+
.idea/
5+
node_modules/
6+
dist/
7+
build/

.stylelintrc.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"extends": ["stylelint-config-standard", "stylelint-config-recommended-scss"],
3+
"validate": ["stylelint-scss"],
4+
"rules": {
5+
"max-empty-lines": 4,
6+
"string-quotes": "single",
7+
"function-url-quotes": "never",
8+
"color-hex-length": "long",
9+
"media-feature-no-missing-punctuation": null,
10+
"declaration-colon-newline-after": null,
11+
"font-family-name-quotes": null,
12+
"number-leading-zero": "never",
13+
"value-list-comma-newline-after": null,
14+
"max-nesting-depth": 2
15+
}
16+
}

2048/index.html

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,32 @@
22
<html>
33

44
<head>
5-
<meta charset="UTF-8">
6-
<meta name="viewport"
7-
content="width=device-width,height=device-height,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
8-
<link rel="stylesheet" href="css/style.css" />
9-
<script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
10-
<script type="text/javascript" src="js/my2048.js"></script>
5+
<meta charset="utf-8">
6+
<title>2048</title>
7+
<meta name="google-site-verification" content="pLPl8oqL0Adf4p5s9zT-pXnpfF-2TMlOTEjoDl7DpSY" />
8+
<meta name="baidu-site-verification" content="code-gZR6EVVpaO" />
9+
<meta name="viewport" content="width=device-width, initial-scale=1">
10+
<link rel="stylesheet" href="css/style.css" />
11+
<script type="text/javascript" src="../js/jquery-2.1.4.min.js"></script>
12+
<script type="text/javascript" src="js/my2048.js"></script>
1113
</head>
1214

1315
<body>
14-
<div class="my2048">
15-
<header>
16-
<a href="javascript:newgame();" id="newgamebtn" class="button">重新开始</a>
17-
<p>分数:<span id="score">0</span></p>
18-
</header>
19-
<div id="grid-container"></div>
20-
<footer>游戏说明:PC端键盘方向键控制↑→↓←<br>手机端左右上下滑屏控制!!</footer>
21-
</div>
22-
<script>
23-
var my2048 = new my2048($("#grid-container"));
24-
my2048.init();
25-
function newgame() {
26-
my2048.init();
27-
}
28-
</script>
16+
<div class="my2048">
17+
<header>
18+
<a href="javascript:newgame();" id="newgamebtn" class="button">重新开始</a>
19+
<p>分数:<span id="score">0</span></p>
20+
</header>
21+
<div id="grid-container"></div>
22+
<footer>游戏说明:PC端键盘方向键控制↑→↓←<br>手机端左右上下滑屏控制!!</footer>
23+
</div>
24+
<script>
25+
var my2048 = new my2048($("#grid-container"));
26+
my2048.init();
27+
function newgame() {
28+
my2048.init();
29+
}
30+
</script>
2931
</body>
3032

31-
</html>
33+
</html>

0 commit comments

Comments
 (0)