diff --git a/resources/views/segments/default-assets/circle-3d-minify.svg b/resources/views/segments/default-assets/circle-3d-minify.svg new file mode 100644 index 0000000..5ce409d --- /dev/null +++ b/resources/views/segments/default-assets/circle-3d-minify.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/resources/views/segments/default-assets/smoke.webp b/resources/views/segments/default-assets/smoke.webp new file mode 100644 index 0000000..aa27ef5 Binary files /dev/null and b/resources/views/segments/default-assets/smoke.webp differ diff --git a/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.blade.php b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.blade.php new file mode 100644 index 0000000..70b17a9 --- /dev/null +++ b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.blade.php @@ -0,0 +1,43 @@ +
+
+
+
+ +
+
+ +
+
+ + @foreach(getCategoryProductBySetting($part->area_name . '_' . $part->part.'_category') as $product) +
+ +
+ +
+ + {{$product->name}} + + + +
+
+

+ {{$product->name}} +

+ + + {{__("View product")}} + + +
+ +
+ +
+ @endforeach +
+
+ +
+
diff --git a/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.js b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.js new file mode 100644 index 0000000..e231d42 --- /dev/null +++ b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.js @@ -0,0 +1,41 @@ +import {tns} from "tiny-slider/src/tiny-slider"; + +var author ; + +document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('#samira-slider')?.forEach(function (el) { + if (el.classList.contains('.tns-slider')){ + console.log('ignore'); + return 'ignore'; + } + author = tns({ + container: el, + items: 1.5, + // edgePadding: 50, + autoplay: true, + autoplayButton: false, + mouseDrag: true, + prevButton: false, + nextButton: false, + autoplayTimeout: 8000, + center: true, + nav: true, + loop:true, + }); + }); + + document.querySelector('#sam-nxt')?.addEventListener('click',function () { + if (document.documentElement.getAttribute('dir') === 'rtl'){ + author.goTo('prev'); + }else{ + author.goTo('next'); + } + }); + document.querySelector('#sam-prv')?.addEventListener('click',function () { + if (document.documentElement.getAttribute('dir') !== 'rtl'){ + author.goTo('prev'); + }else{ + author.goTo('next'); + } + }); +}); diff --git a/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.json b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.json new file mode 100644 index 0000000..bea5c6e --- /dev/null +++ b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.json @@ -0,0 +1,10 @@ +{ + "name": "SamiraProductSlider", + "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/SamiraProductSlider/SamiraProductSlider.php b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.php new file mode 100644 index 0000000..d37bebf --- /dev/null +++ b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.php @@ -0,0 +1,79 @@ +section = 'theme'; + $setting->key = $part->area_name . '_' . $part->part.'_title'; + $setting->value = 'Lorem ipsum dolor sit amet'; + $setting->type = 'TEXT'; + $setting->size = 6; + $setting->title = $part->area_name . ' ' . $part->part .' titles'; + $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 = 3; + $setting->title = $part->area_name . ' ' . $part->part .' category'; + $setting->save(); + + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area_name . '_' . $part->part.'_bg'; + $setting->value = gfx()['secondary']; + $setting->type = 'COLOR'; + $setting->data = json_encode(['name' => 'samira-bg']); + $setting->size = 3; + $setting->title = $part->area_name . ' ' . $part->part .' background color'; + $setting->save(); + + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area_name . '_' . $part->part.'_limit'; + $setting->value = 4; + $setting->size = 6; + $setting->type = 'NUMBER'; + $setting->data = json_encode(['xmin' => 4, 'xmax' => 12]); + $setting->title = $part->area_name . ' ' . $part->part. ' limit'; + $setting->save(); + + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area_name . '_' . $part->part.'_webp'; + $setting->value = null; + $setting->type = 'FILE'; + $setting->size = 6; + $setting->title = $part->area_name . ' ' . $part->part.' background pattern image'; + $setting->save(); + File::copy(__DIR__.'/../../default-assets/smoke.webp',public_path('upload/images/').$part->area_name . '.' . $part->part.'.webp'); + File::copy(__DIR__.'/../../default-assets/circle-3d-minify.svg',public_path('upload/images/').'circle-3d-minify.svg'); + + } + 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.'bg')->first()?->delete(); + Setting::where('key',$part->area_name . '_' . $part->part.'_webp')->first()?->delete(); + + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.scss b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.scss new file mode 100644 index 0000000..4535755 --- /dev/null +++ b/resources/views/segments/products/SamiraProductSlider/SamiraProductSlider.scss @@ -0,0 +1,143 @@ +#SamiraProductSlider { + // scss + padding: 4rem 0; + background: var(--samira-bg); + color: var(--xshop-diff2); + + .container,.container-fluid{ + position: relative; + padding: 2rem 0; + &:before{ + position: absolute; + content: ' '; + top: 1rem; + bottom: 1rem; + left: 2rem; + right: 2rem; + background: #ffffff; + background: radial-gradient(circle, rgba(255,255,255,.4) 0%, rgba(0,0,0,0) 100%); + + border-radius: 50%; + filter: blur(30px); + + } + } + + img{ + width: 100px; + transition: 300ms; + height: 80vh; + object-fit: contain; + } + + .slider-content{ + height: 80vh; + //border:1px solid grey; + direction: rtl !important; + transform: translateX(25%); + + .col-md-4{ + padding-top: 40vh; + a{ + color: white; + } + h4{ + border-bottom: darkred 1px solid; + padding: .5rem; + } + } + } + + .cloudy{ + position: relative; + padding-top: 10vh; + .bg{ + opacity: 0; + transition: 200ms; + } + } + + + .tns-slide-active{ + img{ + width: 100%; + height: 50vh; + } + + &+.tns-item{ + direction: ltr !important; + } + + .cloudy{ + .bg{ + position: absolute; + left: 15%; + bottom: 0; + top: 0; + width: 75%; + z-index: -1; + object-fit: contain; + height: 70vh; + opacity: 1; + } + .circle{ + position: absolute; + right: 0; + bottom: -10vh; + width: 100%; + object-fit: scale-down; + height: 15vh; + transform: translateX(5%); + } + } + + } + + #samira-container { + position: relative; + + .sld-btn,.tns-nav{ + z-index: 70; + position: absolute; + top: 90%; + cursor: pointer; + i{ + font-size: 35px; + } + } + + #sam-nxt{ + left:calc(20% + 200px); + } + #sam-prv{ + left: 20%; + } + + .tns-nav{ + display: flex !important; + width: 150px; + left:calc(20% + 45px); + height: 50px; + + align-items: center; + justify-content: space-evenly; + button{ + display: inline-block; + margin: 3px; + width: 10px; + height: 10px; + border-radius: var(--xshop-border-radius); + background: #ffffff44; + border: 0; + } + + .tns-nav-active{ + + background: #ffffff; + } + } + } + + + +} diff --git a/resources/views/segments/products/SamiraProductSlider/screenshot.png b/resources/views/segments/products/SamiraProductSlider/screenshot.png new file mode 100644 index 0000000..9cc398c Binary files /dev/null and b/resources/views/segments/products/SamiraProductSlider/screenshot.png differ