Skip to content

Commit

Permalink
added Sina theme part
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Jan 25, 2025
1 parent ec15cb0 commit 2f14602
Show file tree
Hide file tree
Showing 7 changed files with 146 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/lang/fa.json
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@
"True": "بلی",
"Type": "نوع",
"Unavailable": "ناموجود",
"Under construction": "در دست ساخت",
"Unit": "واحد",
"Unknown bulk action : :ACTION": "کار دسته جمعی تعریف نشده :ACTION",
"Update": "به روز شدن",
Expand Down
22 changes: 22 additions & 0 deletions resources/views/segments/index/SinaTextBg/SinaTextBg.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<section class="SinaTextBg live-setting" data-live="{{$data->area_name.'_'.$data->part}}" style="background-image: url('{{asset('upload/images/'.$data->area_name.'.'.$data->part.'.jpg')}}')">
<div class="container">
<div class="row">
<div class="col-md-3">

</div>
<div class="col-md-6">
<div class="sina-box">
<div class="txt">
{!! getSetting($data->area_name.'_'.$data->part.'_text') !!}
</div>
<a class="btn btn-outline-dark" href="{{getSetting($data->area_name.'_'.$data->part.'_link')}}">
{{getSetting($data->area_name.'_'.$data->part.'_btn')}}
</a>
</div>
</div>
<div class="col-md-3">

</div>
</div>
</div>
</section>
Empty file.
10 changes: 10 additions & 0 deletions resources/views/segments/index/SinaTextBg/SinaTextBg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "SinaTextBg",
"version": "1.0",
"author": "xStack",
"email": "[email protected]",
"license": "GPL-3.0-or-later",
"url": "https:\/\/xstack.ir",
"author_url": "https:\/\/4xmen.ir",
"packages": []
}
65 changes: 65 additions & 0 deletions resources/views/segments/index/SinaTextBg/SinaTextBg.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<?php

namespace Resources\Views\Segments;

use App\Models\Part;
use App\Models\Setting;
use Illuminate\Support\Facades\File;

class SinaTextBg
{
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 = 'EDITOR';
// $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.'_jpg';
$setting->value = null;
$setting->type = 'FILE';
$setting->size = 12;
$setting->title = $part->area_name . ' ' . $part->part.' Image';
$setting->save();

$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_btn';
$setting->value = 'Shop';
$setting->type = 'TEXT';
$setting->size = 6;
$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 = 6;
$setting->title = $part->area_name . ' ' . $part->part .' button link';
$setting->save();

File::copy(__DIR__.'/../../default-assets/bg-girl.jpg',public_path('upload/images/').$part->area_name . '.' . $part->part.'.jpg');
}
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.'_jpg')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_btn')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_link')->first()?->delete();

}
public static function onMount(Part $part = null)
{
return $part;
}
}
48 changes: 48 additions & 0 deletions resources/views/segments/index/SinaTextBg/SinaTextBg.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
.SinaTextBg {
// scss
height: 90vh;
background-size: cover;
background-position: center;

.sina-box{
margin-top: 20vh;
background: #ffffff99;
backdrop-filter: blur(7px);
padding: 3rem;
height: 50vh;
border-radius: var(--xshop-border-radius);
position: relative;
padding-bottom: 50px;
.txt{
height: 38vh;
overflow: hidden;
}

.btn{
position: absolute;
bottom: 1rem;
left: 50%;
transform: translateX(-50%);
min-width: 120px;
}
h1,h2,h3,h4{
font-weight: 400;
font-size: 20px;
text-transform: uppercase;
text-align: justify;
}
p{
text-align: justify;
}
}

}

/*-968px width*/
@media (max-width: 968px) {
.sina-box{
h1,h2,h3,h4{
font-size: 20px !important;
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2f14602

Please sign in to comment.