diff --git a/resources/views/segments/default-assets/mask-post-modern.svg b/resources/views/segments/default-assets/mask-post-modern.svg new file mode 100644 index 0000000..026db2c --- /dev/null +++ b/resources/views/segments/default-assets/mask-post-modern.svg @@ -0,0 +1,42 @@ + + + + diff --git a/resources/views/segments/posts/PostModernPosts/PostModernPosts.blade.php b/resources/views/segments/posts/PostModernPosts/PostModernPosts.blade.php new file mode 100644 index 0000000..5923b58 --- /dev/null +++ b/resources/views/segments/posts/PostModernPosts/PostModernPosts.blade.php @@ -0,0 +1,25 @@ +
+
+

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

+ +
+ + @foreach( getGroupPostsBySetting($data->area_name.'_'.$data->part.'_group',4) as $post ) + + + @endforeach +
+
+
diff --git a/resources/views/segments/posts/PostModernPosts/PostModernPosts.js b/resources/views/segments/posts/PostModernPosts/PostModernPosts.js new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/segments/posts/PostModernPosts/PostModernPosts.json b/resources/views/segments/posts/PostModernPosts/PostModernPosts.json new file mode 100644 index 0000000..fe11883 --- /dev/null +++ b/resources/views/segments/posts/PostModernPosts/PostModernPosts.json @@ -0,0 +1,10 @@ +{ + "name": "PostModernPosts", + "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/PostModernPosts/PostModernPosts.php b/resources/views/segments/posts/PostModernPosts/PostModernPosts.php new file mode 100644 index 0000000..93dc977 --- /dev/null +++ b/resources/views/segments/posts/PostModernPosts/PostModernPosts.php @@ -0,0 +1,73 @@ +section = 'theme'; + $setting->key = $part->area_name . '_' . $part->part.'_title'; + $setting->value = __("Hello world"); + $setting->size = 12; + $setting->type = 'TEXT'; +// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]); + $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 = 4; + $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.'_bg'; + $setting->value = '#eeeeee'; + $setting->type = 'COLOR'; + $setting->data = json_encode(['name' => 'post-modern-bg']); + $setting->size = 4; + $setting->title = $part->area_name . ' ' . $part->part .' background color'; + $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' => 'post-modern-color']); + $setting->size = 4; + $setting->title = $part->area_name . ' ' . $part->part .' text color'; + $setting->save(); + + File::copy(__DIR__.'/../../default-assets/mask-post-modern.svg',public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg'); + } + 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.'_title')->first()?->delete(); + Setting::where('key',$part->area_name . '_' . $part->part.'_bg')->first()?->delete(); + Setting::where('key',$part->area_name . '_' . $part->part.'_color')->first()?->delete(); + + } + public static function onMount(Part $part = null) + { + $data = file_get_contents(public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg'); + $data = str_replace('fill:#eeeeee','fill:'.getSetting($part->area_name.'_'.$part->part.'_bg'),$data); + file_put_contents(public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg',$data); + return $part; + } +} diff --git a/resources/views/segments/posts/PostModernPosts/PostModernPosts.scss b/resources/views/segments/posts/PostModernPosts/PostModernPosts.scss new file mode 100644 index 0000000..e4c91bd --- /dev/null +++ b/resources/views/segments/posts/PostModernPosts/PostModernPosts.scss @@ -0,0 +1,21 @@ +.PostModernPosts { + // scss + h1{ + font-size: 34px; + font-weight: 300; + text-align: center; + } + background: var(--post-modern-bg); + padding: 4rem 0; + .post-modern-post{ + + } + h4{ + background: var(--post-modern-bg); + padding: 1rem; + margin-top: -3px; + text-align: center; + color: var(--post-modern-color); + } + +} diff --git a/resources/views/segments/posts/PostModernPosts/screenshot.png b/resources/views/segments/posts/PostModernPosts/screenshot.png new file mode 100644 index 0000000..f18fd47 Binary files /dev/null and b/resources/views/segments/posts/PostModernPosts/screenshot.png differ