Compare commits

..

3 Commits

@ -82,8 +82,10 @@ class AreaController extends Controller
if ($request->has('use_default')){ if ($request->has('use_default')){
$area->use_default = 1; $area->use_default = 1;
$area->save(); }else{
$area->use_default = 0;
} }
$area->save();
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])]);

@ -23,6 +23,10 @@ class ThemeController extends Controller
} }
} }
$response .= '}'; $response .= '}';
if (langIsRTL(app()->getLocale())) {
$response .= ' .slider-content, .tns-outer .item{ direction: rtl; }';
}
return response($response)->header('Content-Type', 'text/css; charset=utf-8'); return response($response)->header('Content-Type', 'text/css; charset=utf-8');
} }
} }

@ -33,6 +33,10 @@ body {
} }
section {
max-width: 100%;
}
#website-preloader { #website-preloader {
transition: 500ms; transition: 500ms;
} }
@ -129,18 +133,21 @@ body {
} }
.tag-page{ .tag-page {
min-height: 60vh; min-height: 60vh;
.tab-control{
.tab-control {
padding-left: 12px; padding-left: 12px;
padding-right: 12px; padding-right: 12px;
} }
.tab-control a.active{
.tab-control a.active {
background: var(--xshop-primary); background: var(--xshop-primary);
color: var(--xshop-diff); color: var(--xshop-diff);
} }
.tab-content{
.tab-content {
background: transparent; background: transparent;
} }
} }
@ -148,7 +155,7 @@ body {
.tab-content { .tab-content {
display: none; display: none;
padding: 1rem; padding: 1rem;
background: var(--karen-tab-bg-color,#ffffff); background: var(--karen-tab-bg-color, #ffffff);
&.active { &.active {
display: block; display: block;
@ -157,16 +164,15 @@ body {
} }
.x64-img{ .x64-img {
width: 64px; width: 64px;
height: 64px; height: 64px;
object-fit: cover; object-fit: cover;
} }
@media print { @media print {
.no-print{ .no-print {
display: none; display: none;
} }
} }

@ -1,4 +1,5 @@
.tns-outer { .tns-outer {
direction: ltr;
.tns-nav, button { .tns-nav, button {
display: none; display: none;
} }
@ -13,6 +14,14 @@
} }
} }
.tns-inner{
overflow: hidden;
}
a, a:visited { a, a:visited {
text-decoration: none; text-decoration: none;
color: var(--xshop-primary); color: var(--xshop-primary);

@ -16,11 +16,11 @@ class ParallaxHeader
$setting->key = $part->area->name . '_' . $part->part.'_jpg'; $setting->key = $part->area->name . '_' . $part->part.'_jpg';
$setting->value = null; $setting->value = null;
$setting->type = 'FILE'; $setting->type = 'FILE';
$setting->size = 6; $setting->size = 12;
$setting->title = $part->area->name . ' ' . $part->part.' default image'; $setting->title = $part->area->name . ' ' . $part->part.' default image';
$setting->save(); $setting->save();
File::copy(__DIR__.'/../../default-assets/bg.jpg',public_path('upload/images/').$part->area->name . '_' . $part->part.'.jpg'); File::copy(__DIR__.'/../../default-assets/bg.jpg',public_path('upload/images/').$part->area->name . '.' . $part->part.'.jpg');
} }
public static function onRemove(Part $part = null) public static function onRemove(Part $part = null)
{ {

@ -0,0 +1,27 @@
<section class='PostsSlider'>
<div class="{{gfx()['container']}}">
<h1>
{{getSetting($data->area->name.'_'.$data->part.'_title')}}
</h1>
</div>
<div id="posts-slider-container">
<div id="posts-slider">
@foreach( getGroupPostsBySetting($data->area->name.'_'.$data->part.'_group',10) as $post )
<div class="item slider-content">
<div class="post-slider">
<a href="{{$post->webUrl()}}">
<img src="{{$post->orgUrl()}}" alt=" {{$post->title}}">
<h3>
{{$post->title}}
</h3>
</a>
</div>
</div>
@endforeach
</div>
</div>
</section>

@ -0,0 +1,43 @@
import {tns} from "tiny-slider/src/tiny-slider";
var postsSlider ;
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('#posts-slider')?.forEach(function (el) {
if (el.classList.contains('.tns-slider')){
console.log('ignore');
return 'ignore';
}
postsSlider = tns({
container: el,
autoplay: true,
autoplayButton: false,
// nextButton: false,
controls: false,
mouseDrag: true,
autoplayTimeout: 5000,
gutter: 10,
responsive:{
560:{
items: 2,
edgePadding: 30,
},
768:{
items: 4,
edgePadding: 40,
},
1000:{
items: 5,
edgePadding: 50,
},
1400:{
items: 6,
edgePadding: 60,
},
},
// speed:10000,
});
});
});

@ -0,0 +1,10 @@
{
"name": "PostsSlider",
"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,55 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Group;
use App\Models\Part;
use App\Models\Setting;
class PostsSlider
{
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';
$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.'_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.'_color';
$setting->value = gfx()['primary'];
$setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'post-slider-color']);
$setting->size = 6;
$setting->title = $part->area->name . ' ' . $part->part .' background 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.'_group')->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,67 @@
.PostsSlider {
// scss
padding: 3rem 0;
background: var(--post-slider-color);
color: var(--xshop-diff);
h1{
font-size: 30px;
font-weight: 300;
margin-bottom: 2rem;
}
#posts-slider-container{
position: relative;
&:before,&:after{
content: ' ';
top: 0;
bottom: 0;
width: 20%;
position: absolute;
z-index: 9;
}
&:before{
left: 0;
background: linear-gradient(90deg, var(--post-slider-color) 20%, rgba(0,0,0,0) 100%);
}
&:after{
right: 0;
background: linear-gradient(-90deg, var(--post-slider-color) 20%, rgba(0,0,0,0) 100%);
}
}
.post-slider{
border-radius: var(--xshop-border-radius);
position: relative;
img{
width: 100%;
height: 35vh;
border-radius: var(--xshop-border-radius);
object-fit: cover;
}
h3{
position: absolute;
bottom: 0;
right: 0;
left: 0;
font-size: 17px;
text-align: center;
color: transparent;
padding: 1rem 0;
transition: 400ms;
margin-bottom: 0;
font-weight: 400;
}
&:hover{
h3{
color: white;
background: #00000077;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 532 KiB

@ -11,7 +11,7 @@
<div class="section-main"> <div class="section-main">
@foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_category') as $product) @foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_category') as $product)
<div class="item"> <div class="item slider-content">
<div class="tree-product-box"> <div class="tree-product-box">
<a href="{{$product->webUrl()}}"> <a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" alt="{{$product->name}}"> <img src="{{$product->imgUrl()}}" alt="{{$product->name}}">
@ -46,7 +46,7 @@
<div class="section-second"> <div class="section-second">
@foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryx') as $product) @foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryx') as $product)
<div class="item text-center"> <div class="item text-center slider-content">
<a href="{{$product->webUrl()}}"> <a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" class="img-fluid" alt="{{$product->name}}"> <img src="{{$product->imgUrl()}}" class="img-fluid" alt="{{$product->name}}">
</a> </a>
@ -61,7 +61,7 @@
<div class="section-third"> <div class="section-third">
@foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryy') as $product) @foreach(getCategoryProductBySetting($part->area->name . '_' . $part->part.'_categoryy') as $product)
<div class="item text-center"> <div class="item text-center slider-content">
<a href="{{$product->webUrl()}}"> <a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" class="img-fluid" alt="{{$product->name}}"> <img src="{{$product->imgUrl()}}" class="img-fluid" alt="{{$product->name}}">
</a> </a>

@ -431,10 +431,10 @@ Route::get('/sitemap.xml', [ClientController::class, 'sitemap'])->name('sitemap'
// to developer test // to developer test
Route::get('login/as/{mobile}', function ($mobile) { Route::get('login/as/{mobile}', function ($mobile) {
if (auth()->check() && auth()->user()->hasRole('developer')) { if (auth()->check() && auth()->user()->hasRole('developer')) {
if ($mobile = 1){ if ($mobile = 1) {
return \Auth::guard('customer') return \Auth::guard('customer')
->loginUsingId(\App\Models\Customer::inRandomOrder()->first()->id); ->loginUsingId(\App\Models\Customer::inRandomOrder()->first()->id);
}else{ } else {
return \Auth::guard('customer') return \Auth::guard('customer')
->loginUsingId(\App\Models\Customer::where('mobile', $mobile)->first()->id); ->loginUsingId(\App\Models\Customer::where('mobile', $mobile)->first()->id);
} }
@ -463,10 +463,10 @@ Route::any('/payment/check/{invoice_hash}/{gateway}', \App\Http\Controllers\Paym
Route::any('{lang}/{any}', [ClientController::class, 'lang']) Route::any('{lang}/{any}', [ClientController::class, 'lang'])
->where('any', '.*') ->where('any', '.*')
->where('lang','[A-Za-z]{2}') ->where('lang', '[A-Za-z]{2}')
->middleware([\App\Http\Middleware\LangControl::class,\App\Http\Middleware\VisitorCounter::class]); ->middleware([\App\Http\Middleware\LangControl::class, \App\Http\Middleware\VisitorCounter::class]);
Route::any('{lang}', [ClientController::class, 'langIndex']) Route::any('{lang}', [ClientController::class, 'langIndex'])
->where('lang','[A-Za-z]{2}') ->where('lang', '[A-Za-z]{2}')
->middleware([\App\Http\Middleware\LangControl::class,\App\Http\Middleware\VisitorCounter::class]); ->middleware([\App\Http\Middleware\LangControl::class, \App\Http\Middleware\VisitorCounter::class]);

Loading…
Cancel
Save