Compare commits

..

5 Commits

Author SHA1 Message Date
A1Gard ee0069dcd0 added little footer 1 month ago
A1Gard c44e3cc03e added text splitter 1 month ago
A1Gard 122f89b881 added natalia theme part 1 month ago
A1Gard f906151be3 fixed ui bugs
added Vickushka theme part
1 month ago
A1Gard c3d04f24ff fixed ui bugs
improve translates
1 month ago

@ -1419,8 +1419,24 @@ function findArea($name,$model = null)
return \App\Models\Area::where('name', $name)->first();
}
/**
* cache number
* @return false|mixed|string|null
*/
function cacheNumber()
{
return getSetting('cache_number');
}
/**
* get website main categories
* @param $limit
* @param $orderBy
* @param $asc
* @return Category[]|\LaravelIdea\Helper\App\Models\_IH_Category_C
*/
function getMainCategory($limit=4,$orderBy = 'id', $asc = 'ASC')
{
return \App\Models\Category::whereNull('parent_id')->limit($limit)->orderBy($orderBy,$asc)->get();
}

@ -56,6 +56,7 @@ class CategoryController extends XController
$category->name = $request->input('name');
$category->subtitle = $request->input('subtitle');
$category->icon = $request->input('icon');
$category->description = $request->input('description');
if ($category->parent_id != ''){
$category->parent_id = $request->input('parent_id',null);
@ -83,6 +84,7 @@ class CategoryController extends XController
config('app.media.watermark_opacity'));
}
$i->save(storage_path() . '/app/public/categories/optimized-'. $category->$key);
}
if ($request->has('bg')) {
$category->bg = $this->storeFile('bg', $category, 'categories');
@ -104,6 +106,10 @@ class CategoryController extends XController
}
$i->save(storage_path() . '/app/public/categories/optimized-'. $category->$key);
}
if ($request->has('svg')){
$category->svg = $this->storeFile('svg',$category, 'categories');
}
$category->save();
return $category;

