added gradient text

pull/44/head
A1Gard 5 months ago
parent b9944a2e2d
commit ba233b3798

@ -0,0 +1,10 @@
<section class='GradientTextLink py-4' style="--deg: {{getSetting($data->area->name.'_'.$data->part.'_deg')}}deg">
<div class="{{gfx()['container']}} py-4 text-center">
<h1>
{{getSetting($data->area->name.'_'.$data->part.'_title')}}
</h1>
<a class="btn btn-outline-invert" href="{{getSetting($data->area->name.'_'.$data->part.'_link')}}">
{{getSetting($data->area->name.'_'.$data->part.'_btn')}}
</a>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "GradientTextLink",
"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,62 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
class GradientTextLink
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_title';
$setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit. A adipisci aliquid aspernatur, commodi corporis cupiditate';
$setting->type = 'TEXT';
$setting->size = 12;
$setting->title = $part->area->name . ' ' . $part->part .' title';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_btn';
$setting->value = 'Shop';
$setting->type = 'TEXT';
$setting->size = 4;
$setting->title = $part->area->name . ' ' . $part->part .' button text';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_link';
$setting->value = config('app.url');
$setting->type = 'TEXT';
$setting->ltr = true;
$setting->size = 4;
$setting->title = $part->area->name . ' ' . $part->part .' button link';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area->name . '_' . $part->part.'_deg';
$setting->value = 45;
$setting->size = 4;
$setting->type = 'NUMBER';
$setting->data = json_encode(['xmin' => 0, 'xmax' => 360]);
$setting->title = $part->area->name . ' ' . $part->part. ' degree';
$setting->save();
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area->name . '_' . $part->part.'_btn')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_title')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_link')->first()?->delete();
Setting::where('key',$part->area->name . '_' . $part->part.'_deg')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,13 @@
.GradientTextLink {
// scss
background: linear-gradient( var(--deg), $xshop-primary, $xshop-secondary 100%);
color: $xshop-diff;
h1{
font-size: 24px;
margin-bottom: 2rem;
margin-top: 2rem;
}
margin-bottom: 1rem;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 51 KiB

Loading…
Cancel
Save