Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
todd404 committed Apr 14, 2018
0 parents commit a2ae7d6
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"globals": {
"$" : true,
"window" : true,
"document": true
},
"strict" : false,
"curly" : true,
"eqeqeq" : true,
"noarg" : true,
"noempty" : true,
"undef" : true,
"unused" : true,
"esversion": 6,
"jquery" : true,
"asi" : true
}
21 changes: 21 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "ui",
"version": "1.0.0",
"description": "\"A UI for samrt door\"",
"main": "src/js/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"devDependencies": {
"babel-cli": "^6.26.0",
"babel-core": "^6.26.0",
"babel-loader": "^7.1.4",
"babel-preset-env": "^1.6.1",
"babel-preset-react": "^6.24.1",
"jquery": "^3.3.1",
"webpack": "^4.5.0",
"webpack-cli": "^2.0.14"
}
}
14 changes: 14 additions & 0 deletions src/css/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
html{
width: 100%; height: 100%;
}

body{
width: 100%; height: 100%;
}

.open_button{
width: 30%;

border-radius: 50%;
background-color: red;
}
19 changes: 19 additions & 0 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>UI</title>
<link rel="stylesheet" href="index.css">
<script src="jquery.js"></script>
<script src="index.js"></script>

</head>

<body>
<div class="open_button"></div>
<div class="manage_button"></div>
<div class="password_button"></div>
</body>
</html>
10 changes: 10 additions & 0 deletions src/js/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'jquery';

$(document).ready(()=>{
let buttons = {
open_button : $(".open_button"),
manage_button : $(".manage_button"),
password_button: $(".password_button")
}

})
30 changes: 30 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@

module.exports = {
entry: __dirname + "src/js/index.js",//已多次提及的唯一入口文件
output: {
path: __dirname + "assets/js",//打包后的文件存放的地方
filename: "bundle.js"//打包后输出文件的文件名
},
devtool: 'eval-source-map',
devServer: {
contentBase: "./assets",//本地服务器所加载的页面所在的目录
historyApiFallback: true,//不跳转
inline: true//实时刷新
},
module: {
rules: [
{
test: /(\.jsx|\.js)$/,
use: {
loader: "babel-loader",
options: {
presets: [
"env"
]
}
},
exclude: /node_modules/
}
]
}
};

0 comments on commit a2ae7d6

Please sign in to comment.