diff --git a/resources/sass/client-custom/_general.scss b/resources/sass/client-custom/_general.scss index 0a43387..e52ae6e 100644 --- a/resources/sass/client-custom/_general.scss +++ b/resources/sass/client-custom/_general.scss @@ -19,7 +19,11 @@ } *{ - font-family: 'Vazirmatn' , Sans-Serif; + font-family: 'Vazirmatn' , sans-serif; +} + +html { + scroll-behavior: smooth; } body{ diff --git a/resources/views/segments/compare/CompareProducts/CompareProducts.php b/resources/views/segments/compare/CompareProducts/CompareProducts.php index a00caa7..e10912b 100644 --- a/resources/views/segments/compare/CompareProducts/CompareProducts.php +++ b/resources/views/segments/compare/CompareProducts/CompareProducts.php @@ -3,15 +3,26 @@ namespace Resources\Views\Segments; use App\Models\Part; +use App\Models\Setting; class CompareProducts { public static function onAdd(Part $part = null) { + $setting = new Setting(); + $setting->section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_color'; + $setting->value = '#ffffff'; + $setting->type = 'COLOR'; + $setting->data = json_encode(['name' => 'compare-bg']); + $setting->size = 12; + $setting->title = $part->area->name . ' ' . $part->part .' main color'; + $setting->save(); } public static function onRemove(Part $part = null) { + Setting::where('key',$part->area->name . '_' . $part->part.'_color')->first()?->delete(); } public static function onMount(Part $part = null) diff --git a/resources/views/segments/compare/CompareProducts/CompareProducts.scss b/resources/views/segments/compare/CompareProducts/CompareProducts.scss index 915a585..c7fe41e 100644 --- a/resources/views/segments/compare/CompareProducts/CompareProducts.scss +++ b/resources/views/segments/compare/CompareProducts/CompareProducts.scss @@ -7,7 +7,7 @@ } .compare{ - background: #ffffff; + background: var(--compare-bg); border-radius: var(--xshop-border-radius); h2{ font-weight: 300; diff --git a/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.blade.php b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.blade.php new file mode 100644 index 0000000..a7b36fc --- /dev/null +++ b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.blade.php @@ -0,0 +1,3 @@ + + + diff --git a/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.js b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.js new file mode 100644 index 0000000..2519ac9 --- /dev/null +++ b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.js @@ -0,0 +1,8 @@ +const scrollBreakpoint = window.innerHeight * 0.2; +window.addEventListener('scroll',function () { + if (window.scrollY > scrollBreakpoint){ + document.querySelector('#SimpleGoTop').classList.add('show') + }else{ + document.querySelector('#SimpleGoTop').classList.remove('show') + } +}); diff --git a/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.json b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.json new file mode 100644 index 0000000..cd21ce1 --- /dev/null +++ b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.json @@ -0,0 +1,10 @@ +{ + "name": "SimpleGoTop", + "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/floats/SimpleGoTop/SimpleGoTop.php b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.php new file mode 100644 index 0000000..53bbdba --- /dev/null +++ b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.php @@ -0,0 +1,31 @@ +section = 'theme'; + $setting->key = $part->area->name . '_' . $part->part.'_icon'; + $setting->value = 'ri-arrow-up-line'; + $setting->size = 12; + $setting->type = 'ICON'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 6]); + $setting->title = $part->area->name . ' ' . $part->part. ' icon '; + $setting->save(); + } + public static function onRemove(Part $part = null) + { + Setting::where('key',$part->area->name . '_' . $part->part.'_icon')->first()?->delete(); + + } + public static function onMount(Part $part = null) + { + return $part; + } +} diff --git a/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.scss b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.scss new file mode 100644 index 0000000..68df728 --- /dev/null +++ b/resources/views/segments/floats/SimpleGoTop/SimpleGoTop.scss @@ -0,0 +1,24 @@ +#SimpleGoTop { + position: fixed; + bottom: 1rem; + inset-inline-start: -100px; + z-index: 999; + background: var(--xshop-primary); + width: 50px; + border-radius: var(--xshop-border-radius); + text-align: center; + opacity: .5; + transition: 400ms; + i{ + color: var(--xshop-diff); + font-size: 35px; + } + + &:hover{ + opacity: 1; + } + + &.show{ + inset-inline-start: 1rem; + } +} diff --git a/resources/views/segments/floats/SimpleGoTop/screenshot.png b/resources/views/segments/floats/SimpleGoTop/screenshot.png new file mode 100644 index 0000000..e5ade13 Binary files /dev/null and b/resources/views/segments/floats/SimpleGoTop/screenshot.png differ diff --git a/resources/views/website/inc/website-head.blade.php b/resources/views/website/inc/website-head.blade.php index 5255cd4..8ad5285 100644 --- a/resources/views/website/inc/website-head.blade.php +++ b/resources/views/website/inc/website-head.blade.php @@ -30,4 +30,7 @@ @endif
- +@foreach(getParts('floats') as $part) + @php($p = $part->getBladeWithData()) + @include($p['blade'],['data' => $p['data']]) +@endforeach