- @foreach( getGroupPostsBySetting($data->area_name.'_'.$data->part.'_group',10) as $post )
+
+ @foreach( getPostsQueryBySetting($data->area_name.'_'.$data->part.'_query',10) as $post )
@@ -23,5 +25,12 @@
@endforeach
+
+
+
+
+
+
+
diff --git a/resources/views/segments/posts/PostsSlider/PostsSlider.js b/resources/views/segments/posts/PostsSlider/PostsSlider.js
index 19691d6..73eacfe 100644
--- a/resources/views/segments/posts/PostsSlider/PostsSlider.js
+++ b/resources/views/segments/posts/PostsSlider/PostsSlider.js
@@ -1,10 +1,10 @@
import {tns} from "tiny-slider/src/tiny-slider";
-var postsSlider ;
+var postsSlider;
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('#posts-slider')?.forEach(function (el) {
- if (el.classList.contains('.tns-slider')){
+ if (el.classList.contains('.tns-slider')) {
console.log('ignore');
return 'ignore';
}
@@ -17,20 +17,24 @@ document.addEventListener('DOMContentLoaded', () => {
mouseDrag: true,
autoplayTimeout: 5000,
gutter: 10,
- responsive:{
- 560:{
+ responsive: {
+ 560: {
items: 2,
edgePadding: 30,
},
- 768:{
- items: 4,
+ 768: {
+ items: 3,
edgePadding: 40,
},
- 1000:{
- items: 5,
+ 1000: {
+ items: 4,
edgePadding: 50,
},
- 1400:{
+ 1400: {
+ items: 5,
+ edgePadding: 60,
+ },
+ 1700: {
items: 6,
edgePadding: 60,
},
@@ -40,4 +44,19 @@ document.addEventListener('DOMContentLoaded', () => {
});
});
+ document.querySelector('#pst-nxt')?.addEventListener('click',function () {
+ if (document.documentElement.getAttribute('dir') === 'rtl'){
+ postsSlider.goTo('prev');
+ }else{
+ postsSlider.goTo('next');
+ }
+ });
+ document.querySelector('#pst-prv')?.addEventListener('click',function () {
+ if (document.documentElement.getAttribute('dir') !== 'rtl'){
+ postsSlider.goTo('prev');
+ }else{
+ postsSlider.goTo('next');
+ }
+ });
+
});
diff --git a/resources/views/segments/posts/PostsSlider/PostsSlider.php b/resources/views/segments/posts/PostsSlider/PostsSlider.php
index 7b9d165..be518db 100644
--- a/resources/views/segments/posts/PostsSlider/PostsSlider.php
+++ b/resources/views/segments/posts/PostsSlider/PostsSlider.php
@@ -10,27 +10,30 @@ class PostsSlider
{
public static function onAdd(Part $part = null)
{
+
$setting = new Setting();
$setting->section = 'theme';
- $setting->key = $part->area_name . '_' . $part->part.'_title';
- $setting->value = 'Lorem ipsum dolor sit amet';
- $setting->type = 'TEXT';
- $setting->size = 12;
- $setting->title = $part->area_name . ' ' . $part->part .' title';
+ $setting->key = $part->area_name . '_' . $part->part.'_query';
+ $setting->value = Group::first()->id.',id,DESC';
+ $setting->size = 6;
+ $setting->type = 'POST_QUERY';
+ $setting->title = $part->area_name . ' ' . $part->part. ' query';
$setting->save();
+
$setting = new Setting();
$setting->section = 'theme';
- $setting->key = $part->area_name . '_' . $part->part.'_group';
- $setting->value = Group::first()->id;
+ $setting->key = $part->area_name . '_' . $part->part.'_title';
+ $setting->value = 'Lorem ipsum dolor sit amet';
+ $setting->type = 'TEXT';
$setting->size = 6;
- $setting->type = 'GROUP';
-// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
- $setting->title = $part->area_name . ' ' . $part->part. ' group';
+ $setting->title = $part->area_name . ' ' . $part->part .' title';
$setting->save();
+
+
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_color';
diff --git a/resources/views/segments/posts/PostsSlider/PostsSlider.scss b/resources/views/segments/posts/PostsSlider/PostsSlider.scss
index d560187..44c7d50 100644
--- a/resources/views/segments/posts/PostsSlider/PostsSlider.scss
+++ b/resources/views/segments/posts/PostsSlider/PostsSlider.scss
@@ -3,6 +3,7 @@
padding: 3rem 0;
background: var(--post-slider-color);
color: var(--xshop-diff);
+ position: relative;
h1{
font-size: 30px;
@@ -31,10 +32,13 @@
background: linear-gradient(-90deg, var(--post-slider-color) 20%, rgba(0,0,0,0) 100%);
}
+
+
}
.post-slider{
border-radius: var(--xshop-border-radius);
position: relative;
+ margin-bottom: 1rem;
img{
width: 100%;
height: 35vh;
@@ -64,4 +68,48 @@
}
}
+
+ .tns-nav{
+ position: absolute;
+ display: flex !important;
+ width: 200px;
+ left: 50%;
+ height: 50px;
+ bottom: -2rem;
+ transform: translateX(-50%);
+
+ align-items: center;
+ justify-content: center;
+ button{
+ display: inline-block;
+ margin: 7px;
+ width: 10px;
+ height: 10px;
+ border-radius: var(--xshop-border-radius);
+ background: #ffffff;
+ border: 0;
+ }
+
+ .tns-nav-active{
+
+ background: var(--xshop-secondary);
+ }
+ }
+
+ .sld-btn{
+ position: absolute;
+ top: 47%;
+ cursor: pointer;
+ z-index: 55;
+ i{
+ font-size: 35px;
+ }
+ }
+
+ #pst-nxt{
+ right: 45px;
+ }
+ #pst-prv{
+ left: 45px;
+ }
}
diff --git a/resources/views/segments/products/LatestProducts/LatestProducts.blade.php b/resources/views/segments/products/LatestProducts/LatestProducts.blade.php
index 65d1215..aded2df 100644
--- a/resources/views/segments/products/LatestProducts/LatestProducts.blade.php
+++ b/resources/views/segments/products/LatestProducts/LatestProducts.blade.php
@@ -6,7 +6,9 @@
@foreach(\App\Models\Product::where('status',1)->orderByDesc('id')->limit(4)->get() as $product)
- @include(\App\Models\Area::where('name','product-grid')->first()->defPart(),compact('product'))
+
+ @include(\App\Models\Area::where('name','product-grid')->first()->defPart(),compact('product'))
+
@endforeach
diff --git a/resources/views/segments/products/ProductsSlider/ProductsSlider.blade.php b/resources/views/segments/products/ProductsSlider/ProductsSlider.blade.php
index d91a7d5..ac99185 100644
--- a/resources/views/segments/products/ProductsSlider/ProductsSlider.blade.php
+++ b/resources/views/segments/products/ProductsSlider/ProductsSlider.blade.php
@@ -1,4 +1,4 @@
-
+part}}' >
{{getSetting($part->area_name . '_' . $part->part.'_title')}}