added Hod header theme part

master
A1Gard 5 days ago
parent 095d187bb2
commit 43f8e35d3c

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

@ -0,0 +1,19 @@
<section class='HodHeader'>
<div class="{{gfx()['container']}}">
<div class="row">
<div class="col-md">
<h1>
{{$title}}
</h1>
<h2>
{{$subtitle}}
</h2>
</div>
<div class="col-md-3 text-end">
<div id="hod-logo">
<img src="{{asset('upload/images/logo.png')}}" alt="logo" >
</div>
</div>
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "HodHeader",
"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,34 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
use Illuminate\Support\Facades\File;
class HodHeader
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_png';
$setting->value = 'url("'.asset('upload/images/'.$part->area_name . '.' . $part->part.'.png').'")';
$setting->type = 'FILE';
$setting->size = 12;
$setting->title = $part->area_name . ' ' . $part->part.' pattern image';
$setting->data = json_encode(['name' => 'hod-img']);
$setting->save();
File::copy(__DIR__.'/../../default-assets/hodhod.png',public_path('upload/images/').$part->area_name . '.' . $part->part.'.png');
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area_name . '_' . $part->part.'_png')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,43 @@
.HodHeader {
// scss
overflow: visible;
background: linear-gradient( 45deg, var(--xshop-primary), var(--xshop-secondary) 100%);
color: var(--xshop-diff);
padding: 4.5rem 0 1rem;
position: relative;
&:before{
content: ' ';
background-image: var(--hod-img);
position: absolute;
left: 0;
right: 0;
top: 0;
bottom: 0;
width: 100%;
height: 100%;
}
h1,h2{
font-weight: 400;
max-height: 1em;
overflow: hidden;
}
#hod-logo {
padding: 2rem;
background: #ffffff99;
position: relative;
z-index: 5;
display: inline-block;
margin-bottom: -40px;
border-radius: var(--xshop-border-radius);
margin-top: 1rem;
img {
height: 75px;
}
}
+ .content{
padding-top: 2rem;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Loading…
Cancel
Save