mirror of
https://github.com/liriliri/eruda.git
synced 2026-05-20 08:47:20 +08:00
Dev: Init dev tools
This commit is contained in:
6
.eustia
Normal file
6
.eustia
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
module.exports = {
|
||||||
|
files: 'src/**/*.es6',
|
||||||
|
output: 'src/util.js',
|
||||||
|
format: 'commonjs',
|
||||||
|
namespace: 'eruda'
|
||||||
|
};
|
||||||
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
/.idea/
|
||||||
|
/node_modules/
|
||||||
2
dev/typo.dic
Normal file
2
dev/typo.dic
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
eruda
|
||||||
|
scss
|
||||||
3254
dist/eruda.js
vendored
Normal file
3254
dist/eruda.js
vendored
Normal file
File diff suppressed because one or more lines are too long
34
package.json
Normal file
34
package.json
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
{
|
||||||
|
"name": "eruda",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"description": "Console for mobile JavaScript",
|
||||||
|
"main": "index.js",
|
||||||
|
"scripts": {
|
||||||
|
"build": ""
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/liriliri/eruda.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"console",
|
||||||
|
"mobile",
|
||||||
|
"debug"
|
||||||
|
],
|
||||||
|
"author": "redhoodsu",
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/liriliri/eruda/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/liriliri/eruda#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"babel-core": "^6.6.5",
|
||||||
|
"babel-loader": "^6.2.4",
|
||||||
|
"babel-preset-es2015": "^6.6.0",
|
||||||
|
"css-loader": "^0.23.1",
|
||||||
|
"handlebars": "^4.0.5",
|
||||||
|
"handlebars-loader": "^1.1.4",
|
||||||
|
"node-sass": "^3.4.2",
|
||||||
|
"sass-loader": "^3.1.2"
|
||||||
|
}
|
||||||
|
}
|
||||||
28
src/homeBtn/index.es6
Normal file
28
src/homeBtn/index.es6
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import util from '../util'
|
||||||
|
|
||||||
|
require('!style!css!sass!./style.scss');
|
||||||
|
|
||||||
|
export default class HomeBtn {
|
||||||
|
constructor($parent)
|
||||||
|
{
|
||||||
|
this.$parent = $parent;
|
||||||
|
|
||||||
|
this.appendTpl();
|
||||||
|
this.bindEvent();
|
||||||
|
}
|
||||||
|
appendTpl()
|
||||||
|
{
|
||||||
|
var $parent = this.$parent;
|
||||||
|
|
||||||
|
$parent.append(require('./template.hbs')());
|
||||||
|
|
||||||
|
this.$el = $parent.find('.home-btn');
|
||||||
|
}
|
||||||
|
bindEvent()
|
||||||
|
{
|
||||||
|
this.$el.on('click', function ()
|
||||||
|
{
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
22
src/homeBtn/style.scss
Normal file
22
src/homeBtn/style.scss
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#eruda {
|
||||||
|
.home-btn {
|
||||||
|
width: 50px;
|
||||||
|
height: 50px;
|
||||||
|
background: rgba(0, 0, 0, 0.8);
|
||||||
|
opacity: 0.5;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding-top: 6px;
|
||||||
|
.circle {
|
||||||
|
background: #fff;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin: 0 auto;
|
||||||
|
width: 30px;
|
||||||
|
height: 30px;
|
||||||
|
border: 4px solid #ccc;
|
||||||
|
}
|
||||||
|
&:hover {
|
||||||
|
opacity: 0.8;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
3
src/homeBtn/template.hbs
Normal file
3
src/homeBtn/template.hbs
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<div class="home-btn">
|
||||||
|
<div class="circle"></div>
|
||||||
|
</div>
|
||||||
19
src/index.es6
Normal file
19
src/index.es6
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import HomeBtn from './HomeBtn/index.es6'
|
||||||
|
import util from './util'
|
||||||
|
|
||||||
|
var $container;
|
||||||
|
|
||||||
|
var isDebugMode = /debug=true/.test(window.location.search);
|
||||||
|
|
||||||
|
if (isDebugMode)
|
||||||
|
{
|
||||||
|
appendContainer();
|
||||||
|
var homeBtn = new HomeBtn($container);
|
||||||
|
}
|
||||||
|
|
||||||
|
function appendContainer()
|
||||||
|
{
|
||||||
|
util.$('body').append('<div id="eruda"></div>');
|
||||||
|
$container = util.$('#eruda');
|
||||||
|
}
|
||||||
|
|
||||||
1586
src/util.js
Normal file
1586
src/util.js
Normal file
File diff suppressed because it is too large
Load Diff
16
test/index.html
Normal file
16
test/index.html
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
|
||||||
|
<title>Eruda</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background: #b4bad2;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<script src="../dist/eruda.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
24
webpack.config.js
Normal file
24
webpack.config.js
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
module.exports = {
|
||||||
|
entry: './src/index.es6',
|
||||||
|
output: {
|
||||||
|
path: __dirname + '/dist/',
|
||||||
|
filename: 'eruda.js',
|
||||||
|
library: ['eruda']
|
||||||
|
},
|
||||||
|
module: {
|
||||||
|
loaders: [
|
||||||
|
{
|
||||||
|
test: /\.es6$/,
|
||||||
|
loader: 'babel?presets[]=es2015'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.scss$/,
|
||||||
|
loaders: ['style', 'css', 'sass']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
test: /\.hbs$/,
|
||||||
|
loader: 'handlebars-loader'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user