diff --git a/app/Helpers/Helper.php b/app/Helpers/Helper.php index 1e304e1..f527566 100644 --- a/app/Helpers/Helper.php +++ b/app/Helpers/Helper.php @@ -747,7 +747,7 @@ function getSettingsGroup($group) $result = []; foreach (Setting::where('key', 'LIKE', $group . '%') ->whereNotNull('value')->get(['key', 'value']) as $r) { - if ($r->value != null) { + if ($r->value != null && $r->value != '') { $result[substr($r->key, mb_strlen($group))] = $r->value; } } @@ -802,25 +802,27 @@ function getMenuBySetting($key) /** * get group's posts by setting key * @param $key - * @param $limit + * @param integer $limit * @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C */ -function getGroupPostsBySetting($key, $limit = 10) +function getGroupPostsBySetting($key, $limit = 10, $order = 'id', $dir = "DESC") { return Group::where('id', getSetting($key) ?? 1)->first() - ->posts()->where('status', 1)->limit($limit)->get(); + ->posts()->where('status', 1)->orderBy($order, $dir)->limit($limit)->get(); } /** * get group's posts by setting key * @param $key - * @param $limit + * @param integer $limit + * @param string $order + * @param string $dir * @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C */ -function getCategoryProductBySetting($key, $limit = 10) +function getCategoryProductBySetting($key, $limit = 10, $order = 'id', $dir = "DESC") { return Category::where('id', getSetting($key) ?? 1)->first() - ->products()->where('status', 1)->limit($limit)->get(); + ->products()->where('status', 1)->orderBy($order, $dir)->limit($limit)->get(); } /** diff --git a/app/Http/Controllers/Admin/AreaController.php b/app/Http/Controllers/Admin/AreaController.php index 30d231d..3e90c3f 100644 --- a/app/Http/Controllers/Admin/AreaController.php +++ b/app/Http/Controllers/Admin/AreaController.php @@ -22,14 +22,16 @@ class AreaController extends Controller $valids = []; foreach ($area->segment as $seg) { - $dirs = File::directories(resource_path() . '/views/segments/' . $seg); - foreach ($dirs as $dir) { - $temp = explode('/', $dir); - $valids[] = [ - 'segment' => $temp[count($temp) - 2], - 'part' => $temp[count($temp) - 1], - 'data' => json_decode(file_get_contents($dir . '/' . $temp[count($temp) - 1] . '.json'), true) - ]; + if (File::exists(resource_path() . '/views/segments/' . $seg)) { + $dirs = File::directories(resource_path() . '/views/segments/' . $seg); + foreach ($dirs as $dir) { + $temp = explode('/', $dir); + $valids[] = [ + 'segment' => $temp[count($temp) - 2], + 'part' => $temp[count($temp) - 1], + 'data' => json_decode(file_get_contents($dir . '/' . $temp[count($temp) - 1] . '.json'), true) + ]; + } } } @@ -50,12 +52,12 @@ class AreaController extends Controller public function update(Request $request, Area $area) { // return $request->all(); - foreach ($request->input('parts',[]) as $i => $item) { + foreach ($request->input('parts', []) as $i => $item) { $data = json_decode($item); - if ($data == null){ + if ($data == null) { continue; } - if ($data->id == null){ + if ($data->id == null) { // create $part = new Part(); $part->area_id = $area->id; @@ -63,7 +65,7 @@ class AreaController extends Controller $part->part = $data->part; $part->sort = $i; $part->save(); - }else{ + } else { $part = Part::whereId($data->id)->first(); $part->segment = $data->segment; $part->part = $data->part; @@ -71,29 +73,31 @@ class AreaController extends Controller $part->save(); } } - foreach ( json_decode($request->input('removed')) as $id){ - Part::where('id',$id)->first()->delete(); + foreach (json_decode($request->input('removed')) as $id) { + Part::where('id', $id)->first()->delete(); } \Artisan::call('client'); - logAdmin(__METHOD__,__CLASS__,$area->id); + logAdmin(__METHOD__, __CLASS__, $area->id); - return redirect()->back()->with(['message' => __('area :NAME of website updated',['NAME' => $area->name])]); + return redirect()->back()->with(['message' => __('area :NAME of website updated', ['NAME' => $area->name])]); } - public function sort(Area $area){ - return view('admin.areas.area-sort',compact('area')); + public function sort(Area $area) + { + return view('admin.areas.area-sort', compact('area')); } - public function sortSave(Request $request){ - foreach ($request->input('items') as $key => $v){ + public function sortSave(Request $request) + { + foreach ($request->input('items') as $key => $v) { $p = Part::whereId($v['id'])->first(); $p->sort = $key; $p->save(); } - logAdmin(__METHOD__,__CLASS__,$p->area_id); - return ['OK' => true,'message' => __("As you wished sort saved")]; + logAdmin(__METHOD__, __CLASS__, $p->area_id); + return ['OK' => true, 'message' => __("As you wished sort saved")]; } } diff --git a/app/Http/Controllers/Admin/CkeditorController.php b/app/Http/Controllers/Admin/CkeditorController.php index dfe109d..56e45e9 100644 --- a/app/Http/Controllers/Admin/CkeditorController.php +++ b/app/Http/Controllers/Admin/CkeditorController.php @@ -16,10 +16,10 @@ class CkeditorController extends Controller $extension = $request->file('upload')->getClientOriginalExtension(); $fileName = $fileName . '_' . time() . '.' . $extension; - $request->file('upload')->move(public_path('images'), $fileName); + $request->file('upload')->move(public_path('upload/images'), $fileName); $CKEditorFuncNum = $request->input('CKEditorFuncNum'); - $url = asset('images/' . $fileName); + $url = asset('/upload/images/' . $fileName); $msg = __('Image uploaded successfully'); $response = ""; diff --git a/app/Http/Controllers/Admin/ProductController.php b/app/Http/Controllers/Admin/ProductController.php index 8ee6a05..94bc54b 100644 --- a/app/Http/Controllers/Admin/ProductController.php +++ b/app/Http/Controllers/Admin/ProductController.php @@ -19,7 +19,7 @@ class ProductController extends XController // protected $_MODEL_ = Product::class; // protected $SAVE_REQUEST = ProductSaveRequest::class; - protected $cols = ['name','category_id','view','sell']; + protected $cols = ['name','category_id','view','sell','status']; protected $extra_cols = ['id','slug','image_index']; protected $searchable = ['name','slug','description','excerpt','sku','table']; @@ -170,6 +170,14 @@ class ProductController extends XController } break; /*restore**/ + case 'publish': + $this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 1]); + $msg = __(':COUNT items published successfully', ['COUNT' => count($ids)]); + break; + case 'draft': + $this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 0]); + $msg = __(':COUNT items drafted successfully', ['COUNT' => count($ids)]); + break; default: $msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]); } diff --git a/app/Models/Post.php b/app/Models/Post.php index 3b384e1..1332b66 100644 --- a/app/Models/Post.php +++ b/app/Models/Post.php @@ -74,7 +74,7 @@ class Post extends Model implements HasMedia public function orgUrl() { if ($this->getMedia()->count() > 0) { - return $this->getMedia()[$this->image_index]->getUrl(); + return $this->getMedia()->first()->getUrl(); } else { return asset('assets/upload/logo.svg'); diff --git a/app/Models/Product.php b/app/Models/Product.php index 8993bf7..3250b49 100644 --- a/app/Models/Product.php +++ b/app/Models/Product.php @@ -272,4 +272,8 @@ class Product extends Model implements HasMedia return route(''); } + + public function getPrice(){ + return number_format($this->price); + } } diff --git a/public/images/anubias-logo-1024_1718227862.png b/public/images/anubias-logo-1024_1718227862.png deleted file mode 100644 index 143bfa0..0000000 Binary files a/public/images/anubias-logo-1024_1718227862.png and /dev/null differ diff --git a/resources/sass/client-custom/_zfix.scss b/resources/sass/client-custom/_zfix.scss index 2cb4b74..bbd1cd3 100644 --- a/resources/sass/client-custom/_zfix.scss +++ b/resources/sass/client-custom/_zfix.scss @@ -28,7 +28,7 @@ a,a:visited{ } .btn-primary{ background: var(--xshop-primary); - border-color: var(--xshop-secondary); + border-color: var(--xshop-primary); color: var(--xshop-diff) !important; &:hover{ diff --git a/resources/sass/panel/_common.scss b/resources/sass/panel/_common.scss index 12fc6dc..9b46b4b 100644 --- a/resources/sass/panel/_common.scss +++ b/resources/sass/panel/_common.scss @@ -100,7 +100,7 @@ a.btn,a.action-btn,a.circle-btn{ .status-0,.status-CLOSED { background: red; } -.status-ANSWERED{ +.status-1,.status-ANSWERED{ background: lime; } .status-PENDING{ diff --git a/resources/views/segments/footer/FireFooter/FireFooter.blade.php b/resources/views/segments/footer/FireFooter/FireFooter.blade.php new file mode 100644 index 0000000..b116153 --- /dev/null +++ b/resources/views/segments/footer/FireFooter/FireFooter.blade.php @@ -0,0 +1,317 @@ + diff --git a/resources/views/segments/footer/FireFooter/FireFooter.js b/resources/views/segments/footer/FireFooter/FireFooter.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/footer/FireFooter/FireFooter.json b/resources/views/segments/footer/FireFooter/FireFooter.json new file mode 100644 index 0000000..3031a55 --- /dev/null +++ b/resources/views/segments/footer/FireFooter/FireFooter.json @@ -0,0 +1,10 @@ +{ + "name": "FireFooter", + "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/footer/FireFooter/FireFooter.php b/resources/views/segments/footer/FireFooter/FireFooter.php new file mode 100644 index 0000000..ddf70e6 --- /dev/null +++ b/resources/views/segments/footer/FireFooter/FireFooter.php @@ -0,0 +1,64 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_text'; + $setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aliquid consequuntur culpa cupiditate dignissimos dolor doloremque error facilis ipsum iure officia quam qui, tempora! Fuga harum impedit iusto magnam veniam.'; + $setting->size = 12; + $setting->type = 'LONGTEXT'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' main text'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_title2'; + $setting->value = 'FAQ'; + $setting->size = 6; + $setting->type = 'TEXT'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' title 2'; + $setting->save(); + + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_group'; + $setting->value = Group::first()->id; + $setting->size = 6; + $setting->type = 'GROUP'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' group'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_last'; + $setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aliquid consequuntur culpa cupiditate dignissimos dolor doloremque error facilis ipsum iure officia quam qui, tempora! Fuga harum impedit iusto magnam veniam.'; + $setting->size = 12; + $setting->title = $part->area->name . ' ' . $part->part. ' last content'; + $setting->type = 'EDITOR'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area->name . '_' . $part->part.'_text')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_title2')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_group')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_last')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/footer/FireFooter/FireFooter.scss b/resources/views/segments/footer/FireFooter/FireFooter.scss new file mode 100644 index 0000000..1717cc9 --- /dev/null +++ b/resources/views/segments/footer/FireFooter/FireFooter.scss @@ -0,0 +1,93 @@ +.FireFooter { + + overflow: hidden; + padding-top: 7rem; + + .footer { + + .social{ + list-style: none; + i{ + font-size: 25px; + } + } + + color: var(--xshop-diff); + + a,a:visited{ + color: var(--xshop-diff); + } + z-index: 1; + --footer-background: var(--xshop-primary); + display: grid; + position: relative; + grid-area: footer; + min-height: 12rem; + + .bubbles { + position: absolute; + top: 0; + left: 0; + right: 0; + height: 1rem; + background: var(--xshop-primary); + filter: url("#blob"); + + .bubble { + position: absolute; + left: var(--position, 50%); + background: var(--xshop-primary); + border-radius: 100%; + //-webkit-animation: bubble-size var(--time, 4s) ease-in infinite var(--delay, 0s), bubble-move var(--time, 4s) ease-in infinite var(--delay, 0s); + animation: bubble-size var(--time, 4s) ease-in infinite var(--delay, 0s), bubble-move var(--time, 4s) ease-in infinite var(--delay, 0s); + transform: translate(-50%, 100%); + } + } + + .content { + padding: 6rem 1rem 2rem; + background: var(--xshop-primary); + z-index: 2; + } + } +} + +@-webkit-keyframes bubble-size { + 0%, 75% { + width: var(--size, 4rem); + height: var(--size, 4rem); + } + 100% { + width: 0rem; + height: 0rem; + } +} + +@keyframes bubble-size { + 0%, 75% { + width: var(--size, 4rem); + height: var(--size, 4rem); + } + 100% { + width: 0rem; + height: 0rem; + } +} + +@-webkit-keyframes bubble-move { + 0% { + bottom: -4rem; + } + 100% { + bottom: var(--distance, 10rem); + } +} + +@keyframes bubble-move { + 0% { + bottom: -4rem; + } + 100% { + bottom: var(--distance, 10rem); + } +} diff --git a/resources/views/segments/footer/FireFooter/screenshot.png b/resources/views/segments/footer/FireFooter/screenshot.png new file mode 100644 index 0000000..3703abc Binary files /dev/null and b/resources/views/segments/footer/FireFooter/screenshot.png differ diff --git a/resources/views/segments/footer/WaveFooter/WaveFooter.blade.php b/resources/views/segments/footer/WaveFooter/WaveFooter.blade.php new file mode 100644 index 0000000..b3a7a5c --- /dev/null +++ b/resources/views/segments/footer/WaveFooter/WaveFooter.blade.php @@ -0,0 +1,48 @@ + + diff --git a/resources/views/segments/footer/WaveFooter/WaveFooter.js b/resources/views/segments/footer/WaveFooter/WaveFooter.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/footer/WaveFooter/WaveFooter.json b/resources/views/segments/footer/WaveFooter/WaveFooter.json new file mode 100644 index 0000000..fdac464 --- /dev/null +++ b/resources/views/segments/footer/WaveFooter/WaveFooter.json @@ -0,0 +1,10 @@ +{ + "name": "WaveFooter", + "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": [] +} diff --git a/resources/views/segments/footer/WaveFooter/WaveFooter.php b/resources/views/segments/footer/WaveFooter/WaveFooter.php new file mode 100644 index 0000000..782d3b5 --- /dev/null +++ b/resources/views/segments/footer/WaveFooter/WaveFooter.php @@ -0,0 +1,51 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_speed'; + $setting->value = 2; + $setting->size = 4; + $setting->type = 'NUMBER'; + $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' speed wave 1'; + $setting->save(); + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_speed2'; + $setting->value = 6; + $setting->size = 4; + $setting->type = 'NUMBER'; + $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' speed wave 2'; + $setting->save(); + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_speed3'; + $setting->value = 4; + $setting->size = 4; + $setting->type = 'NUMBER'; + $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' speed wave 3'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area->name . '_' . $part->part.'_speed')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_speed2')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_speed3')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/footer/WaveFooter/WaveFooter.scss b/resources/views/segments/footer/WaveFooter/WaveFooter.scss new file mode 100644 index 0000000..5eb3e14 --- /dev/null +++ b/resources/views/segments/footer/WaveFooter/WaveFooter.scss @@ -0,0 +1,50 @@ +.WaveFooter { + margin-top: 3rem; + min-height: 300px; + position: relative; + .waves { + >use { + fill: var(--xshop-primary); + animation: move-forever var(--speed) -2s linear infinite; + &:nth-child(2) { + animation-delay: -3s; + animation-duration: var(--speed2); + } + &:nth-child(3) { + animation-delay: -4s; + animation-duration: var(--speed3); + } + } + } + svg { + position: absolute; + left: 0; + bottom: 5rem; + width: 100%; + height: 30vw; + max-height: 200px; + } + + .content{ + padding: 1rem; + background: var(--xshop-primary); + opacity: .96; + color: var(--xshop-diff); + height: 5rem; + position: absolute; + bottom: 0; + left: 0; + right: 0; + text-align: center; + } + +} + +@keyframes move-forever { + 0% { + transform: translate(-90px, 0%); + } + 100% { + transform: translate(85px, 0%); + } +} diff --git a/resources/views/segments/footer/WaveFooter/screenshot.png b/resources/views/segments/footer/WaveFooter/screenshot.png new file mode 100644 index 0000000..acaca30 Binary files /dev/null and b/resources/views/segments/footer/WaveFooter/screenshot.png differ diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.blade.php b/resources/views/segments/posts/NoLinkImage/NoLinkImage.blade.php new file mode 100644 index 0000000..0db10dd --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.blade.php @@ -0,0 +1,21 @@ +
part.'_dark')) dark-mode @endif'> +
+
+ + @foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',5) as $post ) +
+ +
+ @endforeach +
+
+
diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.js b/resources/views/segments/posts/NoLinkImage/NoLinkImage.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.json b/resources/views/segments/posts/NoLinkImage/NoLinkImage.json new file mode 100644 index 0000000..a117ae6 --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.json @@ -0,0 +1,10 @@ +{ + "name": "NoLinkImage", + "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/NoLinkImage/NoLinkImage.php b/resources/views/segments/posts/NoLinkImage/NoLinkImage.php new file mode 100644 index 0000000..0733f8b --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.php @@ -0,0 +1,44 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_group'; + $setting->value = Group::first()->id; + $setting->size = 6; + $setting->type = 'GROUP'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' group'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_dark'; + $setting->value = 0; + $setting->size = 6; + $setting->type = 'CHECKBOX'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' dark mode'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + + Setting::where('key',$part->area->name . '_' . $part->part.'_group')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_dark')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/posts/NoLinkImage/NoLinkImage.scss b/resources/views/segments/posts/NoLinkImage/NoLinkImage.scss new file mode 100644 index 0000000..e5121c8 --- /dev/null +++ b/resources/views/segments/posts/NoLinkImage/NoLinkImage.scss @@ -0,0 +1,30 @@ +.NoLinkImage { + padding: 1rem 0; + // scss + .no-link-item{ + transition: .4s; + background: #ffffff; + padding: 5px; + border-radius: var(--xshop-border-radius); + h3{ + font-size: 20px; + margin-top: .4rem; + } + p{ + color: gray; + } + img{ + height: 64px; + } + &:hover{ + filter: grayscale(1); + } + } + + &.dark-mode{ + .no-link-item{ + background: #21252b; + color: whitesmoke; + } + } +} diff --git a/resources/views/segments/posts/NoLinkImage/screenshot.png b/resources/views/segments/posts/NoLinkImage/screenshot.png new file mode 100644 index 0000000..01499fe Binary files /dev/null and b/resources/views/segments/posts/NoLinkImage/screenshot.png differ diff --git a/resources/views/segments/posts/PostIndexImage/PostIndexImage.blade.php b/resources/views/segments/posts/PostIndexImage/PostIndexImage.blade.php new file mode 100644 index 0000000..20979c5 --- /dev/null +++ b/resources/views/segments/posts/PostIndexImage/PostIndexImage.blade.php @@ -0,0 +1,36 @@ +
+
+

+ + {{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->name}} + +

+

+ {{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->description}} +

+
+ @foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',4) as $post ) +
+
+ {{$post->title}} +

+ {{$post->title}} +

+

+ {{$post->subtitle}} +

+ + {{__("Read more")}} + +
+
+ + @endforeach +
+ +
+
diff --git a/resources/views/segments/posts/PostIndexImage/PostIndexImage.js b/resources/views/segments/posts/PostIndexImage/PostIndexImage.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/posts/PostIndexImage/PostIndexImage.json b/resources/views/segments/posts/PostIndexImage/PostIndexImage.json new file mode 100644 index 0000000..20c3ada --- /dev/null +++ b/resources/views/segments/posts/PostIndexImage/PostIndexImage.json @@ -0,0 +1,10 @@ +{ + "name": "PostIndexImage", + "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/PostIndexImage/PostIndexImage.php b/resources/views/segments/posts/PostIndexImage/PostIndexImage.php new file mode 100644 index 0000000..4c33571 --- /dev/null +++ b/resources/views/segments/posts/PostIndexImage/PostIndexImage.php @@ -0,0 +1,43 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_group'; + $setting->value = Group::first()->id; + $setting->size = 6; + $setting->type = 'GROUP'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' group'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_btn'; + $setting->value = __("Find more"); + $setting->size = 6; + $setting->type = 'TEXT'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $setting->title = $part->area->name . ' ' . $part->part. ' button text'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area->name . '_' . $part->part.'_group')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_btn')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss b/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss new file mode 100644 index 0000000..bcb103b --- /dev/null +++ b/resources/views/segments/posts/PostIndexImage/PostIndexImage.scss @@ -0,0 +1,48 @@ +.PostIndexImage { + // scss + h1{ + font-size: 30px; + text-align: center; + position: relative; + padding: 1rem; + &:before{ + content: ' '; + position: absolute; + inset-inline-start: 47%; + inset-inline-end: 47%; + top: 0; + height: 4px; + background: var(--xshop-primary); + } + } + + .post-img-index{ + background: #ffffff33; + box-shadow: var(--xshop-shadow); + border-radius: var(--xshop-border-radius); + padding: 1rem; + + h3{ + font-size: 22px; + padding: 1rem 0; + height: 3.5em; + position: relative; + overflow: hidden; + + &:before{ + content: ' '; + position: absolute; + inset-inline-end: 5%; + width: 15%; + bottom: 0; + height: 2px; + background: var(--xshop-primary); + } + } + img{ + width: 100%; + height: 15vh; + object-fit: cover; + } + } +} diff --git a/resources/views/segments/posts/PostIndexImage/screenshot.png b/resources/views/segments/posts/PostIndexImage/screenshot.png new file mode 100644 index 0000000..03b64cc Binary files /dev/null and b/resources/views/segments/posts/PostIndexImage/screenshot.png differ diff --git a/resources/views/segments/products/TreeGridProducts/TreeGridProducts.blade.php b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.blade.php new file mode 100644 index 0000000..7a4bc15 --- /dev/null +++ b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.blade.php @@ -0,0 +1,81 @@ +
+
+ +
+
+
+

+ {{getSetting($data->area->name.'_'.$data->part.'_title')}} +

+
+ +
+ @foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_category') as $product) +
+
+ + {{$product->name}} + +

+ + {{$product->name}} + +

+ +
+ {{$product->getPrice()}} +
+ + + + + Add to card + + +
+
+ @endforeach +
+
+
+
+
+ + {{getSetting($data->area->name.'_'.$data->part.'_badgex')}} + + +
+ @foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryx') as $product) +
+ + {{$product->name}} + +
+ @endforeach +
+
+
+ + {{getSetting($data->area->name.'_'.$data->part.'_badgey')}} + + +
+ @foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryy') as $product) +
+ + {{$product->name}} + +
+ @endforeach +
+
+
+
+
diff --git a/resources/views/segments/products/TreeGridProducts/TreeGridProducts.js b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.js new file mode 100644 index 0000000..112a829 --- /dev/null +++ b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.js @@ -0,0 +1,82 @@ +import {tns} from "tiny-slider/src/tiny-slider"; + +var treeSlider,treeSliderX, treeSliderY ; + +document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('.tree-grid .section-main')?.forEach(function (el) { + if (el.classList.contains('.tns-slider')){ + console.log('ignore'); + return 'ignore'; + } + treeSlider = tns({ + container: el, + items: 3, + slideBy: 'page', + autoplay: true, + autoplayButton: false, + // nextButton: false, + controls: false, + autoplayHoverPause: true, + mouseDrag: true, + gutter: 7, + responsive:{ + 560:{ + items: 1, + }, + 768:{ + items: 2, + }, + 1000:{ + items: 3, + }, + 1400:{ + items: 4, + }, + + } + // speed:10000, + }); + }); + document.querySelectorAll('.tree-grid .section-second')?.forEach(function (el) { + if (el.classList.contains('.tns-slider')){ + console.log('ignore'); + return 'ignore'; + } + treeSliderX = tns({ + container: el, + items: 1, + slideBy: 'page', + autoplay: true, + autoplayButton: false, + // nextButton: false, + controls: false, + autoplayHoverPause: true, + autoplayTimeout: 8000, + mouseDrag: true, + gutter: 7, + edgePadding: 60, + // speed:10000, + }); + }); + document.querySelectorAll('.tree-grid .section-third')?.forEach(function (el) { + if (el.classList.contains('.tns-slider')){ + console.log('ignore'); + return 'ignore'; + } + treeSliderX = tns({ + container: el, + items: 1, + slideBy: 'page', + autoplay: true, + autoplayTimeout: 7500, + autoplayButton: false, + // nextButton: false, + controls: false, + autoplayHoverPause: true, + mouseDrag: true, + gutter: 7, + edgePadding: 60, + // speed:10000, + }); + }); +}); diff --git a/resources/views/segments/products/TreeGridProducts/TreeGridProducts.json b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.json new file mode 100644 index 0000000..e6709d3 --- /dev/null +++ b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.json @@ -0,0 +1,10 @@ +{ + "name": "TreeGridProducts", + "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/products/TreeGridProducts/TreeGridProducts.php b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.php new file mode 100644 index 0000000..dbd4559 --- /dev/null +++ b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.php @@ -0,0 +1,131 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_title'; + $setting->value = 'Favorite products'; + $setting->type = 'TEXT'; + $setting->size = 4; + $setting->title = $part->area->name . ' ' . $part->part .' main title'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_color'; + $setting->value = '#273763'; + $setting->type = 'COLOR'; + $setting->size = 4; + $setting->title = $part->area->name . ' ' . $part->part .' main color'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_category'; + $setting->value = Category::first()->id; + $setting->type = 'CATEGORY'; + $setting->size = 4; + $setting->title = $part->area->name . ' ' . $part->part .' main category'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_badgex'; + $setting->value = '22%'; + $setting->type = 'TEXT'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' Second badge text'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_gradx1'; + $setting->value = '#FF7D33'; + $setting->type = 'COLOR'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' second gradiant color 1'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_gradx2'; + $setting->value = '#FF971D'; + $setting->type = 'COLOR'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' second gradiant color 2'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_categoryx'; + $setting->value = Category::first()->id; + $setting->type = 'CATEGORY'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' second category'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_badgey'; + $setting->value = 'Sale'; + $setting->type = 'TEXT'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' third badge text'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_grady1'; + $setting->value = '#FF7D33'; + $setting->type = 'COLOR'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' third gradiant color 1'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_grady2'; + $setting->value = '#430392'; + $setting->type = 'COLOR'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' third gradiant color 2'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_categoryy'; + $setting->value = Category::first()->id; + $setting->type = 'CATEGORY'; + $setting->size = 3; + $setting->title = $part->area->name . ' ' . $part->part .' third category'; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area->name . '_' . $part->part.'_title')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_category')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_color')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_badgex')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_gradx1')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_gradx2')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_categoryx')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_badgey')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_grady1')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_grady2')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_categoryy')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/products/TreeGridProducts/TreeGridProducts.scss b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.scss new file mode 100644 index 0000000..00f926b --- /dev/null +++ b/resources/views/segments/products/TreeGridProducts/TreeGridProducts.scss @@ -0,0 +1,103 @@ +.TreeGridProducts { + + margin-bottom: 2rem; + + h1{ + font-size: 22px; + } + .tree-product-box{ + padding: .4rem; + overflow: hidden; + background: var(--xshop-background); + border-radius: var(--xshop-border-radius); + color: var(--xshop-text); + .price{ + padding: 4px; + text-align: center; + color: var(--xshop-secondary); + margin-bottom: 7px; + } + + img{ + width: 100%; + } + h4{ + font-size: 17px; + margin: 0; + text-align: center; + padding: .4rem; + overflow: hidden; + } + a{ + color: var(--xshop-text); + } + + } + .tree-grid { + display: grid; + grid-template-columns: repeat(8,1fr); + grid-template-rows: auto; + grid-gap: 10px 10px; + padding-top: 1rem; + .tree-grid-item { + + overflow: hidden; + border-radius: var(--xshop-border-radius); + //display: flex; + //align-items: center; + //justify-content: center; + color: var(--xshop-diff); + padding: 2rem 1rem; + position: relative; + box-shadow: var(--xshop-shadow); + &:first-child { + grid-column: 1/5 span; + grid-row: 1/3; + background: var(---main-bg); + } + &:nth-child(2) { + grid-column: 6/3 span; + grid-row: 1/2; + background: rgb(255,125,51); + background: linear-gradient(180deg, var(--gx1) 0%, var(--gx2) 100%); + overflow: hidden; + } + &:nth-child(3) { + grid-column: 6/3 span; + grid-row: 2/2; + background: linear-gradient(180deg, var(--gy1) 0%, var(--gy2) 100%); + overflow: hidden; + } + } + + } + + .badge { + position: absolute; + inset-inline-end: 0; + top: 0; + padding: 15px; + border-radius: var(--xshop-border-radius); + width: 75px; + background: #283035aa !important; + } + + .section-second,.section-third{ + img{ + height: 128px; + } + } +} + +@media ( max-width: 1024px ) { + .TreeGridProducts { + .tree-grid { + grid-template-columns: repeat(1, 1fr) !important; + grid-template-rows: repeat(1, 1fr) !important; + .tree-grid-item { + grid-column: auto !important; + grid-row: auto !important; + } + } + } +} diff --git a/resources/views/segments/products/TreeGridProducts/screenshot.png b/resources/views/segments/products/TreeGridProducts/screenshot.png new file mode 100644 index 0000000..a7125ef Binary files /dev/null and b/resources/views/segments/products/TreeGridProducts/screenshot.png differ diff --git a/resources/views/segments/slider/SliderSimple/SliderSimple.js b/resources/views/segments/slider/SliderSimple/SliderSimple.js index 6248972..e1ab4f6 100755 --- a/resources/views/segments/slider/SliderSimple/SliderSimple.js +++ b/resources/views/segments/slider/SliderSimple/SliderSimple.js @@ -4,6 +4,10 @@ var sliderSimple ; document.addEventListener('DOMContentLoaded', () => { document.querySelectorAll('.SliderSimple')?.forEach(function (el) { + if (el.classList.contains('.tns-slider')){ + console.log('ignore'); + return 'ignore'; + } sliderSimple = tns({ container: el, items: 1, diff --git a/routes/web.php b/routes/web.php index 568684b..72d1170 100644 --- a/routes/web.php +++ b/routes/web.php @@ -356,7 +356,7 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group( Route::get('test',function (){ // return \Resources\Views\Segments\PreloaderCircle::onAdd(); - return \App\Helpers\TVisitor::GetKeyword(); + return getCategoryProductBySetting('index_TreeGridProducts_category'); })->name('test');