Merge branch '4xmen:master' into master

pull/45/head
Ali 4 months ago committed by GitHub
commit 18a2c89294
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -747,7 +747,7 @@ function getSettingsGroup($group)
$result = [];
foreach (Setting::where('key', 'LIKE', $group . '%')
->whereNotNull('value')->get(['key', 'value']) as $r) {
if ($r->value != null) {
if ($r->value != null && $r->value != '') {
$result[substr($r->key, mb_strlen($group))] = $r->value;
}
}
@ -802,25 +802,27 @@ function getMenuBySetting($key)
/**
* get group's posts by setting key
* @param $key
* @param $limit
* @param integer $limit
* @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C
*/
function getGroupPostsBySetting($key, $limit = 10)
function getGroupPostsBySetting($key, $limit = 10, $order = 'id', $dir = "DESC")
{
return Group::where('id', getSetting($key) ?? 1)->first()
->posts()->where('status', 1)->limit($limit)->get();
->posts()->where('status', 1)->orderBy($order, $dir)->limit($limit)->get();
}
/**
* get group's posts by setting key
* @param $key
* @param $limit
* @param integer $limit
* @param string $order
* @param string $dir
* @return \App\Models\Post[]|\Illuminate\Database\Eloquent\Collection|\LaravelIdea\Helper\App\Models\_IH_Post_C
*/
function getCategoryProductBySetting($key, $limit = 10)
function getCategoryProductBySetting($key, $limit = 10, $order = 'id', $dir = "DESC")
{
return Category::where('id', getSetting($key) ?? 1)->first()
->products()->where('status', 1)->limit($limit)->get();
->products()->where('status', 1)->orderBy($order, $dir)->limit($limit)->get();
}
/**

@ -22,14 +22,16 @@ class AreaController extends Controller
$valids = [];
foreach ($area->segment as $seg) {
$dirs = File::directories(resource_path() . '/views/segments/' . $seg);
foreach ($dirs as $dir) {
$temp = explode('/', $dir);
$valids[] = [
'segment' => $temp[count($temp) - 2],
'part' => $temp[count($temp) - 1],
'data' => json_decode(file_get_contents($dir . '/' . $temp[count($temp) - 1] . '.json'), true)
];
if (File::exists(resource_path() . '/views/segments/' . $seg)) {
$dirs = File::directories(resource_path() . '/views/segments/' . $seg);
foreach ($dirs as $dir) {
$temp = explode('/', $dir);
$valids[] = [
'segment' => $temp[count($temp) - 2],
'part' => $temp[count($temp) - 1],
'data' => json_decode(file_get_contents($dir . '/' . $temp[count($temp) - 1] . '.json'), true)
];
}
}
}
@ -50,12 +52,12 @@ class AreaController extends Controller
public function update(Request $request, Area $area)
{
// return $request->all();
foreach ($request->input('parts',[]) as $i => $item) {
foreach ($request->input('parts', []) as $i => $item) {
$data = json_decode($item);
if ($data == null){
if ($data == null) {
continue;
}
if ($data->id == null){
if ($data->id == null) {
// create
$part = new Part();
$part->area_id = $area->id;
@ -63,7 +65,7 @@ class AreaController extends Controller
$part->part = $data->part;
$part->sort = $i;
$part->save();
}else{
} else {
$part = Part::whereId($data->id)->first();
$part->segment = $data->segment;
$part->part = $data->part;
@ -71,29 +73,31 @@ class AreaController extends Controller
$part->save();
}
}
foreach ( json_decode($request->input('removed')) as $id){
Part::where('id',$id)->first()->delete();
foreach (json_decode($request->input('removed')) as $id) {
Part::where('id', $id)->first()->delete();
}
\Artisan::call('client');
logAdmin(__METHOD__,__CLASS__,$area->id);
logAdmin(__METHOD__, __CLASS__, $area->id);
return redirect()->back()->with(['message' => __('area :NAME of website updated',['NAME' => $area->name])]);
return redirect()->back()->with(['message' => __('area :NAME of website updated', ['NAME' => $area->name])]);
}
public function sort(Area $area){
return view('admin.areas.area-sort',compact('area'));
public function sort(Area $area)
{
return view('admin.areas.area-sort', compact('area'));
}
public function sortSave(Request $request){
foreach ($request->input('items') as $key => $v){
public function sortSave(Request $request)
{
foreach ($request->input('items') as $key => $v) {
$p = Part::whereId($v['id'])->first();
$p->sort = $key;
$p->save();
}
logAdmin(__METHOD__,__CLASS__,$p->area_id);
return ['OK' => true,'message' => __("As you wished sort saved")];
logAdmin(__METHOD__, __CLASS__, $p->area_id);
return ['OK' => true, 'message' => __("As you wished sort saved")];
}
}

@ -16,10 +16,10 @@ class CkeditorController extends Controller
$extension = $request->file('upload')->getClientOriginalExtension();
$fileName = $fileName . '_' . time() . '.' . $extension;
$request->file('upload')->move(public_path('images'), $fileName);
$request->file('upload')->move(public_path('upload/images'), $fileName);
$CKEditorFuncNum = $request->input('CKEditorFuncNum');
$url = asset('images/' . $fileName);
$url = asset('/upload/images/' . $fileName);
$msg = __('Image uploaded successfully');
$response = "<script>window.parent.CKEDITOR.tools.callFunction($CKEditorFuncNum, '$url', '$msg')</script>";

@ -19,7 +19,7 @@ class ProductController extends XController
// protected $_MODEL_ = Product::class;
// protected $SAVE_REQUEST = ProductSaveRequest::class;
protected $cols = ['name','category_id','view','sell'];
protected $cols = ['name','category_id','view','sell','status'];
protected $extra_cols = ['id','slug','image_index'];
protected $searchable = ['name','slug','description','excerpt','sku','table'];
@ -170,6 +170,14 @@ class ProductController extends XController
}
break;
/*restore**/
case 'publish':
$this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 1]);
$msg = __(':COUNT items published successfully', ['COUNT' => count($ids)]);
break;
case 'draft':
$this->_MODEL_::whereIn('id', $request->input('id'))->update(['status' => 0]);
$msg = __(':COUNT items drafted successfully', ['COUNT' => count($ids)]);
break;
default:
$msg = __('Unknown bulk action : :ACTION', ["ACTION" => $action]);
}

