From 55a6b0e62e2f75bacb552563811b6a502af74c73 Mon Sep 17 00:00:00 2001 From: farazdy Date: Sun, 28 Jul 2024 19:42:49 +0330 Subject: [PATCH] Added grid post list sidebar --- .../GridPostListSidebar.blade.php | 75 +++++++++ .../GridPostListSidebar.js | 0 .../GridPostListSidebar.json | 10 ++ .../GridPostListSidebar.php | 30 ++++ .../GridPostListSidebar.scss | 144 ++++++++++++++++++ .../GridPostListSidebar/inc/sidebar.blade.php | 44 ++++++ 6 files changed, 303 insertions(+) create mode 100644 resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.blade.php create mode 100644 resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js create mode 100644 resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.json create mode 100644 resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.php create mode 100644 resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.scss create mode 100644 resources/views/segments/posts_page/GridPostListSidebar/inc/sidebar.blade.php diff --git a/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.blade.php b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.blade.php new file mode 100644 index 0000000..81ac770 --- /dev/null +++ b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.blade.php @@ -0,0 +1,75 @@ +
+
+
+ @foreach(\App\Models\Post::where('status',1)->where('is_pinned',1)->limit(2)->get() as $post) +
+
+
+ {{$post->mainGroup->name}} +
+ + {{$post->title}} + +
+

+ {{$post->title}} +

+ + {{$post->created_at->ldate('Y/m/d l')}} + +
+
+
+ @endforeach +
+
+
+ @if(!getSetting($data->area->name.'_'.$data->part.'_invert')) +
+ @include('segments.posts_page.GridPostListSidebar.inc.sidebar') +
+ @endif +
+
+ @foreach($posts as $post) +
+
+
+ {{$post->mainGroup->name}} +
+ {{$post->title}} +

+ {{$post->title}} +

+
+ + + {{$post->created_at->ldate('Y/m/d l')}} + + + + {{$post->view}} + +
+

+ {{$post->subtitle}} +
+

+ + {{__("Read more")}} + +
+
+ @endforeach +
+ {{$posts->links()}} +
+ @if(getSetting($data->area->name.'_'.$data->part.'_invert')) +
+ @include('segments.posts_page.GridPostListSidebar.inc.sidebar') +
+ @endif +
+
+
diff --git a/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.json b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.json new file mode 100644 index 0000000..ddc4e18 --- /dev/null +++ b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.json @@ -0,0 +1,10 @@ +{ + "name": "GridPostListSidebar", + "version": "1.0", + "author": "xStack", + "email": "xshop@xstack.ir", + "license": "GPL-3.0-or-later", + "url": "https:\/\/xstack.ir", + "author_url": "https:\/\/4xmen.ir", + "packages": [] +} \ No newline at end of file diff --git a/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.php b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.php new file mode 100644 index 0000000..70d3d28 --- /dev/null +++ b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.php @@ -0,0 +1,30 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_invert'; + $setting->value = 0; + $setting->size = 12; + $setting->type = 'CHECKBOX'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' invert sidebar position'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area->name . '_' . $part->part.'_invert')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.scss b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.scss new file mode 100644 index 0000000..5f22c21 --- /dev/null +++ b/resources/views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.scss @@ -0,0 +1,144 @@ +.GridPostListSidebar { + .pinned-posts{ + padding: 2rem 0; + //column-gap: 2px; + //row-gap: 2px; + .post-item{ + position: relative; + height: 350px; + border-radius: var(--xshop-border-radius) ; + overflow: hidden; + background: #333; + img{ + border-radius: var(--xshop-border-radius) ; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + width: 100%; + height: 100%; + object-fit: cover; + transition: 400ms; + opacity: .7; + } + + .detail{ + position: absolute; + left: 0; + right: 0; + bottom: 0; + z-index: 2; + padding: 1rem; + color: white; + span{ + opacity: .5; + } + } + + .corner{ + border-radius: var(--xshop-border-radius) ; + position: absolute; + inset-inline-start: 0; + top: 0; + background: var(--xshop-primary); + color: var(--xshop-diff); + z-index: 2; + padding: 4px 1rem; + font-size: 17px; + + } + + &:hover{ + img{ + transform: scale(1.6); + } + } + } + } + + .grid-post-item{ + position: relative; + margin-bottom: 1rem; + overflow: hidden; + img{ + width: 100%; + height: 300px; + object-fit: cover; + margin-bottom: 1rem; + border-radius: var(--xshop-border-radius) ; + transition: 500ms; + } + + p{ + text-align: justify; + height: 4em; + overflow: hidden; + } + + .corner{ + border-radius: var(--xshop-border-radius) ; + position: absolute; + inset-inline-start: 0; + top: 0; + background: var(--xshop-primary); + color: var(--xshop-diff); + z-index: 2; + padding: 4px 1rem; + font-size: 17px; + + } + + &:hover{ + img{ + filter: contrast(1.2) grayscale(.5); + } + } + } + + + aside{ + h4{ + padding: .5rem; + position: relative; + text-align: center; + font-weight: 300; + font-size: 20px; + &:after{ + position: absolute; + content: ' '; + height: 1px; + width: 70%; + bottom: 0; + left: 15%; + right: 15%; + background: linear-gradient(90deg,#ffffff00 0%, var(--xshop-primary) 50%, #ffffff00 100%); + } + } + } + + .recent{ + padding: 0; + list-style: none; + margin-top: 1rem; + li{ + min-height: 60px; + margin-bottom: 1rem; + } + img{ + width: 48px; + height: 48px; + object-fit: cover; + } + + p{ + height: 1.2em; + overflow: hidden; + } + + h6{ + max-height: 2.2em; + overflow: hidden; + } + } +} diff --git a/resources/views/segments/posts_page/GridPostListSidebar/inc/sidebar.blade.php b/resources/views/segments/posts_page/GridPostListSidebar/inc/sidebar.blade.php new file mode 100644 index 0000000..a810c73 --- /dev/null +++ b/resources/views/segments/posts_page/GridPostListSidebar/inc/sidebar.blade.php @@ -0,0 +1,44 @@ +