├── Data.jsp
├── Index.jsp
├── about.jsp
├── ajaxGet.jsp
├── css
├── Index.css
├── about.css
├── album.css
├── data.css
├── friends.css
├── messageBoard.css
├── mobile.css
├── mystyle.css
├── recommend.css
├── search.css
├── setting.css
└── visitHome.css
├── delete.jsp
├── deleteMessageBoard.jsp
├── deleteMessageBoard2.jsp
├── friends.jsp
├── images
├── .DS_Store
├── aboutWrap.jpg
├── arrows-30.png
├── avatar
│ ├── default_avatar.jpeg
│ ├── default_avatar.jpg
│ ├── fon.jpg
│ ├── hh.png
│ ├── lexBurner.png
│ ├── prin.png
│ ├── tomato.png
│ ├── xmq.jpeg
│ ├── zhou.png
│ ├── zhuang.jpg
│ ├── zkh.jpeg
│ ├── zsh.jpeg
│ └── zyl.jpeg
├── back.png
├── bamboo.png
├── blogEmpty.jpg
├── boke.png
├── carousel
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── leaves.jpg
│ ├── tower.jpg
│ └── water.jpg
├── close.png
├── default_avatar.jpeg
├── default_avatar.jpg
├── dianzan.png
├── emoji
│ ├── angry.png
│ ├── astonishing.png
│ ├── cool.png
│ ├── embarrassed.png
│ ├── ghost.png
│ ├── hurt.png
│ ├── laugh.png
│ ├── laughcry.png
│ ├── liking.png
│ ├── naughty.png
│ ├── sad.png
│ ├── shit.png
│ ├── shocking.png
│ ├── skeleton.png
│ ├── sleep.png
│ ├── think.png
│ ├── vomit.png
│ ├── weap.png
│ ├── ʺ.png
│ ├── 受伤.png
│ ├── 吐.png
│ ├── 喜欢.png
│ ├── 大笑.png
│ ├── 尴尬.png
│ ├── 屎.png
│ ├── 思考.png
│ ├── 惊讶.png
│ ├── 流泪.png
│ ├── 生气.png
│ ├── 睡觉.png
│ ├── 笑哭.png
│ ├── 耍酷.png
│ ├── 调皮.png
│ ├── 难过.png
│ ├── 震惊.png
│ ├── 骷髅.png
│ └── 鬼脸.png
├── expand-menu.png
├── expand_black.png
├── fan.png
├── guanzhu.png
├── homepic.jpeg
├── horse.png
├── icon
│ ├── .DS_Store
│ ├── bold.png
│ ├── dataEdit.png
│ ├── email.png
│ ├── exit.png
│ ├── gaojibianji.png
│ ├── huanyuan.png
│ ├── jinghao.png
│ ├── level3Comment.png
│ ├── link.png
│ ├── maobi.png
│ ├── phone.png
│ ├── picture.png
│ ├── quanping.png
│ ├── return.png
│ ├── search.png
│ ├── search2.png
│ ├── setting.png
│ ├── submit.png
│ ├── title.png
│ ├── underline.png
│ ├── xiaolian.png
│ ├── xieti.png
│ ├── zhizhang.png
│ └── ziliao.png
├── navigator.png
├── pen.png
├── picture.png
├── recommend
│ ├── fon.jpg
│ ├── grass.jpg
│ ├── hh.png
│ ├── leaves.jpg
│ ├── lexBurner.png
│ ├── prin.png
│ ├── tomato.png
│ ├── tower.jpg
│ ├── water.jpg
│ └── zhou.png
├── team
│ ├── .DS_Store
│ ├── xmq.jpeg
│ ├── zkh.jpeg
│ ├── zsh.jpeg
│ └── zyl.jpeg
└── wholehomepic.jpeg
├── js
├── data.js
├── friends.js
├── general.js
├── index.js
├── loginAndRegister.js
├── messageBoard.js
├── recommend.js
├── setting.js
├── shadow.js
└── visitMessageBoard.js
├── login.jsp
├── loginCheck.jsp
├── messageBoard.jsp
├── readme.md
├── recommend.jsp
├── registerCheck.jsp
├── reply.jsp
├── replyLevel3.jsp
├── search.jsp
├── setting.jsp
├── settingAjax.jsp
├── settingAjax2.jsp
├── signup.jsp
├── test.jsp
├── test2.jsp
├── visitData.jsp
├── visitHome.jsp
├── visitMessageBoard.jsp
├── visitReply.jsp
└── visitReplyLevel3.jsp
/about.jsp:
--------------------------------------------------------------------------------
1 | <%@page language="java" import="java.util.*,java.sql.*" contentType="text/html; charset=utf-8"%>
2 | <% request.setCharacterEncoding("utf-8");%>
3 | <%@ page import="java.io.*, java.util.*, org.apache.commons.io.*"%>
4 | <%@ page import="org.apache.commons.fileupload.*"%>
5 | <%@ page import="org.apache.commons.fileupload.disk.*"%>
6 | <%@ page import="org.apache.commons.fileupload.servlet.*"%>
7 | <%
8 | String webUser = ""; //登录用户
9 | String imageName = "";
10 | String msg = "";
11 | String connectString = "jdbc:mysql://172.18.187.10:3306/blog_15336202" + "?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
12 | String user = "user";
13 | String pwd = "123";
14 | Class.forName("com.mysql.jdbc.Driver");
15 | Connection con = DriverManager.getConnection(connectString, user, pwd);
16 | Statement stmt = con.createStatement();
17 |
18 | Cookie cookies[] = request.getCookies(); //读出用户硬盘上的Cookie,并将所有的Cookie放到一个cookie对象数组里面
19 | if (cookies != null) {
20 | for (int i = 0; i < cookies.length; i ++) { //用一个循环语句遍历刚才建立的Cookie对象数组
21 | if(cookies[i].getName().equals("user")){ //如果cookie对象的名称是mrCookie
22 | webUser = cookies[i].getValue(); //获取用户名
23 | }
24 | }
25 | }
26 |
27 | if (request.getMethod().equalsIgnoreCase("post")){
28 | request.setCharacterEncoding("utf-8");
29 | String imagePath = ""; // 图片路径
30 | boolean isMultipart = ServletFileUpload.isMultipartContent(request); // 检查表单中是否包含文件
31 | if (isMultipart) {
32 |
33 | FileItemFactory factory = new DiskFileItemFactory();
34 | //factory.setSizeThreshold(yourMaxMemorySize); // 设置使用的内存最大值
35 | //factory.setRepository(yourTempDirectory); // 设置文件临时目录
36 |
37 | ServletFileUpload upload = new ServletFileUpload(factory);
38 | // upload.setSizeMax(yourMaxRequestSize); // 允许的最大文件尺寸
39 |
40 | List items = upload.parseRequest(request);
41 | String Id = "";
42 | for (int i = 0; i < items.size(); i ++) {
43 | FileItem fi = (FileItem) items.get(i);
44 | if (fi.isFormField()) { // 如果是表单字段,获取对应的id信息
45 | if (fi.getFieldName().equals("id")) {
46 | Id = fi.getString("utf-8");
47 | }
48 | }
49 | else {
50 | DiskFileItem dfi = (DiskFileItem) fi;
51 | if (!dfi.getName().trim().equals("")) { // getName()返回文件名称或空串
52 | String fileName = application.getRealPath("/images/avatar") + System.getProperty("file.separator") + FilenameUtils.getName(dfi.getName());
53 | imagePath = new File(fileName).getAbsolutePath(); // 获取图片路径
54 | imageName = FilenameUtils.getName(dfi.getName()); // 获取图片名字
55 | out.print(imagePath);
56 | System.out.println(new File(fileName).getAbsolutePath());
57 | dfi.write(new File(fileName));
58 |
59 | // 保存图片
60 | String path = imageName;
61 | try {
62 | String sql = "update users set avatar='" + imageName + "' where name='" + webUser + "'";
63 | int cnt = stmt.executeUpdate(sql);
64 | if (cnt > 0) msg = "保存成功!";
65 | }
66 | catch (Exception e) {
67 | msg = e.getMessage();
68 | }
69 | }
70 | }
71 | }
72 | }
73 | }
74 | else {
75 | //String[] image = new String[1000];
76 | ResultSet rs = stmt.executeQuery("select avatar from users where name='" + webUser + "'");
77 | if (rs.next()) {
78 | imageName = rs.getString("avatar");
79 | }
80 | rs.close();
81 | }
82 | stmt.close(); con.close();
83 | %>
84 |
85 |
86 |
87 |
88 |
89 |
251 |
259 |
260 |
281 |
282 |
292 |
293 |
294 |
324 |
325 |
--------------------------------------------------------------------------------
/ajaxGet.jsp:
--------------------------------------------------------------------------------
1 | <%@page language="java" import="java.util.*,java.sql.*" contentType="text/html; charset=utf-8"%>
2 | <% request.setCharacterEncoding("utf-8");
3 | String msg="";
4 | String follower = request.getParameter("userId");
5 | String followed = request.getParameter("followedId");
6 | String conStr = "jdbc:mysql://172.18.187.10:3306/blog_15336202"
7 | + "?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
8 |
9 | Class.forName("com.mysql.jdbc.Driver"); // 查找数据库驱动类
10 | Connection con=DriverManager.getConnection(conStr, "user", "123");
11 | Statement stmt=con.createStatement(); //创建MySQL语句的对象
12 | ResultSet rs=stmt.executeQuery("select * from followers where fans_id='" + follower + "' and followed_id='" + followed + "'");
13 |
14 | //1.原先不存在关注关系->执行关注操作
15 | if (!rs.next()) {
16 | String fmt="insert into followers(fans_id, followed_id) values('%s', '%s')";
17 | String sql = String.format(fmt, follower, followed);
18 | stmt.executeUpdate(sql);
19 | out.print("已关注");
20 | }
21 |
22 | //2.原先存在关注关系->取关
23 | else{
24 | int cnt = stmt.executeUpdate("delete from followers where fans_id='"+follower+"' and followed_id='" + followed + "'");
25 | out.print("关注");
26 | }
27 |
28 | rs.close(); stmt.close(); con.close();
29 | %>
--------------------------------------------------------------------------------
/css/Index.css:
--------------------------------------------------------------------------------
1 | #main #wrap #nav #index {
2 | color: black;
3 | }
4 |
5 | #main #wrap #nav #li_index {
6 | border-bottom: solid 2px #919191;
7 | }
8 |
9 |
10 | /****************************博客主信息分区**************************************/
11 | #main #content #information {
12 | position: absolute;
13 | width: 14%;
14 | height: 215px;
15 | right: 20px;
16 | top: 25px;
17 | display: block;
18 | border-top-left-radius: 20px;
19 | border-bottom-right-radius: 20px;
20 | background: linear-gradient(to right, #ebebeb, #8a8a8a);
21 | }
22 |
23 | #main #content #information legend {
24 | text-shadow: 2px 2px 3px black;
25 | }
26 |
27 | #main #content #information #fan {
28 | position: relative;
29 | height: 20px;
30 | width: 120px;
31 | top: 20px;
32 | margin: 0px auto;
33 | text-align: center;
34 | }
35 |
36 | #main #content #information #guanzhu {
37 | position: relative;
38 | height: 20px;
39 | width: 120px;
40 | top: 40px;
41 | margin: 0px auto;
42 | text-align: center;
43 | }
44 |
45 | #main #content #information #blog_num {
46 | position: relative;
47 | height: 20px;
48 | width: 120px;
49 | top: 60px;
50 | margin: 0px auto;
51 | text-align: center;
52 | }
53 |
54 | #main #content #information #like {
55 | position: relative;
56 | height: 20px;
57 | width: 120px;
58 | top: 80px;
59 | margin: 0px auto;
60 | text-align: center;
61 | }
62 |
63 | /**********************博客分区**************************/
64 | #blog_zone {
65 | position: relative;
66 | display: block;
67 | top: 80px;
68 | left: 6%;
69 | width: 70%;
70 | max-width: 70%;
71 | border-top-left-radius: 20px;
72 | border-bottom-right-radius: 20px;
73 | margin-bottom: 10px;
74 | }
75 |
76 | .blog_block {
77 | position: relative;
78 | border-radius: 5px;
79 | display: block;
80 | margin: 0px auto;
81 | margin-bottom: 20px;
82 | margin-top: 20px;
83 | padding: 12px;
84 | padding-bottom: 24px;
85 | padding-top: 24px;
86 | background: linear-gradient(to left, #8a8a8a, #ebebeb);
87 | border-radius: 20px;
88 | width: 90%;
89 | max-width: 90%;
90 | }
91 |
92 | .blog_block a {
93 | color: black;
94 | font-size: 14px;
95 | }
96 |
97 | .blog_block a:hover {
98 | text-decoration: underline;
99 | cursor: pointer;
100 | }
101 |
102 | .blog_block .blog_time {
103 | position: relative;
104 | display: inline-block;
105 | float: right;
106 | right: 0px;
107 | top: -5px;
108 | font-size: 10px;
109 | color: #ebebeb;
110 | }
111 |
112 | .blog_block .blog_content {
113 | position: relative;
114 | display: inline-block;
115 | font-size: 20px;
116 | left: 35px;
117 | width: 90%;
118 | }
119 |
120 | .blog_block .blog_operator {
121 | position: relative;
122 | display: block;
123 | bottom: 0px;
124 | width: 100%;
125 | height: 14px;
126 | font-size: 14px;
127 | }
128 |
129 | .blog_block .blog_operator .azone {
130 | position: relative;
131 | float: right;
132 | display: none;
133 | }
134 |
135 | .blog_block .replyText {
136 | position: relative;
137 | top: 20px;
138 | left: 30px;
139 | display: none;
140 | }
141 |
142 | .blog_block .replyText textarea {
143 | position: relative;
144 | border-radius: 5px;
145 | outline: none;
146 | font-size: 15px;
147 | width: 85%;
148 | height: 45px;
149 | top: -8px;
150 | }
151 |
152 | .blog_block .replyText img {
153 | position: relative;
154 | cursor: pointer;
155 | opacity: 0.5;
156 | display: "block";
157 | }
158 |
159 | .blog_block .replyText img:hover {
160 | opacity: 1;
161 | }
162 |
163 | .blog_block .replyText .replyClose {
164 | top: -43px;
165 | }
166 |
167 | .blog_block .replyText .replyImg {
168 | left: -20px;
169 | z-index: 100;
170 | top: -8px;
171 | }
172 |
173 | .blog_block .replyText .img:hover {
174 | opacity: 1;
175 | }
176 |
177 | /************************移动端******************************/
178 | @media only screen and (max-width: 740px) {
179 | #main #wrap #welcomeBack {
180 | display: none;
181 | }
182 |
183 | #main #content #board {
184 | top: 170px;
185 | height: 120px;
186 | }
187 |
188 | #main #content #board #board_set #msg {
189 | top: 5px;
190 | height: 70%;
191 | }
192 |
193 | #main #content #information {
194 | width: 70%;
195 | height: 100px;
196 | top: 30px;
197 | left: 0px;
198 | margin: 0px auto;
199 | }
200 |
201 | #main #content #information #fan {
202 | top: 15px;
203 | margin: 0px;
204 | left: 10%;
205 | }
206 |
207 | #main #content #information #guanzhu {
208 | top: -5px;
209 | margin: 0px;
210 | left: 50%;
211 | }
212 |
213 | #main #content #information #blog_num {
214 | top: 15px;
215 | margin: 0px;
216 | left: 10%;
217 | }
218 |
219 | #main #content #information #like {
220 | top: -5px;
221 | margin: 0px;
222 | left: 50%;
223 | }
224 |
225 | #blog_zone {
226 | top: 225px;
227 | left: 50px;
228 | }
229 | }
230 |
231 | @media only screen and (max-width: 1100px) {
232 | #main #content #information {
233 | right: 0px;
234 | }
235 | }
236 |
237 |
238 |
239 |
240 |
241 |
242 |
243 |
244 |
245 |
246 |
247 |
248 |
249 |
--------------------------------------------------------------------------------
/css/about.css:
--------------------------------------------------------------------------------
1 | #aboutWrap {
2 | position: relative;
3 | top: 0px;
4 | width: 80%;
5 | height: 60px;
6 | float: right;
7 | right: 0px;
8 | color: black;
9 | font-size: 25px;
10 | text-align: center;
11 | background: url("../images/aboutWrap.jpg");
12 | background-position: 0% 20%;
13 | }
14 |
15 | #aboutMain {
16 | position: relative;
17 | float: right;
18 | right: 0px;
19 | top: 0px;
20 | width: 80%;
21 | height: 1170px;
22 | background: linear-gradient(to right, #fff, #ebebeb);
23 | color: black;
24 | }
25 |
26 | #aboutMain #introduction {
27 | position: relative;
28 | top: 20px;
29 | width: 760px;
30 | height: 260px;
31 | margin: 0px auto;
32 | background: linear-gradient(to right, #ebebeb, #8a8a8a);
33 | text-indent: 2em;
34 | padding: 40px;
35 | border-top-left-radius: 40px;
36 | border-bottom-right-radius: 40px;
37 | }
38 |
39 | #aboutMain #introduction p {
40 | font-size: 15px;
41 | }
42 |
43 |
44 |
45 | #aboutMain #contact {
46 | position: relative;
47 | background: linear-gradient(to right, #ebebeb, #8a8a8a);
48 | top: 60px;
49 | width: 800px;
50 | height: 150px;
51 | margin: 0px auto;
52 | padding: 20px;
53 | font-size: 15px;
54 | text-align: center;
55 | border-top-left-radius: 20px;
56 | border-bottom-right-radius: 20px;
57 | }
58 |
59 | #aboutMain legend {
60 | font-size: 20px;
61 | }
62 |
63 | #aboutMain #introduction #l0 {
64 | text-indent: 0;
65 | text-shadow: 2.5px 2.5px 1.5px #8a8a8a;
66 | }
67 |
68 | #aboutMain #team #l1 {
69 | text-align: center;
70 | text-shadow: 2.5px 2.5px 1.5px #8a8a8a;
71 | }
72 |
73 | #aboutMain #team .bamboo {
74 | position: absolute;
75 | left: 340px;
76 | }
77 |
78 | #aboutMain #contact #l2 {
79 | text-align: right;
80 | text-shadow: 2.5px 2.5px 1.5px #8a8a8a;
81 | }
82 |
83 | #aboutMain #team .member {
84 | position: relative;
85 | width: 270px;
86 | height: 110px;
87 | border-bottom: 1px solid black;
88 | }
89 |
90 | #aboutMain #team .member .photoZone {
91 | position: relative;
92 | top: 0px;
93 | width: 80px;
94 | height: 80px;
95 | border-radius: 50%;
96 | overflow: hidden;
97 | display: inline-block;
98 | }
99 |
100 | #aboutMain #team .member .teamPhoto {
101 | position: relative;
102 | width: 80px;
103 | cursor: pointer;
104 | }
105 |
106 | #aboutMain #team #member2 .teamPhoto {
107 | position: relative;
108 | width: 120px;
109 | left: -25px;
110 | }
111 |
112 | #aboutMain #team #member2 {
113 | top: -30px;
114 | }
115 |
116 | #aboutMain #team #member3 {
117 | top: 20px;
118 | }
119 |
120 | #aboutMain #team #member4 {
121 | top: -20px;
122 | }
123 |
124 | #aboutMain #team #member2, #member4 {
125 | float: right;
126 | }
127 |
128 | .bamboo {
129 | opacity: 0.8;
130 | }
131 |
132 | .expand {
133 | display: none;
134 | }
135 |
136 | /*for mobile devices */
137 |
138 |
--------------------------------------------------------------------------------
/css/album.css:
--------------------------------------------------------------------------------
1 | #main #wrap #nav #album {
2 | color: black;
3 | }
4 |
5 | #main #wrap #nav #li_album {
6 | border-bottom: solid 2px #919191;
7 | }
--------------------------------------------------------------------------------
/css/data.css:
--------------------------------------------------------------------------------
1 | #main #wrap #nav #data {
2 | color: black;
3 | }
4 |
5 | #main #wrap #nav #li_data {
6 | border-bottom: solid 2px #919191;
7 | }
8 |
9 | #main #content #data_board {
10 | position: relative;
11 | top: 20px;
12 | left: 6%;
13 | width: 80%;
14 | border-top-left-radius: 20px;
15 | border-bottom-right-radius: 20px;
16 | min-height: 500px;
17 | max-width: 700px;
18 | }
19 |
20 | #main #content #data_board #data {
21 | position: relative;
22 | width: 80%;
23 | height: 100%;
24 | top: 18px;
25 | left: 30px;
26 | }
27 |
28 | #main #content #data_board #data, #name, #sex, #sign, #birthday, #phone, #hobby, #hometown, #email, #job, #school, #company, #sign, #resume {
29 | position: relative;
30 | width: 100%;
31 | height: 35px;
32 | }
33 |
34 | #main #content #data_board #data .dataInput {
35 | border-top-left-radius: 5px;
36 | border-bottom-right-radius: 5px;
37 | height: 15px;
38 | font-size: 15px;
39 | display: none;
40 | width: 170px;
41 | }
42 |
43 | #main #content #data_board #data #resumeText {
44 | border-top-left-radius: 5px;
45 | border-bottom-right-radius: 5px;
46 | border: #8a8a8a solid 1px;
47 | height: 50px;
48 | font-size: 15px;
49 | width: 200px;
50 | }
51 |
52 | #main #content #data_board #dataEdit {
53 | position: relative;
54 | float: right;
55 | right: 0px;
56 | top: -40px;
57 | width: 15px;
58 | height: 15px;
59 | cursor: pointer;
60 | }
61 |
62 | #main #content #data_board #saveData {
63 | position: relative;
64 | float: right;
65 | top: -40px;
66 | font-size: 10px;
67 | cursor: pointer;
68 | display: none;
69 | }
70 |
71 | #main #content #data_board #exit {
72 | position: relative;
73 | float: right;
74 | right: 0px;
75 | top: -40px;
76 | font-size: 10px;
77 | cursor: pointer;
78 | display: none;
79 | }
80 |
81 | #main #content #data_board #dataBamboo {
82 | position: relative;
83 | width: 200px;
84 | float: right;
85 | top: 150px;
86 | right: -100px;
87 | opacity: 0.8;
88 | }
89 |
90 | @media only screen and (max-width: 600px) {
91 | #main #content #data_board #dataBamboo {
92 | width: 100px;
93 | }
94 | }
--------------------------------------------------------------------------------
/css/friends.css:
--------------------------------------------------------------------------------
1 | #main #wrap #nav #friends {
2 | color: black;
3 | }
4 |
5 | #main #wrap #nav #li_friends {
6 | border-bottom: solid 2px #919191;
7 | }
8 |
9 | /* 轮播图样式表 */
10 | #content #carousel_wrap {
11 | position: relative;
12 | margin: 0 auto;
13 | width: 100%; /* 轮播图宽度 */
14 | overflow: hidden;
15 | }
16 |
17 | #content #carousel_wrap #carousel_images {
18 | position: absolute;
19 | border: 0;
20 | outline: none;
21 | white-space: nowrap; /* 将图片一行排列 */
22 | width: 100%;
23 | font-size: 0; /* 清除white-space间隙 */
24 | margin: 0px;
25 | }
26 |
27 | #content #carousel_wrap #carousel_images img {
28 | width: 100%;
29 | }
30 |
31 | #content #carousel_wrap .arrow {
32 | position: absolute;
33 | font-weight: bold;
34 | font-size: 50px;
35 | color: lightgray;
36 | top: 50%;
37 | transform: translateY(-50%);
38 | cursor: pointer;
39 | transition-property: opacity;
40 | transition-duration: 0.5s;
41 | }
42 |
43 | #content #carousel_wrap .arrow:hover {
44 | opacity: 0.5;
45 | }
46 |
47 | #content #carousel_wrap .left-arrow {
48 | left: 20px;
49 | }
50 |
51 | #content #carousel_wrap .right-arrow {
52 | right: 20px;
53 | }
54 |
55 | #content #carousel_wrap #dots {
56 | position: absolute;
57 | bottom: 20px;
58 | left: 50%;
59 | transform: translateX(-50%)
60 | }
61 |
62 | #content #carousel_wrap .dot {
63 | background-color: white;
64 | display: inline-block;
65 | width: 10px;
66 | height: 10px;
67 | border-radius: 50%;
68 | margin: 4px;
69 | opacity: 0.2;
70 | cursor: pointer;
71 | }
72 |
73 | #content #carousel_wrap .active {
74 | opacity: 1;
75 | }
76 |
77 | .transition {
78 | transition-property: left;
79 | transition-duration: 1s;
80 | }
81 |
82 |
83 | @media only screen and (max-width: 600px) {
84 | #content #carousel_wrap .arrow {
85 | opacity: 0;
86 | }
87 | }
88 | /* END 轮播图样式表 */
--------------------------------------------------------------------------------
/css/messageBoard.css:
--------------------------------------------------------------------------------
1 | #main #wrap #nav #message_board {
2 | color: black;
3 | }
4 |
5 | #main #wrap #nav #li_messageBoard {
6 | border-bottom: solid 2px #919191;
7 | }
8 |
9 | #main #content #board {
10 | position: relative;
11 | top: 20px;
12 | left: 6%;
13 | width: 80%;
14 | max-width: 80%;
15 | height: 200px;
16 | }
17 |
18 | #main #content #board #board_set {
19 | position: relative;
20 | width: 100%;
21 | height: 100%;
22 | border-top-left-radius: 20px;
23 | border-bottom-right-radius: 20px;
24 | }
25 |
26 | #main #content #board #board_set #msg {
27 | position: relative;
28 | left: 10%;
29 | width: 80%;
30 | max-width: 80%;
31 | height: 80%;
32 | max-height: 80%;
33 | border-radius: 10px;
34 | border-top-left-radius: 0px;
35 | border-bottom-right-radius: 0px;
36 | font-size: 20px;
37 | }
38 |
39 | #main #content #board #board_set #btn {
40 | position: relative;
41 | border-radius: 50%;
42 | left: 9.5%;
43 | font-size: 15px;
44 | }
45 |
46 | /*留言板内容分区*/
47 | #messageboard_zone {
48 | position: relative;
49 | display: block;
50 | top: 80px;
51 | left: 6%;
52 | width: 80%;
53 | border-top-left-radius: 20px;
54 | border-bottom-right-radius: 20px;
55 | }
56 |
57 | .messageboard_block {
58 | position: relative;
59 | border-radius: 5px;
60 | display: block;
61 | margin: 20px;
62 | padding: 12px;
63 | padding-top: 15px;
64 | background: linear-gradient(to left, #8a8a8a, #ebebeb);
65 | border-top-left-radius: 20px;
66 | border-bottom-right-radius: 20px;
67 | }
68 |
69 | .messageboard_block a {
70 | color: black;
71 | font-size: 14px;
72 | }
73 |
74 | .messageboard_block a:hover {
75 | text-decoration: underline;
76 | }
77 |
78 | .messageboard_block .messageboard_top {
79 | position: relative;
80 | display: inline-block;
81 | vertical-align: top;
82 | height: 30px;
83 | }
84 |
85 | .messageboard_block .head_portraits {
86 | position: relative;
87 | display: inline-block;
88 | border-radius: 50%;
89 | width: 30px;
90 | height: 30px;
91 | }
92 |
93 | .messageboard_block .messageboard_name {
94 | position: relative;
95 | display: inline-block;
96 | font-size: 15px;
97 | top: 3px;
98 | }
99 |
100 | .messageboard_block .messageboard_floor {
101 | position: relative;
102 | display: inline-block;
103 | font-size: 10px;
104 | top: 2px;
105 | color: #8a8a8a;
106 | }
107 |
108 | .messageboard_block .messageboard_time {
109 | position: relative;
110 | display: inline-block;
111 | float: right;
112 | right: 0px;
113 | top: 8px;
114 | font-size: 11px;
115 | color: black;
116 | }
117 |
118 | .messageboard_block .messageboard_content {
119 | position: relative;
120 | display: inline-block;
121 | font-size: 20px;
122 | left: 35px;
123 | width: 90%;
124 | }
125 |
126 | .messageboard_block .messageboard_operator {
127 | position: relative;
128 | display: block;
129 | bottom: 0px;
130 | width: 100%;
131 | height: 14px;
132 | font-size: 14px;
133 | }
134 |
135 | .messageboard_block .messageboard_operator .azone {
136 | position: relative;
137 | float: right;
138 | }
--------------------------------------------------------------------------------
/css/mobile.css:
--------------------------------------------------------------------------------
1 | #shadow {
2 | position: absolute;
3 | display: block;
4 | top: 0;
5 | left: 0;
6 | z-index: 1000;
7 | background-color: gray;
8 | opacity: 0.5;
9 | }
10 |
11 | #head_portrait_box {
12 | color: black;
13 | z-index: 10000;
14 | width: 250px;
15 | height: 200px;
16 | left: 50%;
17 | top: 50%;
18 | border: 1px solid black;
19 | background: PapayaWhip;
20 | box-shadow: 6px 8px 4px #808080;
21 | box-sizing: border-box;
22 | display: none;
23 | position: fixed;
24 | }
25 |
26 | #head_portrait_box #upload_img, #select_upload_img {
27 | width: 130px;
28 | height: 32px;
29 | border: 1px solid black;
30 | line-height: 32px;
31 | position: absolute;
32 | top: 10px;
33 | left: 50%;
34 | transform: translateX(-50%);
35 | }
36 |
37 | #head_portrait_box #upload_img {
38 | display: none;
39 | }
40 |
41 | input.upload_img {
42 | caret-color: #999fac;
43 | font: 16px "Helvetica", "Arial", "sans-serif";
44 | }
45 |
46 | #head_portrait_box #select_upload img {
47 | width: 80px;
48 | height: 80px;
49 | border-radius: 50px;
50 | border: 1px solid #c8cccf;
51 | background: white;
52 | color: black;
53 | text-indent: 50px;
54 | position: absolute;
55 | left: 80px;
56 | top: 70px;
57 | }
58 |
59 | #head_portrait_box #submit_ok {
60 | position: absolute;
61 | left: 30%;
62 | transform: translateX(-30%);
63 | bottom: 10px;
64 | }
65 |
66 | #head_portrait_box #button {
67 | position: absolute;
68 | left: 70%;
69 | transform: translateX(-70%);
70 | bottom: 10px;
71 | }
72 |
73 | #mobile_shadow {
74 | position: fixed;
75 | display: none;
76 | top: 0px;
77 | left: 0px;
78 | z-index: 1000;
79 | background-color: black;
80 | opacity: 0.5;
81 | width: 600px;
82 | height: 100%;
83 | }
84 |
85 | #mobile_box {
86 | z-index: 1200;
87 | position: fixed;
88 | display: none;
89 | width: 120px;
90 | height: 300px;
91 | float: right;
92 | top: 0px;
93 | right: 50px;
94 | line-height: 30px;
95 | }
96 |
97 | .mobile_link {
98 | position: relative;
99 | right: 1px;
100 | top: 50px;
101 | display: block;
102 | color: white;
103 | text-align: right;
104 | }
105 |
106 | #mobile_back {
107 | position: fixed;
108 | display: inline-block;
109 | top: 15px;
110 | float: right;
111 | right: 4.5%;
112 | width: 20px;
113 | height: 20px;
114 | animation: backAnimate 1s;
115 | cursor: pointer;
116 | }
117 |
118 | @keyframes backAnimate
119 | {
120 | from { transform: rotateZ(0deg); }
121 | to { transform: rotateZ(90deg); }
122 | }
123 |
124 | #mobile_box a:hover {
125 | color: black;
126 | }
127 |
128 | #mobile_wrap {
129 | position: fixed;
130 | width: 100%;
131 | display: none;
132 | height: 50px;
133 | }
134 |
135 | #mobile_wrap #mobile_head_portrait {
136 | position: fixed;
137 | display: inline-block;
138 | top: 12px;
139 | left: 5%;
140 | width: 30px;
141 | height: 30px;
142 | border-radius: 50px;
143 | }
144 |
145 | #mobile_wrap #mobile_head_portrait #mobile_select_upload {
146 | position: absolute;
147 | width: 32px;
148 | height: 32px;
149 | border-radius: 50px;
150 | display: block;
151 | }
152 |
153 | #mobile_wrap #mobile_head_portrait #mobile_select_upload:hover {
154 | background-color: grey;
155 | opacity: 0.1;
156 | }
157 |
158 | #mobile_wrap #mobile_head_portrait #mobile_upload_img {
159 | position: absolute;
160 | display: block;
161 | width: 30px;
162 | height: 30px;
163 | border-radius: 50px;
164 | opacity: 0;
165 | }
166 |
167 | #mobile_wrap #mobile_head_portrait #mobile_upload_img:hover {
168 | cursor: pointer;
169 | }
170 |
171 | #mobile_wrap a {
172 | position: relative;
173 | font-family: Brush Script MT;
174 | font-size: 30px;
175 | top: 4px;
176 | left: 50%;
177 | display: inline-block;
178 | transform: translateX(-48%);
179 | }
180 |
181 | #mobile_wrap #expand-menu {
182 | position: relative;
183 | top: 15px;
184 | float: right;
185 | right: 5%;
186 | width: 23px;
187 | height: 24px;
188 | cursor: pointer;
189 | }
190 |
191 | @media only screen and (max-width: 800px) {
192 | #home #com a {
193 | font-size: 23px;
194 | }
195 |
196 | #welcomeBack {
197 | display: none;
198 | }
199 | }
200 |
201 | @media only screen and (max-width: 700px) {
202 | #home #com a {
203 | font-size: 20px;
204 | }
205 | }
206 |
207 | @media only screen and (max-width: 600px) {
208 | #mobile_wrap {
209 | z-index: 100;
210 | position: fixed;
211 | top: 0px;
212 | width: 100%;
213 | display: block;
214 | height: 54px;
215 | background-color: #999fac;
216 | }
217 |
218 | #main {
219 | margin: 0px;
220 | bottom: 2px;
221 | width: 100%;
222 | height: 93%;
223 | left: 0%;
224 | }
225 |
226 | #main #wrap {
227 | display: none;
228 | }
229 |
230 | #home {
231 | display: none;
232 | width: 0%;
233 | height: 0%;
234 | }
235 |
236 | #main #content {
237 | width: 100%;
238 | height: 100%;
239 | }
240 |
241 | #quanping {
242 | display: none;
243 | }
244 | }
245 |
246 | @media only screen and (max-height: 490px) {
247 | #main #content {
248 | top: 25px;
249 | }
250 | }
--------------------------------------------------------------------------------
/css/mystyle.css:
--------------------------------------------------------------------------------
1 | * {
2 | font-family: STKaiti, YouYuan, sans-serif;
3 | /*不要设置全部字体颜色,否则其他会出错*/
4 | /*cursor: url(https://images2015.cnblogs.com/blog/961272/201607/961272-20160719145928310-806072030.gif), default!important;*/
5 | }
6 |
7 | a {
8 | text-decoration: none;
9 | color: black;
10 | }
11 |
12 | a:hover {
13 | color: black;
14 | }
15 |
16 | li {
17 | list-style-type: none;
18 | }
19 |
20 | textarea {
21 | resize: none;
22 | }
23 |
24 | /*.tip {*/
25 | /*border: 2px solid #ddd;*/
26 | /*padding: 8px;*/
27 | /*background: #f1f1f1;*/
28 | /*color:#666;*/
29 | /*}*/
30 |
31 | body {
32 | color: #fff;
33 | font-size: 1em;
34 | margin: 0px;
35 | padding: 0px;
36 | width: 100%;
37 | height: 100%;
38 | background: url('') no-repeat center fixed;
39 | background-size: cover;
40 | }
41 |
42 | #home {
43 | position: fixed;
44 | display: block;
45 | width: 20%;
46 | height: 100%;
47 | background: url("../images/homepic.jpeg");
48 | background-size: cover;
49 | float: left;
50 | z-index: 20;
51 | left: 0px;
52 | min-height: 600px;
53 | }
54 |
55 | #home #com {
56 | position: relative;
57 | top: 1%;
58 | text-align: center;
59 | font-size: 28px;
60 | }
61 |
62 | #home #com a {
63 | text-decoration: none;
64 | color: #fff;
65 | font-family: Brush Script MT;
66 | }
67 |
68 | #home #com a:hover {
69 | color: black;
70 | }
71 |
72 | #home #head_portrait {
73 | position: relative;
74 | top: 70px;
75 | left: 50%;
76 | transform: translateX(-50%);
77 | display: block;
78 | width: 80px;
79 | height: 80px;
80 | border-radius: 50px;
81 | }
82 |
83 | #home #head_portrait #select_upload {
84 | position: absolute;
85 | width: 82px;
86 | height: 82px;
87 | border-radius: 50px;
88 | display: block;
89 | }
90 |
91 | #home #head_portrait #select_upload:hover {
92 | background-color: grey;
93 | opacity: 0.1;
94 | cursor: pointer;
95 | }
96 |
97 | #home #head_portrait #upload_img {
98 | position: absolute;
99 | display: inline-block;
100 | width: 80px;
101 | height: 80px;
102 | border-radius: 50px;
103 | background-color: black;
104 | overflow: hidden;
105 | }
106 |
107 | input[type='file'] {
108 | position: absolute;
109 | cursor: pointer;
110 | font-size: 0px;
111 | opacity: 0;
112 | }
113 |
114 | #home #head_portrait #upload_img:hover {
115 | cursor: pointer;
116 | }
117 |
118 | #home #personal_signature {
119 | position: relative;
120 | top: 10%;
121 | text-align: center;
122 | font-size: 20px;
123 | color: black;
124 | width: auto;
125 | height: 20px;
126 | }
127 |
128 | #home #personal_signature p {
129 | font-family: Brush Script MT;
130 | }
131 |
132 | #home #menu {
133 | position: relative;
134 | top: 200px;
135 | text-align: center;
136 | width: 100%;
137 | }
138 |
139 | #home #menu a {
140 | color: #fff;
141 | font-size: 20px;
142 | font-family: STKaiti, YouYuan;
143 | }
144 |
145 | #home #menu a:hover {
146 | color: black;
147 | }
148 |
149 | #home #menu img:hover {
150 | opacity: 1!important;
151 | }
152 |
153 | #main {
154 | position: fixed;
155 | left: 20%;
156 | width: 80%;
157 | height: 100%;
158 | /* 如果mystyle.css中使用overflow:auto->含有滚动条宽度; 故使用overflow:scroll */
159 | overflow-y: scroll;
160 | background: linear-gradient(to right, #fff, #ebebeb);
161 | }
162 |
163 | #main #wrap {
164 | background-color: #fff;
165 | position: relative;
166 | top: 0px;
167 | left: 0px;
168 | height: 52px;
169 | width: 100%;
170 | z-index: 1000;
171 | display: block;
172 | }
173 |
174 | #main #wrap #nav {
175 | position: relative;
176 | width: 375px;
177 | height: 60%;
178 | background-color: #fff;
179 | font-size: 10px;
180 | display: inline-block;
181 | }
182 |
183 | #main #wrap #nav li {
184 | position: relative;
185 | height: 100%;
186 | display: inline-block;
187 | text-align: center;
188 | }
189 |
190 | #main #wrap #nav li:hover {
191 | border-bottom: solid 2px #919191;
192 | }
193 |
194 | #main #wrap #nav li:hover a {
195 | color: black;
196 | }
197 |
198 | #main #wrap #nav a {
199 | color: #919191;
200 | font-size: 18px;
201 | font-family: STKaiti, YouYuan;
202 | line-height: 30px;
203 | }
204 |
205 | #main #wrap #nav a:hover {
206 | color: #000000;
207 | }
208 |
209 | #main #wrap #welcomeBack {
210 | position: relative;
211 | display: inline-block;
212 | top: 20px;
213 | float: right;
214 | width: 150px;
215 | height: 50%;
216 | color: #8a8a8a;
217 | background-color: #fff;
218 | font-size: 12px;
219 | z-index: 1000;
220 | }
221 |
222 | #main #content {
223 | position: relative;
224 | color: black;
225 | top: 0px;
226 | height: 92%;
227 | width: 100%;
228 | float: right;
229 | right: 0px;
230 | background: linear-gradient(to right, #fff, #ebebeb);
231 | }
232 |
233 |
234 | #footer {
235 | position: absolute;
236 | text-align: center;
237 | bottom: 10px;
238 | width: 100%;
239 | height: 20px;
240 | }
241 |
242 | #footer span {
243 | text-align: center;
244 | color: #fff;
245 | font-size: 12px;
246 | }
247 |
248 | /*编辑内容部分*/
249 |
250 |
251 | #main #content #board {
252 | position: relative;
253 | top: 20px;
254 | left: 6%;
255 | width: 70%;
256 | max-width: 70%;
257 | height: 200px;
258 | }
259 |
260 | #main #content #board #board_set {
261 | position: relative;
262 | width: 100%;
263 | max-width: 100%;
264 | height: 110%;
265 | border-top-left-radius: 20px;
266 | border-bottom-right-radius: 20px;
267 | }
268 |
269 | #main #content #board #board_set #msg {
270 | position: relative;
271 | border: 1px solid black;
272 | outline: none;
273 | padding-top: 2px;
274 | padding-left: 2px;
275 | padding-right: 2px;
276 | left: 10%;
277 | width: 80%;
278 | max-width: 300px;
279 | min-width: 80%;
280 | height: 80%;
281 | border-radius: 10px;
282 | border-top-left-radius: 0px;
283 | border-bottom-right-radius: 0px;
284 | font-size: 20px;
285 | overflow-y: auto;
286 | color: black;
287 | }
288 |
289 | #main #content #board #board_set #msg a {
290 | text-decoration: underline;
291 | color: blue;
292 | }
293 |
294 | @media only screen and (max-width: 600px) {
295 | #main #content #board {
296 | width: 400px;
297 | left: 12%;
298 | }
299 |
300 | #main #content #board #board_set #msg {
301 | max-width: 300px;
302 | }
303 | }
304 |
305 | #main #content #board #board_set #bianji {
306 | position: relative;
307 | width: 81%;
308 | max-width: 81%;
309 | height: 30px;
310 | left: 10%;
311 | bottom: 5px;
312 | }
313 |
314 | #main #content #board #board_set #bianji img {
315 | opacity: 0.5;
316 | }
317 |
318 | #main #content #board #board_set #bianji #btn {
319 | position: relative;
320 | border-radius: 50%;
321 | font-size: 15px;
322 | display: inline-block;
323 | top: 0px;
324 | float: right;
325 | }
326 |
327 | #main #content #board #board_set #bianji #jinghao {
328 | position: relative;
329 | width: 17px;
330 | height: 17px;
331 | cursor: pointer;
332 | top: -1.1px;
333 | }
334 |
335 | #main #content #board #board_set #bianji #xiaolian, #gaojibianji, #quanping, #huanyuan, #picture {
336 | position: relative;
337 | width: 20px;
338 | height: 20px;
339 | cursor: pointer;
340 | }
341 |
342 | #main #content #board #board_set #huanyuan {
343 | display: none;
344 | }
345 |
346 | #main #content #board #edit {
347 | position: relative;
348 | border: 1px solid #8a8a8a;
349 | border-radius: 5px;
350 | display: inline-block;
351 | width: 143px;
352 | display: none;
353 | height: 22px;
354 | }
355 |
356 | #main #content #board #edit #etitle, #exieti, #ebold, #eunderline, #elink {
357 | position: relative;
358 | width: 20px;
359 | height: 20px;
360 | cursor: pointer;
361 | }
362 |
363 | #main #content #board #emojis {
364 | position: relative;
365 | display: block;
366 | width: 180px;
367 | height: 85px;
368 | border: 1px solid #8a8a8a;
369 | border-radius: 5px;
370 | background-color: #fff;
371 | display: none;
372 | }
373 |
374 | #main #content #board #emojis .emoji {
375 | position: relative;
376 | left: 2.5px;
377 | top: 2px;
378 | width: 25px;
379 | height: 25px;
380 | cursor: pointer;
381 | }
382 |
383 | #main #content #board #emojis .emoji:hover {
384 | width: 26px;
385 | height: 26px;
386 | }
387 |
388 | #etitle {
389 | left: 3px;
390 | }
391 |
392 | #exieti {
393 | left: -5px;
394 | }
395 |
396 | #eunderline {
397 | left: -8px;
398 | }
399 |
400 | #elink {
401 | left: -2px;
402 | }
403 |
404 | #main #content #board #edit #ecolor {
405 | position: relative;
406 | display: inline-block;
407 | background-color: black;
408 | width: 18px;
409 | height: 18px;
410 | top: -6px;
411 | cursor: pointer;
412 | left: -5px;
413 | border-top-left-radius: 5px;
414 | border-bottom-right-radius: 5px;
415 | }
416 |
417 | #main #content #board #submit {
418 | position: relative;
419 | width: 20px;
420 | height: 20px;
421 | cursor: pointer;
422 | float: right;
423 | display: inline-block;
424 | }
425 |
426 | #main #content #board #colorBar {
427 | position: relative;
428 | display: block;
429 | width: 200px;
430 | height: 22px;
431 | border: 1px solid #8a8a8a;
432 | left: 10.5%;
433 | border-radius: 5px;
434 | background-color: #fff;
435 | display: none;
436 | }
437 |
438 | .colors {
439 | position: relative;
440 | display: inline-block;
441 | width: 18px;
442 | height: 18px;
443 | background-color: black;
444 | top: 0.5px;
445 | left: 14px;
446 | cursor: pointer;
447 | border-top-left-radius: 5px;
448 | border-bottom-right-radius: 5px;
449 | }
450 |
451 | #red_block {
452 | background-color: red;
453 | }
454 |
455 | #orange_block {
456 | background-color: orange;
457 | }
458 |
459 | #yellow_block {
460 | background-color: yellow;
461 | }
462 |
463 | #green_block {
464 | background-color: green;
465 | }
466 |
467 | #blue_block {
468 | background-color: blue;
469 | }
470 |
471 | #purple_block {
472 | background-color: purple;
473 | }
474 |
475 | #black_block {
476 | background-color: black;
477 | }
478 |
479 | #brown_block {
480 | background-color: brown;
481 | }
482 |
483 |
484 |
485 |
486 |
487 |
488 |
489 |
490 |
491 |
492 |
493 |
494 |
495 |
496 |
497 |
498 |
499 |
500 |
501 |
502 |
--------------------------------------------------------------------------------
/css/recommend.css:
--------------------------------------------------------------------------------
1 | #main {
2 | background-color: red!important;
3 | }
4 |
5 | #main #wrap #nav #recommend {
6 | color: black;
7 | }
8 |
9 | #main #wrap #nav #li_recommend {
10 | border-bottom: solid 2px #919191;
11 | }
12 |
13 | /* 轮播图样式表 */
14 | #content #carousel_wrap {
15 | position: relative;
16 | margin: 0 auto;
17 | width: 100%; /* 轮播图宽度 */
18 | overflow: hidden;
19 | }
20 |
21 | #content #carousel_wrap #carousel_images {
22 | position: absolute;
23 | border: 0;
24 | outline: none;
25 | white-space: nowrap; /* 将图片一行排列 */
26 | width: 100%;
27 | font-size: 0; /* 清除white-space间隙 */
28 | margin: 0px;
29 | }
30 |
31 | #content #carousel_wrap #carousel_images img {
32 | width: 100%;http://localhost:8080/Web-project7/images/carousel/3.jpg
33 | }
34 |
35 | #content #carousel_wrap .arrow {
36 | position: absolute;
37 | font-weight: bold;
38 | font-size: 50px;
39 | color: lightgray;
40 | top: 50%;
41 | transform: translateY(-50%);
42 | cursor: pointer;
43 | transition-property: opacity;
44 | transition-duration: 0.5s;
45 | }
46 |
47 | #content #carousel_wrap .arrow:hover {
48 | opacity: 0.5;
49 | }
50 |
51 | #content #carousel_wrap .left-arrow {
52 | left: 20px;
53 | }
54 |
55 | #content #carousel_wrap .right-arrow {
56 | right: 20px;
57 | }
58 |
59 | #content #carousel_wrap #dots {
60 | position: absolute;
61 | bottom: 20px;
62 | left: 50%;
63 | transform: translateX(-50%)
64 | }
65 |
66 | #content #carousel_wrap .dot {
67 | background-color: white;
68 | display: inline-block;
69 | width: 10px;
70 | height: 10px;
71 | border-radius: 50%;
72 | margin: 4px;
73 | opacity: 0.2;
74 | cursor: pointer;
75 | }
76 |
77 | #content #carousel_wrap .active {
78 | opacity: 1;
79 | }
80 |
81 | .transition {
82 | transition-property: left;
83 | transition-duration: 1s;
84 | }
85 |
86 | #inner_content {
87 | width: 1245px;
88 | margin: 20px auto;
89 | }
90 |
91 | #inner_content:after {
92 | content: '';
93 | clear: both;
94 | display: block;
95 | }
96 |
97 | #inner_content .inner_user:after {
98 | content: '';
99 | clear: both;
100 | display: block;
101 | }
102 |
103 | #inner_content .inner_item {
104 | cursor: pointer;
105 | /* 实现动画放大效果 */
106 | transition-property: all;
107 | transition-delay: 0.1s;
108 | transition-duration: 0.4s;
109 | }
110 |
111 | #inner_content .inner_item:hover {
112 | /* 实现动画放大效果 */
113 | transform: scale(1.013);
114 | }
115 |
116 | #inner_content .inner_item {
117 | width: 600px;
118 | height: 400px;
119 | box-shadow: 0px 7px 10px lightgray;
120 | margin: 10px;
121 | display: inline-block;
122 | }
123 |
124 | #inner_content .inner_img {
125 | height: 250px;
126 | background-position: center center;
127 | background-size: 110%;
128 | }
129 |
130 | #inner_content .inner_user {
131 | /* border: 1px solid green; */
132 | height: 50px;
133 | }
134 |
135 | #inner_content .inner_user .inner_avatar {
136 | float: left;
137 | }
138 |
139 | #inner_content .inner_avatar {
140 | width: 40px;
141 | height: 40px;
142 | margin: 5px 5px 5px 15px;
143 | border-radius: 50%;
144 | border: 1px solid lightgray;
145 | background-position: 50% 50%;
146 | background-size: 100%;
147 | }
148 |
149 | #inner_content .inner_username {
150 | font-size: 11px;
151 | font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
152 | float: left;
153 | width: 100px;
154 | height: 20px;
155 | margin: 10px;
156 | }
157 |
158 | #inner_content .inner_intro {
159 | margin: 10px 15px;
160 | font-size: 25px;
161 | font-family: 微软雅黑;
162 | font-weight: bold;
163 | }
164 |
165 | @media only screen and (max-width: 600px) {
166 | #content #carousel_wrap .arrow {
167 | opacity: 0;
168 | }
169 |
170 | #inner_content {
171 | width: 100%;
172 | }
173 |
174 | #inner_content .inner_item {
175 | width: 95%;
176 | height: 400px;
177 | box-shadow: 0px 7px 10px lightgray;
178 | margin: 10px;
179 | }
180 |
181 | #inner_content .inner_img {
182 | height: 250px;
183 | background-position: center center;
184 | background-size: 110%;
185 | }
186 |
187 | #inner_content .inner_user {
188 | /* border: 1px solid green; */
189 | height: 50px;
190 | }
191 |
192 | #inner_content .inner_user .inner_avatar {
193 | float: left;
194 | }
195 |
196 | #inner_content .inner_avatar {
197 | width: 40px;
198 | height: 40px;
199 | margin: 5px 5px 5px 15px;
200 | border-radius: 50%;
201 | border: 1px solid lightgray;
202 | background-position: 60% 20%;
203 | background-size: 170%;
204 | }
205 |
206 | #inner_content .inner_username {
207 | font-size: 11px;
208 | font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
209 | float: left;
210 | width: 100px;
211 | height: 20px;
212 | margin: 10px;
213 | }
214 |
215 | #inner_content .inner_intro {
216 | margin: 10px 15px;
217 | font-size: 25px;
218 | font-family: 微软雅黑;
219 | font-weight: bold;
220 | }
221 | }
222 | /* END 轮播图样式表 */
--------------------------------------------------------------------------------
/css/search.css:
--------------------------------------------------------------------------------
1 | #container {
2 | margin-left: 30px;
3 | }
4 |
5 | #container form #search_inner {
6 | margin-top: 20px;
7 | }
8 |
9 | .user_searched {
10 | margin-top: 20px;
11 | }
12 |
13 | #search_borad {
14 | border: 1px solid lightgray;
15 | border-radius: 15px;
16 | position: relative;
17 | width: 140px;
18 | margin-top: 20px;
19 | line-height: 30px;
20 | transition-property: border;
21 | transition-duration: 0.5s;
22 | display: inline-block;
23 | }
24 |
25 | #search_borad input {
26 | font-size: 15px;
27 | margin-left: 10px;
28 | border: none;
29 | width: 100px;
30 | }
31 |
32 | #search_borad a img {
33 | width: 30px;
34 | position: absolute;
35 | opacity: 0.5;
36 | right: 0;
37 | }
38 |
39 | #search_borad:hover {
40 | border: 1px solid black;
41 | }
42 |
43 | #search_borad a:hover img {
44 | opacity: 1;
45 | }
46 |
47 | .search_active {
48 | border: 1px solid black!important;
49 | }
50 |
51 |
52 | .user_avatar {
53 | /* float: left; */
54 | margin-right: 20px;
55 | line-height: 100px;
56 | position: relative;
57 | top: 20px;
58 | display: inline-block;
59 | }
60 |
61 | .user_content {
62 | /* margin-left: 30px; */
63 | line-height: 100px;
64 | width: 80%;
65 | display: inline-block;
66 | }
67 |
68 | .user_content .user_name {
69 | font-size: 18px;
70 | font-weight: bold;
71 | font-family: 微软雅黑;
72 | }
73 |
74 | .user_content .user_hobby {
75 | margin-left: 10px;
76 | }
77 |
78 | .user_content .user_follow {
79 | position: absolute;
80 | right: 30px;
81 | }
82 |
83 | .user_content .user_follow button {
84 | /* TODO 关注按钮样式*/
85 | }
86 |
87 | .user_item:first-child {
88 | border-top: 1px solid lightgray;
89 | }
90 |
91 | .user_item {
92 | /* float: left; */
93 | display: block;
94 | border-bottom: 1px solid lightgray;
95 | /* border-color: black; */
96 | }
97 |
98 | .user_item:after {
99 | content: '';
100 | clear: both;
101 | display: block;
102 | }
103 |
104 | .follow_button {
105 | outline: none;
106 | cursor: pointer;
107 | border: 1px solid lightgray;
108 | width: 75px;
109 | line-height: 30px;
110 | border-radius: 5px;
111 | }
112 |
113 | .followed {
114 | background-color: rgb(229, 233, 239);
115 | }
116 |
117 | .follow_button:hover {
118 | border-color: black;
119 | }
120 |
121 | .follow_button:hover a {
122 | color: black;
123 | }
124 |
125 | .follow_button a {
126 | color: gray;
127 | font-family: 微软雅黑;
128 | }
129 |
130 | @media only screen and (max-width: 700px) {
131 | .user_content .user_hobby {
132 | display: none;
133 | }
134 | }
135 |
--------------------------------------------------------------------------------
/css/setting.css:
--------------------------------------------------------------------------------
1 | #main #content #settingBoard {
2 | position: relative;
3 | top: 20px;
4 | width: 760px;
5 | height: 260px;
6 | margin: 0px auto;
7 | background: linear-gradient(to right, #ebebeb, #8a8a8a);
8 | padding: 40px;
9 | border-top-left-radius: 40px;
10 | border-bottom-right-radius: 40px;
11 | }
12 |
13 | #main #content #settingBoard legend {
14 | font-size: 20px;
15 | text-shadow: 2px 2px 2px #8a8a8a;
16 | }
17 |
18 |
19 | #main #content #settingBoard .settingRow {
20 | position: relative;
21 | left: 20px;
22 | width: 300px;
23 | height: 25px;
24 | border-bottom: 1px black solid;
25 | top: -20px;
26 | }
27 |
28 | #main #content #settingBoard #banAccess {
29 | top: 0px;
30 | }
31 |
32 | #main #content #settingBoard #uploadHead {
33 | top: 20px;
34 | }
35 |
36 | #main #content #settingBoard #updatePassword {
37 | top: 40px;
38 | }
39 |
40 | #main #content #settingBoard #updateData {
41 | top: 60px;
42 | }
43 |
44 | #main #content #settingBoard #exitLogin {
45 | top: 80px;
46 | }
47 |
48 | #main #content #settingBoard .fonts:hover {
49 | color: #8a8a8a;
50 | cursor: pointer;
51 | }
52 |
53 | .slideButton {
54 | position: relative;
55 | float: right;
56 | top: 2px;
57 | width: 30px;
58 | height: 16px;
59 | background-color: #fff;
60 | border-radius: 20px;
61 | cursor: pointer;
62 | border: 1px #8a8a8a solid;
63 | outline: none;
64 | }
65 |
66 | .slideButton .smallButton {
67 | position: relative;
68 | border-radius: 20px;
69 | border: 1px #8a8a8a solid;
70 | background-color: #8a8a8a;
71 | width: 16px;
72 | height: 16px;
73 | top: -1px;
74 | left: -1px;
75 | }
76 |
77 | .slideButton .colorSlide {
78 | position: absolute;
79 | height: 100%;
80 | width: 0px;
81 | background-color: #8a8a8a;
82 | border-radius: 20px;
83 | background-color: #336699;
84 | }
85 |
86 | #horse {
87 | position: absolute;
88 | right: 30px;
89 | top: 20px;
90 | opacity: 0.5;
91 | }
92 |
93 | @media only screen and (max-width: 600px) {
94 | #horse {
95 | left: 40px;
96 | opacity: 0.2;
97 | }
98 |
99 | #hideHome {
100 | display: none;
101 | }
102 | }
103 |
104 | .password {
105 | position: relative;
106 | display: block;
107 | height: 20px;
108 | font-size: 15px;
109 | border-radius: 5px;
110 | width: 200px;
111 | display: none;
112 | top: 15px;
113 | left: 20px;
114 | outline: none;
115 | }
116 |
117 | #password2 {
118 | top: 20px;
119 | }
120 |
121 | #password3 {
122 | top: 25px;
123 | }
124 |
125 | .buttons {
126 | position: absolute;
127 | top: 203px;
128 | left: 170px;
129 | cursor: pointer;
130 | outline: none;
131 | border-radius: 5px;
132 | width: 45px;
133 | height: 20px;
134 | display: none;
135 | }
136 |
137 | #button2 {
138 | left: 225px;
139 | }
140 |
141 | .alert {
142 | font-size: 15px;
143 | color: red;
144 | }
145 |
146 | .alert {
147 | position: relative;
148 | top: -5px;
149 | left: 240px;
150 | }
151 |
152 |
153 |
--------------------------------------------------------------------------------
/css/visitHome.css:
--------------------------------------------------------------------------------
1 | #main #wrap #nav #index {
2 | color: black;
3 | }
4 |
5 | #main #wrap #nav #li_index {
6 | border-bottom: solid 2px #919191;
7 | }
8 |
9 | #main #content #information {
10 | position: absolute;
11 | width: 14%;
12 | height: 215px;
13 | right: 20px;
14 | top: 25px;
15 | display: block;
16 | border-top-left-radius: 20px;
17 | border-bottom-right-radius: 20px;
18 | background: linear-gradient(to right, #ebebeb, #8a8a8a);
19 | }
20 |
21 | #main #content #information legend {
22 | text-shadow: 2px 2px 3px black;
23 | }
24 |
25 | #main #content #information #fan {
26 | position: relative;
27 | height: 20px;
28 | width: 80px;
29 | top: 20px;
30 | margin: 0px auto;
31 | }
32 |
33 | #main #content #information #guanzhu {
34 | position: relative;
35 | height: 20px;
36 | width: 80px;
37 | top: 40px;
38 | margin: 0px auto;
39 | }
40 |
41 | #main #content #information #blog_num {
42 | position: relative;
43 | height: 20px;
44 | width: 80px;
45 | top: 60px;
46 | margin: 0px auto;
47 | }
48 |
49 | #main #content #information #like {
50 | position: relative;
51 | height: 20px;
52 | width: 80px;
53 | top: 80px;
54 | margin: 0px auto;
55 | }
56 |
57 | @media only screen and (max-width: 740px) {
58 | #main #wrap #welcomeBack {
59 | display: none;
60 | }
61 |
62 | #main #content #board {
63 | top: 170px;
64 | height: 120px;
65 | }
66 |
67 | #main #content #board #board_set #msg {
68 | top: 5px;
69 | height: 70%;
70 | }
71 |
72 | #main #content #information {
73 | width: 70%;
74 | height: 100px;
75 | top: 30px;
76 | left: 0px;
77 | margin: 0px auto;
78 | }
79 |
80 | #main #content #information #fan {
81 | top: 15px;
82 | margin: 0px;
83 | left: 60px;
84 | }
85 |
86 | #main #content #information #guanzhu {
87 | top: -5px;
88 | margin: 0px;
89 | left: 200px;
90 | }
91 |
92 | #main #content #information #blog_num {
93 | top: 15px;
94 | margin: 0px;
95 | left: 60px;
96 | }
97 |
98 | #main #content #information #like {
99 | top: -5px;
100 | margin: 0px;
101 | left: 200px;
102 | }
103 | }
104 |
105 | @media only screen and (max-width: 1100px) {
106 | #main #content #information {
107 | right: 0px;
108 | }
109 | }
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/delete.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" import="java.util.*,java.sql.*" contentType="text/html; charset=utf-8"
2 | pageEncoding="utf-8"%>
3 | <% request.setCharacterEncoding("utf-8");
4 | String userId = request.getParameter("userId");
5 | String msg = "";
6 | String connectString = "jdbc:mysql://172.18.187.10:3306/blog_15336202" + "?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
7 | String user = "user";
8 | String pwd = "123";
9 | Class.forName("com.mysql.jdbc.Driver");
10 | Connection con = DriverManager.getConnection(connectString, user, pwd);
11 | Statement stmt = con.createStatement();
12 |
13 | String webUser = ""; //登录用户
14 | Cookie cookies[] = request.getCookies(); //读出用户硬盘上的Cookie,并将所有的Cookie放到一个cookie对象数组里面
15 | if (cookies != null) {
16 | for (int i = 0; i < cookies.length; i ++) { //用一个循环语句遍历刚才建立的Cookie对象数组
17 | if(cookies[i].getName().equals("user")){//如果cookie对象的名称是mrCookie
18 | webUser = cookies[i].getValue(); //获取用户名
19 | }
20 | }
21 | }
22 |
23 | if (request.getMethod().equalsIgnoreCase("post")) {
24 | String date = request.getParameter("deleteButton");
25 | try {
26 | int cnt = stmt.executeUpdate("delete from blog where date='"+date+"'");
27 | if (cnt > 0) {
28 | msg = "删除该blog成功!";
29 | response.sendRedirect("index.jsp?userId=" + userId);
30 | }
31 | }
32 | catch (Exception e) {
33 | msg = e.getMessage();
34 | }
35 | }
36 | stmt.close(); con.close();
37 | %>
--------------------------------------------------------------------------------
/deleteMessageBoard.jsp:
--------------------------------------------------------------------------------
1 | <%@ page language="java" import="java.util.*,java.sql.*" contentType="text/html; charset=utf-8"
2 | pageEncoding="utf-8"%>
3 | <% request.setCharacterEncoding("utf-8");
4 | String userId = request.getParameter("userId");
5 | String msg = "";
6 | String connectString = "jdbc:mysql://172.18.187.10:3306/blog_15336202" + "?autoReconnect=true&useUnicode=true&characterEncoding=UTF-8";
7 | String user = "user";
8 | String pwd = "123";
9 | Class.forName("com.mysql.jdbc.Driver");
10 | Connection con = DriverManager.getConnection(connectString, user, pwd);
11 | Statement stmt = con.createStatement();
12 |
13 | String webUser = ""; //登录用户
14 | Cookie cookies[] = request.getCookies(); //读出用户硬盘上的Cookie,并将所有的Cookie放到一个cookie对象数组里面
15 | if (cookies != null) {
16 | for (int i = 0; i < cookies.length; i ++) { //用一个循环语句遍历刚才建立的Cookie对象数组
17 | if(cookies[i].getName().equals("user")){//如果cookie对象的名称是mrCookie
18 | webUser = cookies[i].getValue(); //获取用户名
19 | }
20 | }
21 | }
22 |
23 | String visitName = ""; //要访问用户
24 | visitName = request.getParameter("visitName");
25 |
26 | if (request.getMethod().equalsIgnoreCase("post")) {
27 | String date = request.getParameter("deleteBoard");
28 | try {
29 | int cnt = stmt.executeUpdate("delete from messageBoard where date='"+date+"'");
30 | if (cnt > 0) {
31 | msg = "删除该block成功!";
32 | }
33 | response.sendRedirect("visitMessageBoard.jsp?visitName=" + visitName);
34 | }
35 | catch (Exception e) {
36 | msg = e.getMessage();
37 | }
38 | }
39 | stmt.close(); con.close();
40 | %>
41 |
42 |
43 |
44 |
45 |
139 |
140 |
141 | - 个人主页
142 | - 留言板
143 | - 个人资料
144 | - 推荐
145 | <%if(showHome.equals("false")) {%>
146 | - 设置
147 | - 关于
148 | <%}%>
149 |
150 |
151 | 欢迎回来! <%=webUser%>
152 |
153 |
154 |
155 |
187 |
188 |
189 |
190 |
211 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # 项目意义
2 | Web组队大作业:完成一个个人博客网站,后端使用JSP,MySQL数据库,不使用任何前端框架。
3 |
4 | 这个博客平台建立的目的就是方便用户记录生活的点点滴滴,可以是成长的历程,学习的收获,甚至也可以是一点点生活上的吐槽。
5 |
6 | # 使用技术
7 | - 前端:HTML/CSS/JavaScript
8 | - 后端:JSP
9 | - 数据库:MySQL
10 | - 其他:AJAX、cookie
11 |
12 | # 项目功能
13 | 1. 用户需要注册和登录
14 | 2. 用户可以发表和删除博客(含自主编写的富文本编辑,可发表情、图片和设置文字样式等)
15 | 3. 用户可以搜索到其他用户并且可以访问到别的用户的主页面、留言板和资料
16 | 4. 用户可以关注其他的用户,可以显示自己的粉丝和对他人的关注情况
17 | 5. 用户可以评论别人的博客(可以实现多重回复)
18 | 6. 用户可以上传个人资料并且可以编辑修改
19 | 7. 用户之间可以通过留言板相互留言(用户只可以在删除自己的留言)
20 | 8. 用户可以上传自己的头像和个人签名(图片文件上传)
21 | 9. 有推荐页面便于全部用户浏览(有轮播图,推行点赞数较多的博客)
22 | 10. 含有设置(包含隐藏边栏、设置禁止访问页面、修改密码、退出登录等)
23 | 11. 含about,介绍该网站,贴近网站标准。
24 | 12. 该网站实现响应式Web设计(可以在移动端和电脑端方便地使用)
25 |
26 | # 负责板块
27 | 1. 用户注册和登录,JSP+MySQL+AJAX ");
46 | while(rs.next()) {
47 | sql = "select * from followers where fans_id='" + userId + "' and followed_id='" + rs.getString("id") + "'";
48 | ResultSet rs_follow=stmt_follow.executeQuery(sql);
49 | String cssStr = "";
50 | //不同用户拥有不同的且唯一标识的id
51 | if(rs_follow.next()) {
52 | ifFollow = "已关注";
53 | cssStr = "
";
54 | }
55 | else {
56 | ifFollow = "关注";
57 | cssStr = "
";
58 | }
59 | rs_follow.close();
60 | table.append(String.format(
61 | "
" +
62 | "
 + ")
" +
63 | "
" +
64 | "
",
65 | rs.getString("name"), rs.getString("hobby"),
66 | cssStr
67 | )
68 | );
69 | }
70 | table.append("
");
71 | }
72 | //========================END根据ID/email/phone查找用户========================
73 |
74 |
75 | stmt_follow.close();
76 | con_follow.close();
77 |
78 | rs.close();
79 | stmt.close();
80 | con.close();
81 | }
82 | catch (Exception e){
83 | //msg = e.getMessage();
84 | }
85 | %>
86 |
87 |
88 |
89 |
90 |
91 |
92 |