@ -74,7 +74,7 @@ class Post extends Model implements HasMedia
public function orgUrl()
{
if ($this->getMedia()->count() > 0) {
return $this->getMedia()[$this->image_index]->getUrl();
return $this->getMedia()->first()->getUrl();
} else {
return asset('assets/upload/logo.svg');

@ -272,4 +272,8 @@ class Product extends Model implements HasMedia
return route('');
}
public function getPrice(){
return number_format($this->price);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

@ -28,7 +28,7 @@ a,a:visited{
}
.btn-primary{
background: var(--xshop-primary);
border-color: var(--xshop-secondary);
border-color: var(--xshop-primary);
color: var(--xshop-diff) !important;
&:hover{

@ -100,7 +100,7 @@ a.btn,a.action-btn,a.circle-btn{
.status-0,.status-CLOSED {
background: red;
}
.status-ANSWERED{
.status-1,.status-ANSWERED{
background: lime;
}
.status-PENDING{

@ -0,0 +1,317 @@
<footer class='FireFooter'>
<div class="footer">
<div class="bubbles">
<div class="bubble"
style="--size:3.283778460829012rem; --distance:8.273995682244763rem; --position:80.43121961838831%; --time:3.370470516561046s; --delay:-2.4460750377075677s;"></div>
<div class="bubble"
style="--size:5.048775832023261rem; --distance:8.209048016743958rem; --position:81.24435161533792%; --time:2.689387587750886s; --delay:-3.178866630821537s;"></div>
<div class="bubble"
style="--size:2.8917775001193196rem; --distance:8.454264258769582rem; --position:-1.892480833658683%; --time:2.870417823317806s; --delay:-3.8694363898657054s;"></div>
<div class="bubble"
style="--size:2.98950564759547rem; --distance:6.810598321237242rem; --position:100.02057873419844%; --time:2.2412476180211125s; --delay:-3.9669609230968366s;"></div>
<div class="bubble"
style="--size:3.056008172581711rem; --distance:7.571228915589839rem; --position:101.36290426526402%; --time:3.556279976104421s; --delay:-2.601994631532017s;"></div>
<div class="bubble"
style="--size:3.22671020910027rem; --distance:8.977876061761204rem; --position:69.44795371340336%; --time:2.0813687087410555s; --delay:-2.561126203255737s;"></div>
<div class="bubble"
style="--size:5.983498430412179rem; --distance:9.55217569034621rem; --position:33.97699243298395%; --time:2.766369309258826s; --delay:-2.306807070885999s;"></div>
<div class="bubble"
style="--size:3.7130270767886904rem; --distance:9.15367913841726rem; --position:36.78355273882992%; --time:3.4415953312360266s; --delay:-2.8423432581270194s;"></div>
<div class="bubble"
style="--size:2.0830849819394457rem; --distance:6.408202865389665rem; --position:-3.7304088146057324%; --time:2.1324701384850853s; --delay:-3.6594998300237567s;"></div>
<div class="bubble"
style="--size:2.846429800070382rem; --distance:9.850031890259043rem; --position:63.51703893124248%; --time:2.48611792099451s; --delay:-3.957713451098727s;"></div>
<div class="bubble"
style="--size:2.0204852928911228rem; --distance:7.706337256219967rem; --position:10.659889096699736%; --time:3.8878533177786547s; --delay:-2.7460423807313834s;"></div>
<div class="bubble"
style="--size:5.148489190934578rem; --distance:7.8185867715909385rem; --position:44.27428830609239%; --time:3.0912972813262374s; --delay:-2.4548184305462204s;"></div>
<div class="bubble"
style="--size:3.1179981047008507rem; --distance:8.217674226182545rem; --position:-0.8434243039321725%; --time:3.893070336584621s; --delay:-3.482134608090908s;"></div>
<div class="bubble"
style="--size:3.073022863441822rem; --distance:6.748615665272697rem; --position:17.187709593603337%; --time:2.869641888050805s; --delay:-3.011358944260785s;"></div>
<div class="bubble"
style="--size:3.040494763665981rem; --distance:6.001078493795163rem; --position:30.428225670705793%; --time:2.1274023672313547s; --delay:-2.269450277325624s;"></div>
<div class="bubble"
style="--size:2.4934683696411932rem; --distance:9.661759778304251rem; --position:38.28385025284947%; --time:3.3066616446050388s; --delay:-3.903278872741094s;"></div>
<div class="bubble"
style="--size:4.341153504409132rem; --distance:8.372204276920996rem; --position:8.925467109327556%; --time:2.961530876031502s; --delay:-3.733657008574247s;"></div>
<div class="bubble"
style="--size:3.017692044104651rem; --distance:7.742406344583268rem; --position:7.135396211953164%; --time:3.9814409149202454s; --delay:-2.769434098028662s;"></div>
<div class="bubble"
style="--size:5.080150296463536rem; --distance:6.090080087294706rem; --position:99.46159986754385%; --time:3.125230884966736s; --delay:-2.415272316183627s;"></div>
<div class="bubble"
style="--size:4.220709880817442rem; --distance:6.273886998189256rem; --position:97.58004171875584%; --time:3.1349176005189006s; --delay:-3.9274262276392298s;"></div>
<div class="bubble"
style="--size:3.567041880882358rem; --distance:6.32323480828306rem; --position:92.70135681477952%; --time:2.1362733605721504s; --delay:-3.1505418730279633s;"></div>
<div class="bubble"
style="--size:3.5907802134353792rem; --distance:9.870786669090203rem; --position:98.38043362003364%; --time:2.365772524802981s; --delay:-3.155876947312736s;"></div>
<div class="bubble"
style="--size:3.153202036251672rem; --distance:8.019938162492018rem; --position:17.19668721036048%; --time:3.6277311767623384s; --delay:-3.1876739225876354s;"></div>
<div class="bubble"
style="--size:3.4877396066133333rem; --distance:8.270634812076594rem; --position:10.484445181872442%; --time:3.0775952904576176s; --delay:-2.2907439552389293s;"></div>
<div class="bubble"
style="--size:5.766665156529646rem; --distance:9.899439420013206rem; --position:3.2576122174816096%; --time:2.846254474445945s; --delay:-2.0209311226219087s;"></div>
<div class="bubble"
style="--size:5.239738288627671rem; --distance:8.364557911980619rem; --position:87.23110357446504%; --time:2.1930097960461055s; --delay:-3.0322261546336517s;"></div>
<div class="bubble"
style="--size:2.1990673841700143rem; --distance:7.720521403005255rem; --position:-0.17107184177207468%; --time:2.5997240933430965s; --delay:-2.07586605687868s;"></div>
<div class="bubble"
style="--size:2.096379882401747rem; --distance:8.369893834364031rem; --position:32.32516475439321%; --time:3.695249819707472s; --delay:-3.851082655427779s;"></div>
<div class="bubble"
style="--size:3.638390237165721rem; --distance:9.7664220131003rem; --position:87.38200354757375%; --time:3.862542578562428s; --delay:-2.9797900374453823s;"></div>
<div class="bubble"
style="--size:2.014227665781494rem; --distance:9.475179023878415rem; --position:18.072465784612906%; --time:2.876721765742051s; --delay:-3.456765174855402s;"></div>
<div class="bubble"
style="--size:4.835622070747298rem; --distance:6.646442484712818rem; --position:42.56200483263158%; --time:2.4201735129167705s; --delay:-2.129697393514734s;"></div>
<div class="bubble"
style="--size:2.6544780967758683rem; --distance:9.993914974673478rem; --position:47.41484229787173%; --time:2.6928887058432203s; --delay:-3.6501705520332406s;"></div>
<div class="bubble"
style="--size:2.1810138227712246rem; --distance:8.625390262659332rem; --position:79.91382406364768%; --time:3.0571539204415643s; --delay:-2.879575299430147s;"></div>
<div class="bubble"
style="--size:3.9602029523135043rem; --distance:8.811978694178176rem; --position:22.085129474405363%; --time:2.3040885125074015s; --delay:-3.9822714071472305s;"></div>
<div class="bubble"
style="--size:3.2601731045983255rem; --distance:6.551449087150881rem; --position:56.03044260678546%; --time:3.377917555269709s; --delay:-2.248689205859968s;"></div>
<div class="bubble"
style="--size:4.724989417802013rem; --distance:8.126549828172152rem; --position:83.76957059823852%; --time:2.8347659523990463s; --delay:-2.4045807342328174s;"></div>
<div class="bubble"
style="--size:2.4601556144465766rem; --distance:6.451551054345049rem; --position:77.04823997553098%; --time:2.466260099531937s; --delay:-3.8444152858910203s;"></div>
<div class="bubble"
style="--size:3.5005873287032445rem; --distance:7.9251184298861475rem; --position:-1.7530963025931068%; --time:2.5654285446675242s; --delay:-3.719663280805641s;"></div>
<div class="bubble"
style="--size:3.287577998169491rem; --distance:9.297377061416393rem; --position:18.741671727246466%; --time:3.341885163952444s; --delay:-2.5715436541146115s;"></div>
<div class="bubble"
style="--size:5.221728885270182rem; --distance:9.286314646321468rem; --position:42.28149761730227%; --time:3.389657748614331s; --delay:-2.961540852653576s;"></div>
<div class="bubble"
style="--size:2.818746087299467rem; --distance:6.526311604034215rem; --position:8.32284386562167%; --time:3.533110613536286s; --delay:-3.4929316976539795s;"></div>
<div class="bubble"
style="--size:3.9555668943551874rem; --distance:7.587517096965727rem; --position:86.98518380989474%; --time:3.8328433866272116s; --delay:-3.947314208169883s;"></div>
<div class="bubble"
style="--size:5.86344809196979rem; --distance:6.715459413428028rem; --position:93.51712672911347%; --time:3.3194895688568025s; --delay:-2.814996993119309s;"></div>
<div class="bubble"
style="--size:4.659085472309417rem; --distance:6.833049757751052rem; --position:18.34331186924404%; --time:2.1401803669951542s; --delay:-3.281758431062622s;"></div>
<div class="bubble"
style="--size:5.647514992520861rem; --distance:6.166187896878902rem; --position:103.56058520261233%; --time:2.7109824838325496s; --delay:-3.5641804780474113s;"></div>
<div class="bubble"
style="--size:3.4116906103373514rem; --distance:9.87448520511619rem; --position:60.40367758628962%; --time:3.211959351671091s; --delay:-3.909483663267988s;"></div>
<div class="bubble"
style="--size:4.358059871263618rem; --distance:6.192241875091202rem; --position:55.79560282838993%; --time:3.522040191932956s; --delay:-2.4451874413830073s;"></div>
<div class="bubble"
style="--size:5.657469779677323rem; --distance:8.59153006822326rem; --position:72.97116848710832%; --time:3.2281152136729996s; --delay:-2.6942268466639807s;"></div>
<div class="bubble"
style="--size:5.36401084558097rem; --distance:8.032035852980673rem; --position:68.03498132267576%; --time:3.6949889538863347s; --delay:-3.5310246226914868s;"></div>
<div class="bubble"
style="--size:5.57833766575319rem; --distance:7.499254928961794rem; --position:94.12393327236666%; --time:3.4806354090355405s; --delay:-2.274765603356683s;"></div>
<div class="bubble"
style="--size:3.2806309747640574rem; --distance:8.488379921065523rem; --position:48.78983463936292%; --time:2.877531426246132s; --delay:-2.096852780408325s;"></div>
<div class="bubble"
style="--size:2.5739678385733678rem; --distance:8.917657906310211rem; --position:36.30111446297418%; --time:2.132094571645426s; --delay:-2.300338825704596s;"></div>
<div class="bubble"
style="--size:3.193905105705725rem; --distance:6.837855040140766rem; --position:77.42883266635026%; --time:2.6764254242868546s; --delay:-2.6117600566315358s;"></div>
<div class="bubble"
style="--size:2.921396795915677rem; --distance:6.017635087648889rem; --position:64.47566942541235%; --time:2.1329836115090024s; --delay:-2.9493514981070006s;"></div>
<div class="bubble"
style="--size:5.996546073399244rem; --distance:8.438210536324492rem; --position:13.268370807153438%; --time:3.6359501852961262s; --delay:-3.9647431379196347s;"></div>
<div class="bubble"
style="--size:3.6759907032328405rem; --distance:8.418483277724492rem; --position:32.34008573798657%; --time:2.4480223557558345s; --delay:-2.0329066324347824s;"></div>
<div class="bubble"
style="--size:4.1642001716890285rem; --distance:7.292867116703618rem; --position:53.7639790538517%; --time:3.502488399088864s; --delay:-2.498372665932038s;"></div>
<div class="bubble"
style="--size:4.787565853418627rem; --distance:7.002471829807719rem; --position:71.91523290439147%; --time:2.958165535287203s; --delay:-3.874622142256656s;"></div>
<div class="bubble"
style="--size:2.518311359883132rem; --distance:7.986066195679516rem; --position:64.83491880651033%; --time:2.799838241177398s; --delay:-2.605045923573953s;"></div>
<div class="bubble"
style="--size:2.876971757413453rem; --distance:6.068564148976618rem; --position:11.865157104893097%; --time:2.827771256360732s; --delay:-2.39512359755763s;"></div>
<div class="bubble"
style="--size:2.104732688202529rem; --distance:7.730020214979188rem; --position:89.79694218565386%; --time:3.463311919402186s; --delay:-3.12192390140452s;"></div>
<div class="bubble"
style="--size:3.3360664273276166rem; --distance:7.983397791094809rem; --position:68.65578472758347%; --time:3.9335303632278293s; --delay:-3.4294180673320884s;"></div>
<div class="bubble"
style="--size:3.9727817769810656rem; --distance:9.566771590971191rem; --position:8.31120576187265%; --time:2.205225438795449s; --delay:-3.324358147783013s;"></div>
<div class="bubble"
style="--size:2.785922768617306rem; --distance:7.082254824315727rem; --position:28.396955159650958%; --time:2.942223891965728s; --delay:-2.5935628505954393s;"></div>
<div class="bubble"
style="--size:4.2464496070749rem; --distance:6.691569284526946rem; --position:42.54917838169232%; --time:3.127523856909967s; --delay:-2.954291705842826s;"></div>
<div class="bubble"
style="--size:5.723073490329043rem; --distance:9.090319785576288rem; --position:-3.3796480533643103%; --time:2.2633471262800557s; --delay:-3.2578755649237174s;"></div>
<div class="bubble"
style="--size:3.219530490661871rem; --distance:7.4797090026341495rem; --position:101.94887397738762%; --time:2.1036948366679686s; --delay:-2.751593490682857s;"></div>
<div class="bubble"
style="--size:2.1814720163593524rem; --distance:6.396504615967695rem; --position:50.89372542693971%; --time:2.582017377993537s; --delay:-2.906294282914755s;"></div>
<div class="bubble"
style="--size:5.809553529495087rem; --distance:7.464097429978566rem; --position:90.38559551607041%; --time:3.7652915434285816s; --delay:-2.354212300265661s;"></div>
<div class="bubble"
style="--size:3.62120707963538rem; --distance:9.076979425692606rem; --position:11.150253759803633%; --time:3.0486377247236534s; --delay:-2.8041488577211697s;"></div>
<div class="bubble"
style="--size:5.00310856270532rem; --distance:9.170735560719102rem; --position:64.58179397075584%; --time:3.7656580293692796s; --delay:-2.893674658194128s;"></div>
<div class="bubble"
style="--size:2.709501141760601rem; --distance:7.8373914558643705rem; --position:5.674632497742465%; --time:3.395681112908417s; --delay:-2.2649544585446963s;"></div>
<div class="bubble"
style="--size:5.863530345348175rem; --distance:6.010688703517391rem; --position:8.068803588662359%; --time:3.027313856154054s; --delay:-2.231948018674604s;"></div>
<div class="bubble"
style="--size:3.184680382015328rem; --distance:8.878536191481098rem; --position:8.386217564803701%; --time:3.9938236104040246s; --delay:-3.582227746566318s;"></div>
<div class="bubble"
style="--size:5.634096080720658rem; --distance:9.852119364968344rem; --position:1.083944673937438%; --time:2.332288460957819s; --delay:-2.8850298727934875s;"></div>
<div class="bubble"
style="--size:3.4014949844199958rem; --distance:8.171860996672919rem; --position:84.2657700109125%; --time:2.2494226346466255s; --delay:-2.5677067273975007s;"></div>
<div class="bubble"
style="--size:3.25901366738288rem; --distance:7.677629208945115rem; --position:51.318943432823694%; --time:2.8086005653923443s; --delay:-3.8858374739056676s;"></div>
<div class="bubble"
style="--size:2.738787520059482rem; --distance:7.215369023176211rem; --position:56.250543764215685%; --time:3.976054489308197s; --delay:-2.326983298866254s;"></div>
<div class="bubble"
style="--size:2.2159404026193075rem; --distance:6.656577136470761rem; --position:6.693028946147312%; --time:2.864055961058856s; --delay:-2.4300716543937217s;"></div>
<div class="bubble"
style="--size:4.21593419511934rem; --distance:8.927963260087107rem; --position:25.147537992688058%; --time:3.009996529717521s; --delay:-3.0238438289524225s;"></div>
<div class="bubble"
style="--size:5.179991621161971rem; --distance:6.3853169980031845rem; --position:102.46036383116052%; --time:2.493617740988301s; --delay:-3.200833645229917s;"></div>
<div class="bubble"
style="--size:5.513584744686991rem; --distance:8.22544620750663rem; --position:101.1452384048811%; --time:3.282739845432842s; --delay:-3.661873228440018s;"></div>
<div class="bubble"
style="--size:3.339183876739143rem; --distance:9.526513756713628rem; --position:29.882131632276284%; --time:2.4931248570889335s; --delay:-2.475593644022913s;"></div>
<div class="bubble"
style="--size:5.572625591150981rem; --distance:7.345648077046019rem; --position:22.8560703003273%; --time:2.7498169626967566s; --delay:-2.17990566059977s;"></div>
<div class="bubble"
style="--size:4.1177605678413265rem; --distance:8.34852219885391rem; --position:29.490529078305904%; --time:3.2706309302541188s; --delay:-3.7771110698550556s;"></div>
<div class="bubble"
style="--size:5.9527591413810015rem; --distance:8.228548797101368rem; --position:86.92141319108892%; --time:2.1195045300057886s; --delay:-2.1550354449961038s;"></div>
<div class="bubble"
style="--size:3.4122434983866006rem; --distance:7.8470984688972765rem; --position:-4.737684816944457%; --time:3.361433469609846s; --delay:-2.7510535260586435s;"></div>
<div class="bubble"
style="--size:3.767163633315376rem; --distance:8.004107269407179rem; --position:58.86574552235167%; --time:2.4584153129693487s; --delay:-3.8899327217598216s;"></div>
<div class="bubble"
style="--size:4.966101867270128rem; --distance:8.096238035862653rem; --position:73.33011876280814%; --time:3.2569085513280767s; --delay:-2.927105754623504s;"></div>
<div class="bubble"
style="--size:5.239318894400097rem; --distance:8.21018133412617rem; --position:49.79329539415349%; --time:2.486417355278126s; --delay:-3.935240915466869s;"></div>
<div class="bubble"
style="--size:2.309860158972202rem; --distance:8.23350401700413rem; --position:52.762390580567924%; --time:3.253681340156047s; --delay:-3.39928187900957s;"></div>
<div class="bubble"
style="--size:5.405641933124867rem; --distance:7.787670658003827rem; --position:55.299301993538734%; --time:2.9254208880312023s; --delay:-3.4035022943444453s;"></div>
<div class="bubble"
style="--size:4.7889435136433365rem; --distance:8.059493307179075rem; --position:6.476650057477524%; --time:2.8831662912305407s; --delay:-2.469760261123794s;"></div>
<div class="bubble"
style="--size:5.202159646625798rem; --distance:6.485068767986836rem; --position:17.188791799414645%; --time:2.5591245696178158s; --delay:-2.547017621074239s;"></div>
<div class="bubble"
style="--size:2.6536622797162357rem; --distance:7.047091090720969rem; --position:99.8065168678203%; --time:3.1358735873884225s; --delay:-2.7674896723499964s;"></div>
<div class="bubble"
style="--size:5.455813017594882rem; --distance:7.92331827436949rem; --position:56.29121034809554%; --time:2.9592446232978804s; --delay:-3.0628319945178304s;"></div>
<div class="bubble"
style="--size:5.376750549059151rem; --distance:7.037706886415796rem; --position:90.43150179415491%; --time:3.4947245448237947s; --delay:-2.7649519449431956s;"></div>
<div class="bubble"
style="--size:3.6759966425104382rem; --distance:9.304354596540962rem; --position:50.078877699643236%; --time:2.364227888914125s; --delay:-2.1049591636942835s;"></div>
<div class="bubble"
style="--size:2.6416988575492812rem; --distance:8.426364301174832rem; --position:34.50261001869937%; --time:3.1489044014899474s; --delay:-2.872308171609069s;"></div>
<div class="bubble"
style="--size:3.039820548413071rem; --distance:7.700594071278777rem; --position:54.369437773201135%; --time:2.3518890849934877s; --delay:-3.816455915222773s;"></div>
<div class="bubble"
style="--size:4.946041332561464rem; --distance:9.940105274558535rem; --position:93.38341839478599%; --time:3.515708411924009s; --delay:-2.139929822750188s;"></div>
<div class="bubble"
style="--size:2.263980751965552rem; --distance:6.845227344107201rem; --position:7.6223749655636635%; --time:3.2543534151869933s; --delay:-3.5968097313692247s;"></div>
<div class="bubble"
style="--size:2.9705072994554786rem; --distance:6.417811696490268rem; --position:0.9010946526242307%; --time:3.869664661904819s; --delay:-2.817867407827982s;"></div>
<div class="bubble"
style="--size:3.7636117769983146rem; --distance:9.28767671082202rem; --position:104.59608438872068%; --time:2.6660045314116205s; --delay:-3.0279672533679767s;"></div>
<div class="bubble"
style="--size:2.534147718025401rem; --distance:9.761714609373762rem; --position:17.47044672925322%; --time:3.8859389327208964s; --delay:-3.3352631179315866s;"></div>
<div class="bubble"
style="--size:5.809103802369521rem; --distance:9.865569439286801rem; --position:15.660853702232227%; --time:2.518863325103205s; --delay:-3.5808886812518383s;"></div>
<div class="bubble"
style="--size:2.4500873479914125rem; --distance:7.274598849994393rem; --position:36.897733125341446%; --time:3.3461286093771387s; --delay:-3.6280095853685674s;"></div>
<div class="bubble"
style="--size:5.773371959699836rem; --distance:8.463136547655406rem; --position:35.06048100391646%; --time:3.209957922113289s; --delay:-3.0079091255606945s;"></div>
<div class="bubble"
style="--size:4.3926522787512265rem; --distance:9.612613676284077rem; --position:22.262054455432867%; --time:2.373303643948798s; --delay:-3.0679725632400907s;"></div>
<div class="bubble"
style="--size:3.952708176353637rem; --distance:9.169495699134323rem; --position:55.04449087079253%; --time:2.7418325241308232s; --delay:-3.3828476409270283s;"></div>
<div class="bubble"
style="--size:3.844775009709453rem; --distance:8.355266723179703rem; --position:3.429889023129533%; --time:3.804465386878591s; --delay:-2.513210465049223s;"></div>
<div class="bubble"
style="--size:2.375822423531286rem; --distance:8.085306102003058rem; --position:51.444859856544134%; --time:3.5291234902803015s; --delay:-3.174879273882913s;"></div>
<div class="bubble"
style="--size:3.987597068631678rem; --distance:6.323842998471056rem; --position:58.472598393140736%; --time:3.6685014540532994s; --delay:-2.125640472580853s;"></div>
<div class="bubble"
style="--size:3.826556536162788rem; --distance:8.093657912781008rem; --position:47.22358687899771%; --time:2.46067661652588s; --delay:-2.795336044113773s;"></div>
<div class="bubble"
style="--size:5.409522304422901rem; --distance:8.08453713835749rem; --position:7.192255114868317%; --time:3.6024864503739416s; --delay:-2.02777453028783s;"></div>
<div class="bubble"
style="--size:2.33220717107433rem; --distance:6.015929004226659rem; --position:69.52801341775708%; --time:3.072171961227187s; --delay:-2.4004690861766145s;"></div>
<div class="bubble"
style="--size:3.1897153674684295rem; --distance:7.970038416707961rem; --position:79.81130078644377%; --time:3.2691207165145544s; --delay:-3.1095874096110614s;"></div>
<div class="bubble"
style="--size:3.043749061825313rem; --distance:9.519971455545065rem; --position:-2.8790650455965716%; --time:2.5921789839789624s; --delay:-3.3392150143930954s;"></div>
<div class="bubble"
style="--size:2.016067925148069rem; --distance:6.601355813566787rem; --position:12.042692941814398%; --time:3.302733338826566s; --delay:-2.666684825220276s;"></div>
<div class="bubble"
style="--size:2.3135489970103658rem; --distance:8.429205824133346rem; --position:10.078502192237377%; --time:3.478083377118066s; --delay:-2.3933149990580658s;"></div>
<div class="bubble"
style="--size:2.3997743557871374rem; --distance:7.408088419264727rem; --position:35.09525576349087%; --time:3.389315536809761s; --delay:-3.7218046643592877s;"></div>
<div class="bubble"
style="--size:5.41080890592663rem; --distance:6.263885540517833rem; --position:88.47970464538236%; --time:3.791977923545102s; --delay:-2.1539409602055803s;"></div>
<div class="bubble"
style="--size:4.187278503726575rem; --distance:8.495185390066428rem; --position:55.2879387519304%; --time:3.8691313236516165s; --delay:-3.7558742796010205s;"></div>
<div class="bubble"
style="--size:5.2260631351390066rem; --distance:6.953165091043609rem; --position:87.01664638966206%; --time:2.2054605348148777s; --delay:-2.0729929853657163s;"></div>
<div class="bubble"
style="--size:3.2309243043140823rem; --distance:8.90242528602417rem; --position:70.6941354974967%; --time:2.420572336985768s; --delay:-3.902986636768033s;"></div>
<div class="bubble"
style="--size:4.416267568041894rem; --distance:8.454455353587463rem; --position:16.18344707827548%; --time:2.6786658712942186s; --delay:-3.7145978779515363s;"></div>
<div class="bubble"
style="--size:5.179842125942596rem; --distance:6.279313089480346rem; --position:51.631946389170714%; --time:2.9215376152158723s; --delay:-3.579196747493768s;"></div>
<div class="bubble"
style="--size:4.298088157115222rem; --distance:8.644044369523485rem; --position:25.709431630582966%; --time:3.9945321241856395s; --delay:-3.6007615466734237s;"></div>
</div>
<div class="content">
<div class="{{gfx()['container']}}">
<div class="row">
<div class="col-md-5">
<h3>
{{config('app.name')}}
</h3>
<p>
{{getSetting($data->area->name.'_'.$data->part.'_text')}}
</p>
</div>
<div class="col-md-5">
<h3>
{{getSetting($data->area->name.'_'.$data->part.'_title2')}}
</h3>
<ul>
@foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',5) as $post )
<li>
<a href="{{$post->webUrl()}}">
{{Str::limit($post->title,40)}}
</a>
</li>
@endforeach
</ul>
</div>
<div class="col-md-2">
{!! getSetting($data->area->name.'_'.$data->part.'_last') !!}
</div>
</div>
</div>
<div class="p2 text-center">
<ul class="social text-center">
@foreach(getSettingsGroup('social_')??[] as $k => $social)
<li class="d-inline-block mx-2">
<a href="{{$social}}">
<i class="ri-{{$k}}-line"></i>
</a>
</li>
@endforeach
</ul>
</div>
<p class="text-center">
{{getSetting('copyright')}}
</p>
</div>
</div>
<svg style="position:fixed; top:100vh">
<defs>
<filter id="blob">
<feGaussianBlur in="SourceGraphic" stdDeviation="10" result="blur"></feGaussianBlur>
<feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 19 -9"
result="blob"></feColorMatrix>
</filter>
</defs>
</svg>
</footer>

@ -0,0 +1,10 @@
{
"name": "FireFooter",
"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,64 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Group;
use App\Models\Part;
use App\Models\Setting;
class FireFooter
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_text';
$setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aliquid consequuntur culpa cupiditate dignissimos dolor doloremque error facilis ipsum iure officia quam qui, tempora! Fuga harum impedit iusto magnam veniam.';
$setting->size = 12;
$setting->type = 'LONGTEXT';
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' main text';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_title2';
$setting->value = 'FAQ';
$setting->size = 6;
$setting->type = 'TEXT';
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' title 2';
$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.'_last';
$setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. Accusamus aliquid consequuntur culpa cupiditate dignissimos dolor doloremque error facilis ipsum iure officia quam qui, tempora! Fuga harum impedit iusto magnam veniam.';
$setting->size = 12;
$setting->title = $part->area->name . ' ' . $part->part. ' last content';
$setting->type = 'EDITOR';
$setting->save();
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area->name . '_' . $part->part.'_text')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_title2')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_group')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_last')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,93 @@
.FireFooter {
overflow: hidden;
padding-top: 7rem;
.footer {
.social{
list-style: none;
i{
font-size: 25px;
}
}
color: var(--xshop-diff);
a,a:visited{
color: var(--xshop-diff);
}
z-index: 1;
--footer-background: var(--xshop-primary);
display: grid;
position: relative;
grid-area: footer;
min-height: 12rem;
.bubbles {
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1rem;
background: var(--xshop-primary);
filter: url("#blob");
.bubble {
position: absolute;
left: var(--position, 50%);
background: var(--xshop-primary);
border-radius: 100%;
//-webkit-animation: bubble-size var(--time, 4s) ease-in infinite var(--delay, 0s), bubble-move var(--time, 4s) ease-in infinite var(--delay, 0s);
animation: bubble-size var(--time, 4s) ease-in infinite var(--delay, 0s), bubble-move var(--time, 4s) ease-in infinite var(--delay, 0s);
transform: translate(-50%, 100%);
}
}
.content {
padding: 6rem 1rem 2rem;
background: var(--xshop-primary);
z-index: 2;
}
}
}
@-webkit-keyframes bubble-size {
0%, 75% {
width: var(--size, 4rem);
height: var(--size, 4rem);
}
100% {
width: 0rem;
height: 0rem;
}
}
@keyframes bubble-size {
0%, 75% {
width: var(--size, 4rem);
height: var(--size, 4rem);
}
100% {
width: 0rem;
height: 0rem;
}
}
@-webkit-keyframes bubble-move {
0% {
bottom: -4rem;
}
100% {
bottom: var(--distance, 10rem);
}
}
@keyframes bubble-move {
0% {
bottom: -4rem;
}
100% {
bottom: var(--distance, 10rem);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

@ -0,0 +1,48 @@
<footer class='WaveFooter'
style="--speed: {{getSetting($data->area->name.'_'.$data->part.'_speed')}}s;
--speed2: {{getSetting($data->area->name.'_'.$data->part.'_speed2')}}s;
--speed3: {{getSetting($data->area->name.'_'.$data->part.'_speed3')}}s">
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
viewBox="0 24 150 28"
preserveAspectRatio="none"
>
<defs>
<path
id="gentle-wave"
d="M-160 44c30 0
58-18 88-18s
58 18 88 18
58-18 88-18
58 18 88 18
v44h-352z"
/>
</defs>
<g class="waves">
<use
xlink:href="#gentle-wave"
x="50"
y="0"
fill-opacity=".2"
/>
<use
xlink:href="#gentle-wave"
x="50"
y="3"
fill-opacity=".5"
/>
<use
xlink:href="#gentle-wave"
x="50"
y="6"
fill-opacity=".9"
/>
</g>
</svg>
<div class="content">
<div class="{{gfx()['container']}}">
{{getSetting('copyright')}} </div>
</div>
</footer>

@ -0,0 +1,10 @@
{
"name": "WaveFooter",
"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,51 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
class WaveFooter
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_speed';
$setting->value = 2;
$setting->size = 4;
$setting->type = 'NUMBER';
$setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' speed wave 1';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_speed2';
$setting->value = 6;
$setting->size = 4;
$setting->type = 'NUMBER';
$setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' speed wave 2';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_speed3';
$setting->value = 4;
$setting->size = 4;
$setting->type = 'NUMBER';
$setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' speed wave 3';
$setting->save();
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area->name . '_' . $part->part.'_speed')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_speed2')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_speed3')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,50 @@
.WaveFooter {
margin-top: 3rem;
min-height: 300px;
position: relative;
.waves {
>use {
fill: var(--xshop-primary);
animation: move-forever var(--speed) -2s linear infinite;
&:nth-child(2) {
animation-delay: -3s;
animation-duration: var(--speed2);
}
&:nth-child(3) {
animation-delay: -4s;
animation-duration: var(--speed3);
}
}
}
svg {
position: absolute;
left: 0;
bottom: 5rem;
width: 100%;
height: 30vw;
max-height: 200px;
}
.content{
padding: 1rem;
background: var(--xshop-primary);
opacity: .96;
color: var(--xshop-diff);
height: 5rem;
position: absolute;
bottom: 0;
left: 0;
right: 0;
text-align: center;
}
}
@keyframes move-forever {
0% {
transform: translate(-90px, 0%);
}
100% {
transform: translate(85px, 0%);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

@ -0,0 +1,21 @@
<section class='NoLinkImage @if(getSetting($data->area->name.'_'.$data->part.'_dark')) dark-mode @endif'>
<div class="{{gfx()['container']}}">
<div class="row">
@foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',5) as $post )
<div class="col-lg-3 col-md-6">
<div class=" no-link-item mb-4">
<img src="{{$post->orgUrl()}}" class="float-start me-2" alt=" {{$post->title}}">
<h3>
{{$post->title}}
</h3>
<p>
{{$post->subtitle}}
</p>
</div>
</div>
@endforeach
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "NoLinkImage",
"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,44 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Group;
use App\Models\Part;
use App\Models\Setting;
class NoLinkImage
{
public static function onAdd(Part $part = null)
{
$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.'_dark';
$setting->value = 0;
$setting->size = 6;
$setting->type = 'CHECKBOX';
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' dark mode';
$setting->save();
}
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.'_dark')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,30 @@
.NoLinkImage {
padding: 1rem 0;
// scss
.no-link-item{
transition: .4s;
background: #ffffff;
padding: 5px;
border-radius: var(--xshop-border-radius);
h3{
font-size: 20px;
margin-top: .4rem;
}
p{
color: gray;
}
img{
height: 64px;
}
&:hover{
filter: grayscale(1);
}
}
&.dark-mode{
.no-link-item{
background: #21252b;
color: whitesmoke;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

@ -0,0 +1,36 @@
<section class='PostIndexImage'>
<div class="{{gfx()['container']}}">
<h1>
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->webUrl()}}">
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->name}}
</a>
</h1>
<p class="text-muted">
{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->description}}
</p>
<div class="row">
@foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',4) as $post )
<div class="col-lg-3 col-md-6">
<div class="post-img-index">
<img src="{{$post->imgUrl()}}" alt="{{$post->title}}" class="img-fluid">
<h3>
{{$post->title}}
</h3>
<p class="text-muted">
{{$post->subtitle}}
</p>
<a href="{{$post->webUrl()}}">
{{__("Read more")}}
</a>
</div>
</div>
@endforeach
</div>
<div class="py-5 text-center">
<a href="{{getGroupBySetting($data->area->name.'_'.$data->part.'_group')->webUrl()}}" class="btn btn-outline-primary">
{{getSetting($data->area->name.'_'.$data->part.'_btn')}}
</a>
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "PostIndexImage",
"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,43 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Group;
use App\Models\Part;
use App\Models\Setting;
class PostIndexImage
{
public static function onAdd(Part $part = null)
{
$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.'_btn';
$setting->value = __("Find more");
$setting->size = 6;
$setting->type = 'TEXT';
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$setting->title = $part->area->name . ' ' . $part->part. ' button text';
$setting->save();
}
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.'_btn')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,48 @@
.PostIndexImage {
// scss
h1{
font-size: 30px;
text-align: center;
position: relative;
padding: 1rem;
&:before{
content: ' ';
position: absolute;
inset-inline-start: 47%;
inset-inline-end: 47%;
top: 0;
height: 4px;
background: var(--xshop-primary);
}
}
.post-img-index{
background: #ffffff33;
box-shadow: var(--xshop-shadow);
border-radius: var(--xshop-border-radius);
padding: 1rem;
h3{
font-size: 22px;
padding: 1rem 0;
height: 3.5em;
position: relative;
overflow: hidden;
&:before{
content: ' ';
position: absolute;
inset-inline-end: 5%;
width: 15%;
bottom: 0;
height: 2px;
background: var(--xshop-primary);
}
}
img{
width: 100%;
height: 15vh;
object-fit: cover;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

@ -0,0 +1,81 @@
<section class='TreeGridProducts'
style="---main-bg: {{getSetting($data->area->name.'_'.$data->part.'_color')}};
--gx1: {{getSetting($data->area->name.'_'.$data->part.'_gradx1')}};
--gx2: {{getSetting($data->area->name.'_'.$data->part.'_gradx2')}};
--gy1: {{getSetting($data->area->name.'_'.$data->part.'_grady1')}};
--gy2: {{getSetting($data->area->name.'_'.$data->part.'_grady2')}};
"
>
<div class="{{gfx()['container']}}">
<div class="tree-grid">
<div class="tree-grid-item">
<div>
<h1>
{{getSetting($data->area->name.'_'.$data->part.'_title')}}
</h1>
<div class="w100 overflow-hidden">
<div class="section-main">
@foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_category') as $product)
<div class="item">
<div class="tree-product-box">
<a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" alt="{{$product->name}}">
</a>
<h4>
<a href="{{$product->webUrl()}}">
{{$product->name}}
</a>
</h4>
<div class="price">
{{$product->getPrice()}}
</div>
<a href="" class="btn btn-primary btn-sm w-100">
<i class="ri-shopping-cart-2-line"></i>
<span>
Add to card
</span>
</a>
</div>
</div>
@endforeach
</div>
</div>
</div>
</div>
<div class="tree-grid-item">
<span class="badge bg-secondary discount">
{{getSetting($data->area->name.'_'.$data->part.'_badgex')}}
</span>
<div class="section-second">
@foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryx') as $product)
<div class="item text-center">
<a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" class="img-fluid" alt="{{$product->name}}">
</a>
</div>
@endforeach
</div>
</div>
<div class="tree-grid-item">
<span class="badge bg-secondary discount">
{{getSetting($data->area->name.'_'.$data->part.'_badgey')}}
</span>
<div class="section-third">
@foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryy') as $product)
<div class="item text-center">
<a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" class="img-fluid" alt="{{$product->name}}">
</a>
</div>
@endforeach
</div>
</div>
</div>
</div>
</section>

@ -0,0 +1,82 @@
import {tns} from "tiny-slider/src/tiny-slider";
var treeSlider,treeSliderX, treeSliderY ;
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.tree-grid .section-main')?.forEach(function (el) {
if (el.classList.contains('.tns-slider')){
console.log('ignore');
return 'ignore';
}
treeSlider = tns({
container: el,
items: 3,
slideBy: 'page',
autoplay: true,
autoplayButton: false,
// nextButton: false,
controls: false,
autoplayHoverPause: true,
mouseDrag: true,
gutter: 7,
responsive:{
560:{
items: 1,
},
768:{
items: 2,
},
1000:{
items: 3,
},
1400:{
items: 4,
},
}
// speed:10000,
});
});
document.querySelectorAll('.tree-grid .section-second')?.forEach(function (el) {
if (el.classList.contains('.tns-slider')){
console.log('ignore');
return 'ignore';
}
treeSliderX = tns({
container: el,
items: 1,
slideBy: 'page',
autoplay: true,
autoplayButton: false,
// nextButton: false,
controls: false,
autoplayHoverPause: true,
autoplayTimeout: 8000,
mouseDrag: true,
gutter: 7,
edgePadding: 60,
// speed:10000,
});
});
document.querySelectorAll('.tree-grid .section-third')?.forEach(function (el) {
if (el.classList.contains('.tns-slider')){
console.log('ignore');
return 'ignore';
}
treeSliderX = tns({
container: el,
items: 1,
slideBy: 'page',
autoplay: true,
autoplayTimeout: 7500,
autoplayButton: false,
// nextButton: false,
controls: false,
autoplayHoverPause: true,
mouseDrag: true,
gutter: 7,
edgePadding: 60,
// speed:10000,
});
});
});

@ -0,0 +1,10 @@
{
"name": "TreeGridProducts",
"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,131 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Category;
use App\Models\Part;
use App\Models\Setting;
class TreeGridProducts
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_title';
$setting->value = 'Favorite products';
$setting->type = 'TEXT';
$setting->size = 4;
$setting->title = $part->area->name . ' ' . $part->part .' main title';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_color';
$setting->value = '#273763';
$setting->type = 'COLOR';
$setting->size = 4;
$setting->title = $part->area->name . ' ' . $part->part .' main color';
$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 = 4;
$setting->title = $part->area->name . ' ' . $part->part .' main category';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_badgex';
$setting->value = '22%';
$setting->type = 'TEXT';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' Second badge text';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_gradx1';
$setting->value = '#FF7D33';
$setting->type = 'COLOR';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' second gradiant color 1';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_gradx2';
$setting->value = '#FF971D';
$setting->type = 'COLOR';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' second gradiant color 2';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_categoryx';
$setting->value = Category::first()->id;
$setting->type = 'CATEGORY';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' second category';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_badgey';
$setting->value = 'Sale';
$setting->type = 'TEXT';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' third badge text';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_grady1';
$setting->value = '#FF7D33';
$setting->type = 'COLOR';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' third gradiant color 1';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_grady2';
$setting->value = '#430392';
$setting->type = 'COLOR';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' third gradiant color 2';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_categoryy';
$setting->value = Category::first()->id;
$setting->type = 'CATEGORY';
$setting->size = 3;
$setting->title = $part->area->name . ' ' . $part->part .' third category';
$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.'_category')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_color')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_badgex')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_gradx1')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_gradx2')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_categoryx')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_badgey')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_grady1')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_grady2')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_categoryy')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,103 @@
.TreeGridProducts {
margin-bottom: 2rem;
h1{
font-size: 22px;
}
.tree-product-box{
padding: .4rem;
overflow: hidden;
background: var(--xshop-background);
border-radius: var(--xshop-border-radius);
color: var(--xshop-text);
.price{
padding: 4px;
text-align: center;
color: var(--xshop-secondary);
margin-bottom: 7px;
}
img{
width: 100%;
}
h4{
font-size: 17px;
margin: 0;
text-align: center;
padding: .4rem;
overflow: hidden;
}
a{
color: var(--xshop-text);
}
}
.tree-grid {
display: grid;
grid-template-columns: repeat(8,1fr);
grid-template-rows: auto;
grid-gap: 10px 10px;
padding-top: 1rem;
.tree-grid-item {
overflow: hidden;
border-radius: var(--xshop-border-radius);
//display: flex;
//align-items: center;
//justify-content: center;
color: var(--xshop-diff);
padding: 2rem 1rem;
position: relative;
box-shadow: var(--xshop-shadow);
&:first-child {
grid-column: 1/5 span;
grid-row: 1/3;
background: var(---main-bg);
}
&:nth-child(2) {
grid-column: 6/3 span;
grid-row: 1/2;
background: rgb(255,125,51);
background: linear-gradient(180deg, var(--gx1) 0%, var(--gx2) 100%);
overflow: hidden;
}
&:nth-child(3) {
grid-column: 6/3 span;
grid-row: 2/2;
background: linear-gradient(180deg, var(--gy1) 0%, var(--gy2) 100%);
overflow: hidden;
}
}
}
.badge {
position: absolute;
inset-inline-end: 0;
top: 0;
padding: 15px;
border-radius: var(--xshop-border-radius);
width: 75px;
background: #283035aa !important;
}
.section-second,.section-third{
img{
height: 128px;
}
}
}
@media ( max-width: 1024px ) {
.TreeGridProducts {
.tree-grid {
grid-template-columns: repeat(1, 1fr) !important;
grid-template-rows: repeat(1, 1fr) !important;
.tree-grid-item {
grid-column: auto !important;
grid-row: auto !important;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

@ -4,6 +4,10 @@ var sliderSimple ;
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.SliderSimple')?.forEach(function (el) {
if (el.classList.contains('.tns-slider')){
console.log('ignore');
return 'ignore';
}
sliderSimple = tns({
container: el,
items: 1,

@ -356,7 +356,7 @@ Route::prefix(config('app.panel.prefix'))->name('admin.')->group(
Route::get('test',function (){
// return \Resources\Views\Segments\PreloaderCircle::onAdd();
return \App\Helpers\TVisitor::GetKeyword();
return getCategoryProductBySetting('index_TreeGridProducts_category');
})->name('test');

Loading…
Cancel
Save