Skip to content

Commit 2e2a813

Browse files
committed
完成了首页
1 parent 7b23d86 commit 2e2a813

File tree

16 files changed

+146734
-114582
lines changed

16 files changed

+146734
-114582
lines changed

app/Http/Controllers/HomeController.php

+6-11
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,21 @@
33
namespace App\Http\Controllers;
44

55
use Illuminate\Http\Request;
6+
use App\Article;
67

78
class HomeController extends Controller
89
{
9-
/**
10-
* Show the home.
11-
*
12-
* @return \Illuminate\Http\Response
13-
*/
14-
public function index()
15-
{
16-
return view('welcome');
17-
}
18-
1910
/**
2011
* Show the home.
2112
*
2213
* @return \Illuminate\Http\Response
2314
*/
2415
public function home()
2516
{
26-
return view('home');
17+
$articles = Article::orderBy('created_at', 'desc')->limit(5)->get();
18+
for ($i=0; $i < sizeof($articles); $i++) {
19+
$articles[$i]->content = strip_tags(str_limit($articles[$i]->content, 100));
20+
}
21+
return view('home', compact('articles'));
2722
}
2823
}

public/css/app.css

+194-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);@charset "UTF-8";
1+
@charset "UTF-8";
22

33
/*!
44
* Bootstrap v3.3.7 (http://getbootstrap.com)
@@ -1402,7 +1402,7 @@ html {
14021402
}
14031403

14041404
body {
1405-
font-family: "Raleway", sans-serif;
1405+
font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
14061406
font-size: 14px;
14071407
line-height: 1.6;
14081408
color: #636b6f;
@@ -7499,7 +7499,7 @@ button.close {
74997499
position: absolute;
75007500
z-index: 1070;
75017501
display: block;
7502-
font-family: "Raleway", sans-serif;
7502+
font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
75037503
font-style: normal;
75047504
font-weight: normal;
75057505
letter-spacing: normal;
@@ -7633,7 +7633,7 @@ button.close {
76337633
display: none;
76347634
max-width: 276px;
76357635
padding: 1px;
7636-
font-family: "Raleway", sans-serif;
7636+
font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
76377637
font-style: normal;
76387638
font-weight: normal;
76397639
letter-spacing: normal;
@@ -8350,3 +8350,193 @@ button.close {
83508350
}
83518351
}
83528352

8353+
.z-slide .z-inner {
8354+
border-radius: 2px;
8355+
-webkit-box-shadow: 0 1px 5px #dcdcdc;
8356+
box-shadow: 0 1px 5px #dcdcdc;
8357+
background-color: white;
8358+
}
8359+
8360+
.z-slide .z-inner .z-content {
8361+
padding: 40px;
8362+
}
8363+
8364+
.z-slide .z-inner .z-content .z-title {
8365+
color: black;
8366+
font-size: 30px;
8367+
margin-bottom: 15px;
8368+
}
8369+
8370+
.z-slide .z-inner .z-content .z-intro {
8371+
color: gray;
8372+
margin-bottom: 20px;
8373+
}
8374+
8375+
.z-slide .z-inner .z-content .z-button {
8376+
padding: 5px 10px 5px 10px;
8377+
color: gray;
8378+
font-size: 12px;
8379+
border: 1px solid #c2c2bc;
8380+
border-radius: 15px;
8381+
text-decoration: none;
8382+
}
8383+
8384+
.z-slide .z-inner .z-content .z-button:hover {
8385+
border: 1px solid gray;
8386+
}
8387+
8388+
.z-slide .z-slide-button .z-location,
8389+
.z-slide .z-slide-button .z-location-left,
8390+
.z-slide .z-slide-button .z-location-right {
8391+
position: absolute;
8392+
display: -webkit-box;
8393+
display: -ms-flexbox;
8394+
display: flex;
8395+
-webkit-box-align: center;
8396+
-ms-flex-align: center;
8397+
align-items: center;
8398+
text-decoration: none;
8399+
}
8400+
8401+
.z-slide .z-slide-button .z-location .z-button,
8402+
.z-slide .z-slide-button .z-location-left .z-button,
8403+
.z-slide .z-slide-button .z-location-right .z-button {
8404+
padding: 20px 10px 20px 10px;
8405+
font-size: 30px;
8406+
color: grey;
8407+
border-radius: 0 2px 2px 0;
8408+
background-color: #2B2B2B;
8409+
filter: alpha(opacity=50);
8410+
-moz-opacity: 0.5;
8411+
-khtml-opacity: 0.5;
8412+
opacity: 0.5;
8413+
}
8414+
8415+
.z-slide .z-slide-button .z-location .z-button:hover,
8416+
.z-slide .z-slide-button .z-location-left .z-button:hover,
8417+
.z-slide .z-slide-button .z-location-right .z-button:hover {
8418+
filter: alpha(opacity=80);
8419+
-moz-opacity: 0.8;
8420+
-khtml-opacity: 0.8;
8421+
opacity: 0.8;
8422+
}
8423+
8424+
.z-slide .z-slide-button .z-location-left {
8425+
top: 0;
8426+
left: 0;
8427+
bottom: 0;
8428+
}
8429+
8430+
.z-slide .z-slide-button .z-location-right {
8431+
top: 0;
8432+
right: 0;
8433+
bottom: 0;
8434+
}
8435+
8436+
.z-article-vertical {
8437+
margin-bottom: 20px;
8438+
border-radius: 2px;
8439+
overflow: hidden;
8440+
-webkit-box-shadow: 0 1px 5px #dcdcdc;
8441+
box-shadow: 0 1px 5px #dcdcdc;
8442+
background-color: white;
8443+
}
8444+
8445+
.z-article-vertical .z-content {
8446+
padding: 40px;
8447+
}
8448+
8449+
.z-article-vertical .z-content .z-title {
8450+
color: black;
8451+
font-size: 30px;
8452+
margin-bottom: 15px;
8453+
}
8454+
8455+
.z-article-vertical .z-content .z-intro {
8456+
color: gray;
8457+
margin-bottom: 20px;
8458+
}
8459+
8460+
.z-article-vertical .z-content .z-button {
8461+
padding: 5px 10px 5px 10px;
8462+
color: gray;
8463+
font-size: 12px;
8464+
border: 1px solid #c2c2bc;
8465+
border-radius: 15px;
8466+
text-decoration: none;
8467+
}
8468+
8469+
.z-article-vertical .z-content .z-button:hover {
8470+
border: 1px solid gray;
8471+
}
8472+
8473+
.z-editor .z-editor-header {
8474+
background-color: #f5f5f5;
8475+
border-color: #d1d1d1;
8476+
border-style: solid;
8477+
border-width: 1px 1px 0 1px;
8478+
padding-left: 10px;
8479+
}
8480+
8481+
.z-editor .z-editor-header .z-editor-icon {
8482+
padding: 5px 10px 5px 10px;
8483+
}
8484+
8485+
.z-editor .z-editor-header .z-editor-icon:hover {
8486+
color: black;
8487+
cursor: pointer;
8488+
}
8489+
8490+
.z-editor .z-editor-input {
8491+
width: 100%;
8492+
resize: none;
8493+
border-radius: 0;
8494+
border-style: solid;
8495+
}
8496+
8497+
.z-footer {
8498+
background-color: #525252;
8499+
text-align: center;
8500+
padding: 60px 0;
8501+
}
8502+
8503+
.z-footer .z-text {
8504+
color: white;
8505+
font-size: 10px;
8506+
}
8507+
8508+
.z-footer .z-text-big {
8509+
color: white;
8510+
font-size: 20px;
8511+
}
8512+
8513+
.z-center {
8514+
display: -webkit-box;
8515+
display: -ms-flexbox;
8516+
display: flex;
8517+
-webkit-box-pack: center;
8518+
-ms-flex-pack: center;
8519+
justify-content: center;
8520+
-webkit-box-align: center;
8521+
-ms-flex-align: center;
8522+
align-items: center;
8523+
}
8524+
8525+
.z-center-horizontal {
8526+
display: -webkit-box;
8527+
display: -ms-flexbox;
8528+
display: flex;
8529+
-webkit-box-pack: center;
8530+
-ms-flex-pack: center;
8531+
justify-content: center;
8532+
}
8533+
8534+
.z-center-vertical {
8535+
display: -webkit-box;
8536+
display: -ms-flexbox;
8537+
display: flex;
8538+
-webkit-box-align: center;
8539+
-ms-flex-align: center;
8540+
align-items: center;
8541+
}
8542+

0 commit comments

Comments
 (0)