Skip to content

Commit

Permalink
Update style
Browse files Browse the repository at this point in the history
  • Loading branch information
superman66 committed Jul 12, 2017
1 parent 34c3ca9 commit d202785
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 50 deletions.
67 changes: 67 additions & 0 deletions public/styles/main.css
@@ -0,0 +1,67 @@
body {
padding: 80px;
font: 16px Helvetica, Arial;
color: #b9b9b9;
background: rgba(244, 242, 242, 0.36);
}
h1 {
font-size: 2em;
font-weight: 100;
}
h2 {
font-size: 1.2em;
font-weight: 100;
}

a{
text-decoration: none;
color: rgb(152, 152, 152);
}
a:hover{
text-decoration: underline;
}
#posts {
margin: 0;
padding: 0;
}
#posts li {
margin: 10px 0;
padding: 0;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
list-style: none;
}

#posts li:last-child {
border-bottom: none;
}
textarea {
width: 500px;
height: 300px;
}
input[type=text],
textarea {
border: 1px solid #eee;
border-top-color: #ddd;
border-left-color: #ddd;
border-radius: 2px;
padding: 15px;
font-size: .8em;
}
input[type=text] {
width: 500px;
}
.book{
margin: 0 auto;
width:50%;
min-width: 500px;
}
.book .info{
list-style: none;
margin: 0;
padding: 0;
}

.book .info li{
margin: 9px;
}
1 change: 1 addition & 0 deletions routes.js
Expand Up @@ -2,6 +2,7 @@ const Router = require('koa-router')();
const books = require('./controllers/book');

module.exports = function(app){
Router.redirect('/', '/book')
Router.use('/book', books.routes())
app.use(Router.routes())
};
18 changes: 12 additions & 6 deletions views/book.html
Expand Up @@ -4,10 +4,16 @@
{% block title %}book{% endblock %}

{% block content %}
<h1>{{ book.name }}</h1>
<ul id="post">
<li>作者:{{ book.author }}</li>
<li>isbn: {{ book.isbn }}</li>
<li>url: {{ book.url }}</li>
</ul>
<div class="book">
<h1>{{ book.name }}</h1>
<ul class="info">
<li>作者:{{ book.author }}</li>
<li>isbn: {{ book.isbn }}</li>
<li>url:
<a href="{{ book.url }}" target="_blank">
{{ book.url }}
</a>
</li>
</ul>
</div>
{% endblock %}
43 changes: 1 addition & 42 deletions views/layout.html
@@ -1,48 +1,7 @@
<html>
<head>
<title>{% block title %}Blog{% endblock %}</title>
<style>
body {
padding: 80px;
font: 16px Helvetica, Arial;
}
h1 {
font-size: 2em;
}
h2 {
font-size: 1.2em;
}
#posts {
margin: 0;
padding: 0;
}
#posts li {
margin: 40px 0;
padding: 0;
padding-bottom: 20px;
border-bottom: 1px solid #eee;
list-style: none;
}
#posts li:last-child {
border-bottom: none;
}
textarea {
width: 500px;
height: 300px;
}
input[type=text],
textarea {
border: 1px solid #eee;
border-top-color: #ddd;
border-left-color: #ddd;
border-radius: 2px;
padding: 15px;
font-size: .8em;
}
input[type=text] {
width: 500px;
}
</style>
<link rel="stylesheet" href="/styles/main.css">
</head>
<body>
<section id="content">
Expand Down
5 changes: 3 additions & 2 deletions views/list.html
Expand Up @@ -9,8 +9,9 @@ <h1>Books Library</h1>
<ul id="posts">
{% for book in books %}
<li>
<h2>{{ book.name }}</h2>
<p><a href="/book/{{ book._id.toString() }}">More Detail</a></p>
<a href="/book/{{ book._id.toString() }}">
{{book.name}}
</a>
</li>
{% endfor %}
</ul>
Expand Down

0 comments on commit d202785

Please sign in to comment.