Skip to content

Commit e67591e

Browse files
author
chunwei
committed
day one
1 parent 2661991 commit e67591e

File tree

15 files changed

+44902
-17
lines changed

15 files changed

+44902
-17
lines changed

.idea/encodings.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

comments.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
[
22
{
33
"author": "Pete Hunt",
4-
"text": "Hey there!"
4+
"text": "Hey there!",
5+
"likedCount":0
56
},
67
{
78
"author": "Paul O’Shannessy",
8-
"text": "React is *great*!"
9+
"text": "React is *great*!",
10+
"likedCount":15
11+
},
12+
{
13+
"author": "小明",
14+
"text": "我是晓明,come on baby。我是晓明,come on baby。我是晓明,come on baby。我是晓明,come on baby。",
15+
"likedCount":15
916
}
1017
]

public/css/base.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,4 @@ p, ul {
6060
ul {
6161
padding-left: 30px;
6262
}
63+

public/css/comment.css

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
button, html input[type="button"], input[type="reset"], input[type="submit"] {
2+
cursor: pointer;
3+
-webkit-appearance: none;
4+
}
5+
.comment{
6+
margin-top: 20px;
7+
border-bottom: solid 1px #eee;
8+
}
9+
.commentHeader,.commentContent, .commentFooter{
10+
position: relative;
11+
overflow: hidden;
12+
}
13+
.commentContent, .commentFooter{
14+
padding-left: 50px;
15+
}
16+
.commentHeader .commentAuthor{
17+
font-size: 1.2em;
18+
color: #666;
19+
}
20+
.commentHeader .commentAuthor .author{
21+
line-height: 40px;
22+
}
23+
.commentHeader .commentAuthor .avatar{
24+
display: block;
25+
width: 40px;
26+
height: 40px;
27+
float: left;
28+
margin-right: 10px;
29+
}
30+
.commentHeader .avatar>img{
31+
width: 100%;
32+
border-radius: 50%;
33+
}
34+
.commentHeader .likeBtn{
35+
position: absolute;
36+
top: 5px;
37+
right: 0;
38+
cursor: pointer;
39+
}
40+
.commentHeader .likeBtn span{
41+
display: inline-block;
42+
color:#aaa;
43+
float: left;
44+
}
45+
.commentHeader .likeBtn.liked span{
46+
color: #faad4c;
47+
}
48+
.commentHeader .likeBtn .likeCount{
49+
height: 32px;
50+
line-height: 45px;
51+
}
52+
.commentHeader .likeBtn .icon-like{
53+
width:32px;
54+
height: 32px;
55+
margin-left: 6px;
56+
background-image: url('../img/like.png');
57+
background-repeat: no-repeat;
58+
background-size: 85%;
59+
background-position: center center;
60+
}
61+
.commentHeader .likeBtn.liked .icon-like{
62+
background-image: url('../img/liked.png');
63+
}
64+
65+
66+
.commentFooter span{
67+
display: inline-block;
68+
font-size: 12px;
69+
}
70+
.commentFooter .time{
71+
float: left;
72+
color:#aaa;
73+
}
74+
.commentFooter .reply{
75+
float: right;
76+
color: #faad4c;
77+
}
78+
79+
.commentFormHolder{
80+
display: none;
81+
position: fixed;
82+
top: 0;
83+
left: 0;
84+
width: 100%;
85+
height: 100%;
86+
background-color: #eee;
87+
}
88+
.commentForm .content-textarea{
89+
width: 100%;
90+
font-size: 14px;
91+
line-height: 24px;
92+
padding: 4px 10px;
93+
box-sizing:border-box;
94+
-moz-box-sizing:border-box; /* Firefox */
95+
-webkit-box-sizing:border-box; /* Safari */
96+
border: none;
97+
}
98+
.commentForm .submit{
99+
font-size: 1.1em;
100+
width: 60%;
101+
color: #fff;
102+
background-color: #39C784;
103+
border: none;
104+
border-radius: 5px;
105+
padding: 10px;
106+
margin: 0 20%;
107+
}
108+
.commentBar{
109+
position: fixed;
110+
width: 100%;
111+
bottom: 0;
112+
left: 0;
113+
padding: 10px 0;
114+
border-top: solid 1px #ccc;
115+
background-color: #fff;
116+
}
117+
.commentBar .BtnOpenForm{
118+
font-size: 1.1em;
119+
width: 60%;
120+
color: #fff;
121+
background-color: #faad4c;
122+
border: none;
123+
border-radius: 5px;
124+
padding: 10px;
125+
margin: 0 20%;
126+
}

public/img/like.png

2.34 KB
Loading

public/img/liked.png

2.44 KB
Loading

public/img/user.jpg

11.2 KB
Loading

public/img/user.png

2.04 KB
Loading

public/index.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge;chrome=1">
6+
<meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
47
<title>Hello React</title>
58
<!-- Not present in the tutorial. Just for basic styling. -->
69
<link rel="stylesheet" href="css/base.css" />
7-
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.0/react.js"></script>
8-
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.0/JSXTransformer.js"></script>
9-
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
10-
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/0.3.2/marked.min.js"></script>
10+
<link rel="stylesheet" href="css/comment.css" />
11+
<script src="lib/react.js"></script>
12+
<script src="lib/JSXTransformer.js"></script>
13+
<script src="lib/jquery.min.js"></script>
14+
<script src="lib/marked.min.js"></script>
1115
</head>
1216
<body>
1317
<div id="content"></div>

0 commit comments

Comments
 (0)