Skip to content

Commit

Permalink
添加首页
Browse files Browse the repository at this point in the history
  • Loading branch information
malun666 committed Jun 12, 2017
1 parent bc1cb96 commit 63137d0
Show file tree
Hide file tree
Showing 34 changed files with 904 additions and 5 deletions.
27 changes: 27 additions & 0 deletions .autod.conf.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
'use strict';

module.exports = {
write: true,
prefix: '^',
plugin: 'autod-egg',
test: [
'test',
'benchmark',
],
dep: [
],
devdep: [
'egg-ci',
'egg-bin',
'autod',
'autod-egg',
'eslint',
'eslint-config-egg',
'webstorm-disable-index',
],
exclude: [
'./test/fixtures',
'./dist',
],
};

1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "eslint-config-egg"
}
24 changes: 24 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Thank you for your pull request. Please review below requirements.
Bug fixes and new features should include tests and possibly benchmarks.
Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md
感谢您贡献代码。请确认下列 checklist 的完成情况。
Bug 修复和新功能必须包含测试,必要时请附上性能测试。
Contributors guide: https://github.com/eggjs/egg/blob/master/CONTRIBUTING.md
-->

##### Checklist
<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

- [ ] `npm test` passes
- [ ] tests and/or benchmarks are included
- [ ] documentation is changed or added
- [ ] commit message follows commit guidelines

##### Affected core subsystem(s)
<!-- Provide affected core subsystem(s). -->


##### Description of change
<!-- Provide a description of the change below this comment. -->
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
logs/
npm-debug.log
node_modules/
coverage/
.idea/
run/
.DS_Store
*.swp

11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
sudo: false
language: node_js
node_js:
- '6'
- '8'
install:
- npm i npminstall && npminstall
script:
- npm run ci
after_script:
- npminstall codecov && codecov
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# hamkd

The app for hamkd.com
The app for [hamkd.com](http://www.hamkd.com)

## QuickStart

<!-- add docs here for user -->

see [egg docs][egg] for more detail.
see [docs][egg] for more detail.

### Development
```shell
Expand All @@ -29,5 +29,12 @@ $ EGG_SERVER_ENV=prod npm start
- Use `npm test` to run unit test.
- Use `npm run autod` to auto detect dependencies upgrade, see [autod](https://www.npmjs.com/package/autod) for more detail.

## Thanks

[egg]: https://eggjs.org
thanks for
- [egg][egg]
- nodejs
- koa


[egg]: https://eggjs.org
7 changes: 6 additions & 1 deletion app/controller/home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@
module.exports = app => {
class HomeController extends app.Controller {
* index() {
this.ctx.body = 'hi, egg';
const data = {
name: 'hamkd',
__pageUrl__: 'home/index.tpl'
};
// this.ctx.body = 'hi, hamkd';
yield this.ctx.render('_layout.tpl', data);
}
}
return HomeController;
Expand Down
15 changes: 15 additions & 0 deletions app/middleware/setpageurl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use strict'

// middleware的名字不能有下划线。this有request、response、app等属性

module.exports = (option, app) => {
return function* (next) {

// console.log(this)
// this.local.__pageUrl__ = "";
// console.log(this.request.path)
// console.log(this.request.url)
yield next;

}
}
60 changes: 60 additions & 0 deletions app/public/css/common.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

95 changes: 95 additions & 0 deletions app/public/css/common.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
$body-bg-color: rgb(245,248,250);
$block-line-color: #e6ecf0;
$nav-active-color: #0084B4;

// 公共
ul.list-no-style {
list-style: none;
overflow: hidden;
padding: 0;

li {
list-style: none;
float: left;
margin: 5px 15px 5px 0;

a {
display: block;
}
}
}

// 导航条的默认高度
$nav-bar-height: 50px;

body {
padding-top: $nav-bar-height + 5px;
background-color: $body-bg-color;
}

.topbar {
border-bottom: 1px solid $block-line-color;
font-size: 18px;
background-color: #fff;

.nav-logo {
display: block;
margin-top: -8px;
}

.nav-active {
border-bottom: 3px solid $nav-active-color;
}
}

// 标签导航云
.label-nav, .label-nav li {
list-style: none;
}
.label-nav a {

display: block;
float: left;
margin: 5px 10px 5px 0px;
color: #e6ecf0;
border-radius: 5%;
background-color: lighten($nav-active-color,5%);

&:hover {
color: #fff;
background-color: lighten($nav-active-color,10%);
}
}

.site-slogan {
margin-top: 10px;
}

// 中间列表
.note-list {
margin: 15px 0;
}

// 侧边栏
.side-bar-label {
a {
background-color: $nav-active-color;
color: #e6ecf0;
padding: 4px 5px;
border-radius: 5px;
text-decoration: none;

&:hover {
color: #fff;
background-color: lighten($nav-active-color, 5%);
}
}
}

// 网站底部
.footer {
text-align: center;
border-top: 1px solid $block-line-color;
}


Binary file added app/public/img/a.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/favicon.ico
Binary file not shown.
Binary file added app/public/img/hmkd-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo_100x100.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo_1024x1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo_16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo_22x22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo_64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/logo_70X40.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/img/noimg.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 63137d0

Please sign in to comment.