diff --git a/resources/js/client.js b/resources/js/client.js index 1f80654..48133b4 100644 --- a/resources/js/client.js +++ b/resources/js/client.js @@ -9,4 +9,4 @@ import "./client-custom/confirm.js"; import "./client-custom/safeForm.js"; import "./client-custom/windowLoader.js"; import "../views/segments/preloader/PreloaderCircle/PreloaderCircle.js"; -import "../views/segments/posts_page/SimplePostList/SimplePostList.js"; +import "../views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.js"; diff --git a/resources/sass/client.scss b/resources/sass/client.scss index 9951df1..0c443bf 100644 --- a/resources/sass/client.scss +++ b/resources/sass/client.scss @@ -21,4 +21,4 @@ $xshop-shadow:2px 2px 4px #777777; @import "client-custom/general"; @import "client-custom/zfix"; @import "../views/segments/preloader/PreloaderCircle/PreloaderCircle"; -@import "../views/segments/posts_page/SimplePostList/SimplePostList"; +@import "../views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar"; diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.blade.php b/resources/views/segments/post/PostSidebar/PostSidebar.blade.php index 9dfa796..24ee33c 100644 --- a/resources/views/segments/post/PostSidebar/PostSidebar.blade.php +++ b/resources/views/segments/post/PostSidebar/PostSidebar.blade.php @@ -2,11 +2,11 @@
@if(!getSetting($data->area->name.'_'.$data->part.'_invert')) -
+
@include('segments.post.PostSidebar.inc.sidebar')
@endif -
+

{{$post->title}} @@ -48,11 +48,11 @@

- @if(getSetting($data->area->name.'_'.$data->part.'_invert')) -
- @include('segments.post.PostSidebar.inc.sidebar') -
- @endif + @if(getSetting($data->area->name.'_'.$data->part.'_invert')) +
+ @include('segments.post.PostSidebar.inc.sidebar') +
+ @endif
diff --git a/resources/views/segments/post/PostSidebar/PostSidebar.scss b/resources/views/segments/post/PostSidebar/PostSidebar.scss index e730de5..b780f95 100644 --- a/resources/views/segments/post/PostSidebar/PostSidebar.scss +++ b/resources/views/segments/post/PostSidebar/PostSidebar.scss @@ -64,5 +64,10 @@ height: 1.2em; overflow: hidden; } + + h6{ + max-height: 2.2em; + overflow: hidden; + } } } diff --git a/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.blade.php b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.blade.php new file mode 100644 index 0000000..ac98614 --- /dev/null +++ b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.blade.php @@ -0,0 +1,61 @@ +
+
+
+ @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.SimplePostListSideBar.inc.sidebar') +
+ @endif +
+ @foreach($posts as $post) +
+ {{$post->title}} +

+ {{$post->title}} +

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

+ {{$post->subtitle}} +
+ + {{__("Read more")}} + +

+
+ @endforeach + {{$posts->links()}} +
+ @if(getSetting($data->area->name.'_'.$data->part.'_invert')) +
+ @include('segments.posts_page.SimplePostListSideBar.inc.sidebar') +
+ @endif +
+
+
diff --git a/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.js b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.json b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.json new file mode 100644 index 0000000..c8a536d --- /dev/null +++ b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.json @@ -0,0 +1,10 @@ +{ + "name": "SimplePostListSideBar", + "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/SimplePostListSideBar/SimplePostListSideBar.php b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.php new file mode 100644 index 0000000..49de662 --- /dev/null +++ b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.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/SimplePostListSideBar/SimplePostListSideBar.scss b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.scss new file mode 100644 index 0000000..e61b752 --- /dev/null +++ b/resources/views/segments/posts_page/SimplePostListSideBar/SimplePostListSideBar.scss @@ -0,0 +1,116 @@ +.SimplePostListSideBar { + // scss + .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); + } + } + } + } + + .post-list-item{ + border-bottom: #44444433 1px solid; + margin-bottom: 1rem; + min-height: 200px; + img{ + height: 175px; + border-radius: var(--xshop-border-radius); + } + + } + + 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/SimplePostListSideBar/inc/sidebar.blade.php b/resources/views/segments/posts_page/SimplePostListSideBar/inc/sidebar.blade.php new file mode 100644 index 0000000..a810c73 --- /dev/null +++ b/resources/views/segments/posts_page/SimplePostListSideBar/inc/sidebar.blade.php @@ -0,0 +1,44 @@ + diff --git a/resources/views/segments/posts_page/SimplePostListSideBar/screenshot.png b/resources/views/segments/posts_page/SimplePostListSideBar/screenshot.png new file mode 100644 index 0000000..c83bd13 Binary files /dev/null and b/resources/views/segments/posts_page/SimplePostListSideBar/screenshot.png differ