mirror of https://github.com/4xmen/xshop.git
parent
43f8e35d3c
commit
fbd2c43f0b
@ -0,0 +1,26 @@
|
||||
<section class='MainCategoriesIcon'>
|
||||
<div class="{{gfx()['container']}}">
|
||||
<h1 class="text-center">
|
||||
{{getSetting($part->area_name . '_' . $part->part.'_title')}}
|
||||
</h1>
|
||||
<div class="cat-icon-box">
|
||||
<div class="row">
|
||||
@foreach(getMainCategory(getSetting($part->area_name . '_' . $part->part.'_limit')) as $category)
|
||||
<div class="col-md">
|
||||
<div class=" l-box">
|
||||
<a class="main-category" href="{{$category->webUrl()}}">
|
||||
<img src="{{$category->svgUrl()}}" alt="{{$category->name}}"
|
||||
title="{{$category->name}}">
|
||||
</a>
|
||||
</div>
|
||||
<a class="main-category" href="{{$category->webUrl()}}">
|
||||
<h4>
|
||||
{{$category->name}}
|
||||
</h4>
|
||||
</a>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
@ -0,0 +1,10 @@
|
||||
{
|
||||
"name": "MainCategoriesIcon",
|
||||
"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": []
|
||||
}
|
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Resources\Views\Segments;
|
||||
|
||||
use App\Models\Part;
|
||||
use App\Models\Setting;
|
||||
|
||||
class MainCategoriesIcon
|
||||
{
|
||||
public static function onAdd(Part $part = null)
|
||||
{
|
||||
|
||||
$setting = new Setting();
|
||||
$setting->section = 'theme';
|
||||
$setting->key = $part->area_name . '_' . $part->part.'_bg';
|
||||
$setting->value = '#ffffff';
|
||||
$setting->type = 'COLOR';
|
||||
$setting->data = json_encode(['name' => 'cat-icon-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.'_box';
|
||||
$setting->value = gfx()['primary'];
|
||||
$setting->type = 'COLOR';
|
||||
$setting->data = json_encode(['name' => 'cat-icon-box']);
|
||||
$setting->size = 4;
|
||||
$setting->title = $part->area_name . ' ' . $part->part .' box color';
|
||||
$setting->save();
|
||||
|
||||
$setting = new Setting();
|
||||
$setting->section = 'theme';
|
||||
$setting->key = $part->area_name . '_' . $part->part.'_text';
|
||||
$setting->value = '#ffffff';
|
||||
$setting->type = 'COLOR';
|
||||
$setting->data = json_encode(['name' => 'cat-icon-text']);
|
||||
$setting->size =4;
|
||||
$setting->title = $part->area_name . ' ' . $part->part .' text color';
|
||||
$setting->save();
|
||||
|
||||
$setting = new Setting();
|
||||
$setting->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.'_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();
|
||||
|
||||
}
|
||||
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.'_limit')->first()?->delete();
|
||||
Setting::where('key',$part->area_name . '_' . $part->part.'_bg')->first()?->delete();
|
||||
Setting::where('key',$part->area_name . '_' . $part->part.'_box')->first()?->delete();
|
||||
Setting::where('key',$part->area_name . '_' . $part->part.'_text')->first()?->delete();
|
||||
}
|
||||
public static function onMount(Part $part = null)
|
||||
{
|
||||
return $part;
|
||||
}
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
.MainCategoriesIcon {
|
||||
// scss
|
||||
padding: 4rem;
|
||||
background: var(--cat-icon-bg);
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
h1 {
|
||||
position: absolute;
|
||||
left: 2rem;
|
||||
top: 1rem;
|
||||
transform: rotateZ(-90deg);
|
||||
white-space: nowrap;
|
||||
font-size: 22px;
|
||||
text-align: center;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.cat-icon-box {
|
||||
background: var(--cat-icon-box);
|
||||
padding: 1rem;
|
||||
border-radius: var(--xshop-border-radius);
|
||||
|
||||
.row {
|
||||
margin: 1rem;
|
||||
}
|
||||
|
||||
.l-box {
|
||||
border-radius: var(--xshop-border-radius);
|
||||
margin: 1rem;
|
||||
background: var(--cat-icon-bg);
|
||||
text-align: center;
|
||||
|
||||
|
||||
img {
|
||||
max-width: 70%;
|
||||
margin: 1rem 0;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
h4 {
|
||||
padding: 1rem 0 0 0;
|
||||
font-size: 20px;
|
||||
font-weight: 300;
|
||||
color: var(--cat-icon-text) !important;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 64 KiB |
Loading…
Reference in New Issue