@ -22,6 +22,14 @@ class Category extends Model
return \Storage::url('categories/optimized-' . $this->image);
}
public function svgUrl()
{
if ($this->svg == null) {
return asset('/assets/upload/logo.svg');
}
return \Storage::url('categories/' . $this->svg);
}
public function imgOriginalUrl()
{

@ -16,9 +16,11 @@ return new class extends Migration
$table->text('name');
$table->string('slug',128)->unique();
$table->text('subtitle')->nullable();
$table->string('icon')->nullable();
$table->text('description')->nullable();
$table->integer('sort')->default(0);
$table->string('image',2048)->nullable()->default(null);
$table->string('svg',2048)->nullable()->default(null);
$table->string('bg',2048)->nullable()->default(null);
$table->unsignedInteger('parent_id')->nullable()->default(null)->index();
$table->json('theme')->nullable();

@ -20,7 +20,7 @@ document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.delete-confirm')?.forEach(function (el) {
el.addEventListener('click', function (e) {
if (!confirm('Are you sure you want to delete this item?')) { // WIP Need to translate
if (!confirm(window.TR.deleteConfirm)) { // WIP Need to translate
e.preventDefault();
}
});

@ -352,7 +352,7 @@ class ContentSEOAnalyzer {
<h4>${window.TR.avgParaStruc}</h4>
<div class="metric-value">
${report.details.readability.paragraphCount} ${ window.TR.paragraphs}
(avg ${report.details.readability.avgWordsPerParagraph} ${ window.TR.words})
(${window.TR.avg} ${report.details.readability.avgWordsPerParagraph} ${ window.TR.words})
</div>
</div>
</div>

@ -78,6 +78,7 @@
"Answered": "پاسخ داده شده",
"Approve": "تایید کردن",
"Approved": "تایید شده",
"Are you sure you want to delete this item?": "آیا برای حذف این مورد مطمئن هستید؟",
"Area design": "طراحی محیط",
"Areas": "محیط‌ها ",
"As you wished created successfully": "همانطور که شما مایل بودید ایجاد شد",
@ -581,6 +582,7 @@
"area": "محیط",
"area :NAME of website updated": "محیط :NAME وبسایت به روز شد",
"article": "مقاله",
"avg": "معدل",
"body": "متن",
"canonical": "کنونیکال",
"category": "دسته‌بندی",
@ -617,7 +619,7 @@
"news": "خبر",
"not searchable": "غیرقابل جستجو",
"one second ago": "یک ثانیه پیش",
"paragraphs": "بندها",
"paragraphs": "بند",
"parent_id": "والد",
"password repeat": "تکرار گذرواژه",
"payment success": "پرداخت موفق بود",
@ -649,7 +651,7 @@
"user_id": "کاربر",
"view": "بازدید",
"webp": "",
"words": "واژگان",
"words": "واژه",
"xShop": "",
"yesterday": "دیروز"
}

@ -24,6 +24,16 @@
</ul>
</div>
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-remixicon-line"></i>
{{__("Icon")}}
</h3>
<div class="p-1 text-center pb-4">
<remix-icon-picker xname="icon" xvalue="{{old('icon',$item->icon??null)}}"></remix-icon-picker>
</div>
</div>
@if(isset($item))
<div class="item-list mb-3">
<h3 class="p-3">
@ -43,6 +53,17 @@
</div>
@endif
@if(isset($item))
<div class="item-list mb-3">
<h3 class="p-3">
<i class="ri-image-2-line"></i>
{{__('SVG image')}}
</h3>
<img src="{{$item->svgUrl()}}" alt="{{$item->name}}" data-open-file="#svg" class="img-fluid mb-4">
</div>
@endif
@if(isset($item))
<div class="item-list mb-3">
<div class="p-3">
@ -107,7 +128,7 @@
value="{{old('subtitle',$item->subtitle??null)}}"/>
</div>
</div>
<div class="col-md-4 mt-3">
<div class="col-md-3 mt-3">
<label for="parent">
{{__('Group Parent')}}
</label>
@ -124,7 +145,7 @@
@endforeach
</select>
</div>
<div class="col-md-4 mt-3">
<div class="col-md-3 mt-3">
<div class="form-group">
<label for="image">
{{__('Feature image')}}
@ -134,7 +155,16 @@
placeholder="{{__('Feature image')}}"/>
</div>
</div>
<div class="col-md-4 mt-3">
<div class="col-md-3 mt-3">
<div class="form-group">
<label for="svg">
{{__('Svg image')}}
</label>
<input accept=".svg" name="svg" type="file"
class="form-control @error('svg') is-invalid @enderror" id="svg"/>
</div>
</div>
<div class="col-md-3 mt-3">
<div class="form-group">
<label for="bg">
{{__('Background image')}}

@ -23,7 +23,9 @@
window.TR.avgParaStruc = `{{__("Paragraph Structure")}}`;
window.TR.SEOScore = `{{__("SEO Score")}}`;
window.TR.words = `{{__("words")}}`;
window.TR.avg = `{{__("avg")}}`;
window.TR.times = `{{__("times")}}`;
window.TR.paragraphs = `{{__("paragraphs")}}`;
window.TR.deleteConfirm = `{{__("Are you sure you want to delete this item?")}}`;
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 KiB

@ -0,0 +1,23 @@
<section class='LittleFooter'>
<div class="{{gfx()['container']}}">
<div class="row">
<div class="col-md-4">
{{getSetting('copyright')}}
</div>
<div class="col-md-4">
<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>
<div class="col-md-4">
{!! getSetting($data->area_name.'_'.$data->part.'_text') !!}
</div>
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "LittleFooter",
"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,29 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
class LittleFooter
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_text';
$setting->value = 'A usually green, flattened, lateral structure attached to a stem and functioning as a principal organ of photosynthesis and transpiration in most plants.';
$setting->type = 'EDITOR';
$setting->size = 12;
$setting->title = $part->area_name . ' ' . $part->part .' text';
$setting->save();
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area_name . '_' . $part->part.'_text')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,15 @@
.LittleFooter {
// scss
padding: 1rem 0;
.col-md-4{
display: flex;
align-items: center;
}
.social{
i{
font-size: 30px;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

@ -0,0 +1,27 @@
<section class='NataliaCategories'>
<div class="{{gfx()['container']}}">
<div class="row nata-content">
<div class="col-md-6 pt-5 slider-content">
<h1>
{{getSetting($data->area_name.'_'.$data->part.'_title')}}
</h1>
<h2>
{{getSetting($data->area_name.'_'.$data->part.'_subtitle')}}
</h2>
<ul>
@foreach(getCategorySubCatsBySetting($data->area_name.'_'.$data->part.'_category') as $category)
<li>
<a href="{{$category->webUrl()}}">
<img src="{{$category->svgUrl()}}" alt="{{$category->name}}" class="mx-2">
{{$category->name}}
</a>
</li>
@endforeach
</ul>
</div>
<div class="col-md-6 nata-bg"
style="background-image: url('{{$bg??asset('upload/images/'.$part->area_name . '.' . $part->part.'.webp')}}')">
</div>
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "NataliaCategories",
"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,67 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Category;
use App\Models\Part;
use App\Models\Setting;
use Illuminate\Support\Facades\File;
class NataliaCategories
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_category';
$setting->value = Category::first()->id;
$setting->type = 'CATEGORY';
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' second category';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_title';
$setting->value = 'Modern categories';
$setting->type = 'TEXT';
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' modern categories title';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_subtitle';
$setting->value = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit';
$setting->type = 'TEXT';
$setting->size = 12;
$setting->title = $part->area_name . ' ' . $part->part .' modern categories subtitle';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_webp';
$setting->value = null;
$setting->type = 'FILE';
$setting->size = 12;
$setting->title = $part->area_name . ' ' . $part->part.' background pattern image';
$setting->save();
File::copy(__DIR__.'/../../default-assets/woman-transparent.webp',public_path('upload/images/').$part->area_name . '.' . $part->part.'.webp');
}
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.'_subtitle')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_webp')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_category')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,44 @@
.NataliaCategories {
// scss
direction: ltr;
.nata-bg{
background-repeat: no-repeat;
background-size: 100% auto;
position: relative;
top: -3rem;
padding-bottom: 5rem;
margin-bottom: -3rem;
*{
opacity: 0;
}
}
h1{
font-size: 29px;
margin-bottom: 2rem;
}
h2{
font-size: 19px;
font-weight: 400;
margin-bottom: 2rem;
}
.nata-content{
ul{
margin-bottom: 4rem;
list-style: none;
li{
padding: .5rem;
img{
width: 35px;
padding: 4px;
display: inline-block;
background: var(--xshop-secondary);
border-radius: 50%;
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

@ -0,0 +1,3 @@
<section class='SpliterText'>
{!! getSetting($data->area_name.'_'.$data->part.'_text') !!}
</section>

@ -0,0 +1,10 @@
{
"name": "SpliterText",
"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,30 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
class SpliterText
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_text';
$setting->value = 'A usually green, flattened, lateral structure attached to a stem and functioning as a principal organ of photosynthesis and transpiration in most plants.';
$setting->type = 'EDITOR';
$setting->size = 12;
$setting->title = $part->area_name . ' ' . $part->part .' text';
$setting->save();
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area_name . '_' . $part->part.'_text')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,17 @@
.SpliterText {
// scss
padding: 1rem;
background: var(--xshop-background);
width: 700px;
max-width: 95%;
margin: -3.5rem auto;
height: 7rem;
border-radius: var(--xshop-border-radius);
border: 1px solid rgba(0, 0, 0, 0.1);
position: relative;
z-index: 7;
}
.SpliterText + section{
padding-top: 5rem;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

@ -0,0 +1,47 @@
<section class='VickushkaMainCategoriesSlider'>
<div class="{{gfx()['container']}}">
<div class="row">
@foreach(getMainCategory() as $category)
<div class="col-md">
<div class="v-main-category" data-id="#v-cat-{{$category->id}}">
<img src="{{$category->svgUrl()}}" alt="svg {{$category->name}}">
<h4 class="text-center">
{{$category->name}}
</h4>
</div>
</div>
@endforeach
</div>
<h2 class="text-center mb-5">
{{getSetting($data->area_name.'_'.$data->part.'_title')}}
</h2>
<div id="v-cats" class="text-center">
@foreach(getMainCategory() as $category)
<div class="v-item" id="v-cat-{{$category->id}}">
<h3 class="mb-3">
{{$category->name}}
</h3>
<h4 class="text-muted mb-4">
{{$category->subtitle}}
</h4>
<div class="row">
@foreach($category->children as $subCat)
<div class="col-md-4">
<a href="{{$subCat->webUrl()}}">
<img src="{{$subCat->imgUrl()}}" alt="{{$subCat->name}}" class="v-sub-img">
<h5>
{{$subCat->name}}
</h5>
</a>
</div>
@endforeach
</div>
</div>
@endforeach
</div>
</div>
</section>

@ -0,0 +1,22 @@
document.addEventListener('DOMContentLoaded',function () {
document.querySelectorAll('.v-main-category')?.forEach(function (el) {
el.addEventListener('click',function () {
document.querySelectorAll('.v-item').forEach(function (elm) {
elm.style.display = 'none';
});
// Get the element to be displayed
const targetId = el.getAttribute('data-id');
const targetElement = document.querySelector(targetId);
if (targetElement) {
targetElement.style.display = 'block';
// Scroll to the element
targetElement.scrollIntoView({
behavior: 'smooth', // Smooth scroll effect
block: 'start' // Scroll to the top of the element
});
}
});
});
});

@ -0,0 +1,10 @@
{
"name": "VickushkaMainCategoriesSlider",
"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,40 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
use App\Models\Setting;
class VickushkaMainCategoriesSlider
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_title';
$setting->value = 'categories here';
$setting->type = 'TEXT';
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' sub title';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_color';
$setting->value = '#ebfebe';
$setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'vicka-bg-color']);
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' main color';
$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.'_color')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,52 @@
.VickushkaMainCategoriesSlider {
background: var(--vicka-bg-color);
// scss
padding-bottom: 4rem;
.container{
position: relative;
top: -4rem;
}
.v-main-category{
background: var(--xshop-secondary);
border-radius: var(--xshop-border-radius);
color: var(--xshop-diff2);
padding: 1rem 0;
margin-bottom: 3rem;
cursor: pointer;
img{
width: 35%;
margin: 0 auto -4rem;
display: block;
background: var(--xshop-primary);
border-radius: 50%;
color: var(--xshop-diff);
padding: 1rem;
position: relative;
top: -5rem;
}
}
#v-cats{
.v-item{
display: none;
margin: 2rem 0;
.v-sub-img{
width: 175px;
height: 175px;
object-fit: cover;
border-radius: 50%;
margin: 1rem 0;
border: 1px solid rgba(0, 0, 0, 0.1);
}
}
.v-item:first-child{
display: block;
}
}
h1,h2,h3,h4,h5{
font-weight: 200;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 KiB

@ -41,7 +41,7 @@ class LoginPatternBg
$setting->title = $part->area_name . ' ' . $part->part.' background pattern image';
$setting->save();
File::copy(__DIR__.'/../../default-assets/pattern.png',public_path('upload/images/').$part->area_name . '.' . $part->part.'.jpg');
File::copy(__DIR__.'/../../default-assets/pattern.png',public_path('upload/images/').$part->area_name . '.' . $part->part.'.png');
}
public static function onRemove(Part $part = null)
{

@ -1,7 +1,7 @@
const toggleSideMenu = function (e) {
e.preventDefault();
let txt = '<ul>';
document.querySelectorAll('#AplMenu > ul > li').forEach(function (el) {
document.querySelectorAll('#AplMenu > ul > li')?.forEach(function (el) {
if(!el.classList.contains('icon-menu')){
txt += el.outerHTML;
}
@ -10,5 +10,5 @@ const toggleSideMenu = function (e) {
document.querySelector('#reps-menu').innerHTML = txt;
};
document.addEventListener('DOMContentLoaded',function () {
document.querySelector('#toggler-menu').addEventListener('click',toggleSideMenu);
document.querySelector('#toggler-menu')?.addEventListener('click',toggleSideMenu);
});

@ -48,7 +48,11 @@ document.addEventListener('DOMContentLoaded', () => {
const viewportCenter = windowHeight / 2;
const distanceFromCenter = sliderCenter - viewportCenter;
const parallaxOffset = distanceFromCenter * -0.7; // Adjust this value to control parallax intensity
let parallaxOffset = distanceFromCenter * -.4; // Adjust this value to control parallax intensity
if (sliderRect.width < 1000){
parallaxOffset = distanceFromCenter * -.7; // Adjust this value to control parallax intensity
}
const bgImage = slider.getAttribute('data-bg');
slider.style.backgroundImage = `url('${bgImage}')`;

@ -14,7 +14,7 @@
.parallax-slide-item{
display: flex;
align-items: center;
justify-content: center;
justify-content: start;
width: 100%;
height: 750px;
}
@ -25,7 +25,7 @@
left: 0;
width: 100%;
height: 750px;
background-size: auto 120vh;
background-size: 100% auto;
background-position: center 0;
@ -37,3 +37,10 @@
width: 500px;
}
}
/*-1000px width*/
@media (max-width: 1000px) {
.parallax-slider{
background-size: auto 125vh !important;
}
}

@ -396,6 +396,7 @@ Route::middleware([\App\Http\Middleware\VisitorCounter::class])
// index
Route::get('/', [ClientController::class, 'welcome'])->name('welcome');
Route::get('/posts', [ClientController::class, 'posts'])->name('posts');
Route::get('/post/{post}', [ClientController::class, 'post'])->name('post');
Route::get('/customer/sign-out', [ClientController::class, 'signOut'])->name('sign-out');
Route::post('/customer/sign-in/do', [ClientController::class, 'singInDo'])->name('sign-in-do');
Route::get('/customer/sign-in', [ClientController::class, 'signIn'])->name('sign-in');
@ -435,7 +436,6 @@ Route::middleware([\App\Http\Middleware\VisitorCounter::class])
Route::get('/gallery/{gallery}', [ClientController::class, 'gallery'])->name('gallery');
Route::get('/search', [ClientController::class, 'search'])->name('search');
Route::get('attach/download/{attachment}', [ClientController::class, 'attachDl'])->name('attach-dl');
Route::get('/post/{post}', [ClientController::class, 'post'])->name('post');
Route::get('pay/{invoice}', [ClientController::class, 'pay'])->name('pay');
Route::get('product/fav/toggle/{product}', [\App\Http\Controllers\CustomerController::class, 'ProductFavToggle'])->name('product-fav-toggle');

Loading…
Cancel
Save