diff --git a/resources/views/segments/index/AuthorSlider/AuthorSlider.blade.php b/resources/views/segments/index/AuthorSlider/AuthorSlider.blade.php new file mode 100644 index 0000000..0dbdd73 --- /dev/null +++ b/resources/views/segments/index/AuthorSlider/AuthorSlider.blade.php @@ -0,0 +1,36 @@ +
+
+

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

+
+
+ +
+
+ +
+
+ @foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',10) as $post ) + + @endforeach +
+
+
+
diff --git a/resources/views/segments/index/AuthorSlider/AuthorSlider.js b/resources/views/segments/index/AuthorSlider/AuthorSlider.js new file mode 100644 index 0000000..15c0255 --- /dev/null +++ b/resources/views/segments/index/AuthorSlider/AuthorSlider.js @@ -0,0 +1,39 @@ +import {tns} from "tiny-slider/src/tiny-slider"; + +var author ; + +document.addEventListener('DOMContentLoaded', () => { + document.querySelectorAll('#author-slider')?.forEach(function (el) { + if (el.classList.contains('.tns-slider')){ + console.log('ignore'); + return 'ignore'; + } + author = tns({ + container: el, + autoplay: true, + autoplayButton: false, + // nextButton: false, + controls: false, + mouseDrag: true, + autoplayTimeout: 8000, + gutter: 10, + items: 1, + // speed:10000, + }); + }); + + document.querySelector('#auth-nxt')?.addEventListener('click',function () { + if (document.documentElement.getAttribute('dir') === 'rtl'){ + author.goTo('prev'); + }else{ + author.goTo('next'); + } + }); + document.querySelector('#auth-prv')?.addEventListener('click',function () { + if (document.documentElement.getAttribute('dir') !== 'rtl'){ + author.goTo('prev'); + }else{ + author.goTo('next'); + } + }); +}); diff --git a/resources/views/segments/index/AuthorSlider/AuthorSlider.json b/resources/views/segments/index/AuthorSlider/AuthorSlider.json new file mode 100644 index 0000000..6fcbeff --- /dev/null +++ b/resources/views/segments/index/AuthorSlider/AuthorSlider.json @@ -0,0 +1,10 @@ +{ + "name": "AuthorSlider", + "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/index/AuthorSlider/AuthorSlider.php b/resources/views/segments/index/AuthorSlider/AuthorSlider.php new file mode 100644 index 0000000..5efcfc2 --- /dev/null +++ b/resources/views/segments/index/AuthorSlider/AuthorSlider.php @@ -0,0 +1,63 @@ +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->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.'_color'; + $setting->value = gfx()['secondary']; + $setting->type = 'COLOR'; + $setting->data = json_encode(['name' => 'author-slider-color']); + $setting->size = 6; + $setting->title = $part->area->name . ' ' . $part->part .' background color'; + $setting->save(); + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_color2'; + $setting->value = gfx()['primary']; + $setting->type = 'COLOR'; + $setting->data = json_encode(['name' => 'author-slider-color2']); + $setting->size = 6; + $setting->title = $part->area->name . ' ' . $part->part .'content background color'; + $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.'_group')->first()?->delete(); + Setting::where('key',$part->area->name . '_' . $part->part.'_color')->first()?->delete(); + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/index/AuthorSlider/AuthorSlider.scss b/resources/views/segments/index/AuthorSlider/AuthorSlider.scss new file mode 100644 index 0000000..2965bee --- /dev/null +++ b/resources/views/segments/index/AuthorSlider/AuthorSlider.scss @@ -0,0 +1,55 @@ +.AuthorSlider { + padding: 3rem 0; + background: var(--author-slider-color); + color: var(--xshop-diff); + + #slider-author-container{ + position: relative; + .item{ + position: relative; + } + + .sld-btn{ + position: absolute; + top: 47%; + cursor: pointer; + i{ + font-size: 35px; + } + } + + #auth-nxt{ + right: -45px; + } + #auth-prv{ + left: -45px; + } + + } + .author-slide{ + + img{ + width: 400px; + height: 600px; + object-fit: cover; + border-radius: var(--xshop-border-radius); + } + + .contents{ + background: var(--author-slider-color2); + width: 65%; + inset-inline-end: 350px; + padding: 2rem; + + + + position: absolute; + top: 35%; + border-radius: var(--xshop-border-radius); + h3,p{ + color: var(--xshop-diff) !important; + margin-bottom: 1rem; + } + } + } +} diff --git a/resources/views/segments/index/AuthorSlider/screenshot.png b/resources/views/segments/index/AuthorSlider/screenshot.png new file mode 100644 index 0000000..68849b5 Binary files /dev/null and b/resources/views/segments/index/AuthorSlider/screenshot.png differ