From 5d0e4333de1b8b2ecc953d73a0b5dc387d3bc19e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Tue, 29 Dec 2020 21:22:09 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=9A=E3=83=BC=E3=82=B8=E3=83=8D=E3=83=BC?= =?UTF-8?q?=E3=82=B7=E3=83=A7=E3=83=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Http/Controllers/Home/Index.php | 2 +- resources/sass/app.scss | 1 + resources/sass/conponent/_pagination.scss | 49 ++++++++++++++++++++++ resources/views/pages/site/index.blade.php | 4 ++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 resources/sass/conponent/_pagination.scss diff --git a/app/Http/Controllers/Home/Index.php b/app/Http/Controllers/Home/Index.php index e35a280..714134d 100644 --- a/app/Http/Controllers/Home/Index.php +++ b/app/Http/Controllers/Home/Index.php @@ -22,7 +22,7 @@ class Index { public function index () { $get = DB::table('blg_content')->where('isPost', 1); if ($this->valid['blg_addpost'] == 0 && $this->valid['blg_editpost'] == 0) $get = $get->where('public_status', 0); - $get = $get->orderBy('publish_date', 'desc')->get(); + $get = $get->orderBy('publish_date', 'desc')->paginate(10); setlocale(LC_ALL, 'ja_JP.utf8'); return view('pages.site.index', ['res' => $get, 'menu' => $this->menu, 'user' => $this->user]); diff --git a/resources/sass/app.scss b/resources/sass/app.scss index ab52bf5..7a034d2 100644 --- a/resources/sass/app.scss +++ b/resources/sass/app.scss @@ -28,6 +28,7 @@ @import "conponent/check"; @import "conponent/form"; @import "conponent/modal"; +@import "conponent/pagination"; @import "conponent/select"; // テーブル diff --git a/resources/sass/conponent/_pagination.scss b/resources/sass/conponent/_pagination.scss new file mode 100644 index 0000000..5df020b --- /dev/null +++ b/resources/sass/conponent/_pagination.scss @@ -0,0 +1,49 @@ +.page-link { + background: linear-gradient(to bottom, $evil4 0%, $evil1 34%, $evil6 100%); +} + +.page-link, .page-item .disabled { + text-align: center; + color: $white1; + padding: 8px 20px; + font-size: 28px; + border-bottom: solid 2px $suwa03; + cursor: pointer; + transition: background 0.3s, color 0.3s; + margin: auto; +} + +.page-link > a { + color: $white1; +} + +.page-link > a:hover { + text-decoration: none; +} + +.page-link:hover { + color: $white1; + background: linear-gradient(to bottom, $evil3 0%, $evil0 34%, $evil2 100%); +} + +.page-item.disabled > .page-link { + color: $white1; + background: linear-gradient(to bottom, $black3 0%, $grey4 34%, $grey5 100%); + border-color: $suwa04; +} + +.page-item.active > .page-link { + color: $white1; + background: linear-gradient(to bottom, $suwa04 0%, $suwa01 34%, $suwa06 100%); + border-color: $suwa04; +} + +.page-item.active > .page-link:hover { + color: $white1; + background: linear-gradient(to bottom, $suwa03 0%, $suwa00 34%, $suwa02 100%); +} + +.pagination { + margin: auto; + padding: 8px; +} \ No newline at end of file diff --git a/resources/views/pages/site/index.blade.php b/resources/views/pages/site/index.blade.php index 5c44812..13973e9 100644 --- a/resources/views/pages/site/index.blade.php +++ b/resources/views/pages/site/index.blade.php @@ -12,4 +12,8 @@ @endforeach +
+ {{ $res->links() }} +
+ @endsection