remove duplicated assets

added latest products theme part
fix some bugs
updated part seeder
pull/49/head
A1Gard 4 months ago
parent 5b257a3da4
commit 174775fc69

@ -72,7 +72,7 @@ class clientAssetGenerator extends Command
}
// add parts scss & js
foreach (Part::all() as $part) {
foreach (Part::distinct()->get() as $part) {
$variables .= '@import "../views/segments/' . $part->segment . '/'
. $part->part . '/' . $part->part . '";' . PHP_EOL;
$js .= 'import "../views/segments/' . $part->segment . '/'

@ -38,32 +38,39 @@ class PartSeeder extends Seeder
$part->sort = 1;
$part->save();
$part = new Part();
$part->segment = 'products';
$part->part = 'LatestProducts';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 2;
$part->save();
$part = new Part();
$part->segment = 'posts';
$part->part = 'PostsIconSimple';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 2;
$part->sort = 3;
$part->save();
$part = new Part();
$part->segment = 'index';
$part->part = 'CounterGrid';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 3;
$part->sort = 4;
$part->save();
$part = new Part();
$part->segment = 'categories';
$part->part = 'CategoriesFavImageLinks';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 4;
$part->sort = 5;
$part->save();
$part = new Part();
$part->segment = 'posts';
$part->part = 'PostIndexImage';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 5;
$part->sort = 6;
$part->save();
@ -71,7 +78,7 @@ class PartSeeder extends Seeder
$part->segment = 'footer';
$part->part = 'WaveFooter';
$part->area_id = Area::where('name', 'index')->first()->id;
$part->sort = 6;
$part->sort = 7;
$part->save();

@ -6,11 +6,32 @@
window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
import "./client-custom/assetsNode.js";
import "./client-custom/confirm.js";
import "./client-custom/customerActions.js";
import "./client-custom/login.js";
import "./client-custom/safeForm.js";
import "./client-custom/tabControll.js";
import "./client-custom/windowLoader.js";
import "../views/segments/preloader/PreloaderCircle/PreloaderCircle.js";
import "../views/segments/header/ParallaxHeaderPin/ParallaxHeaderPin.js";
import "../views/segments/group/SubGroupsGrid/SubGroupsGrid.js";
import "../views/segments/posts_page/SimplePostList/SimplePostList.js";
import "../views/segments/gallery/GallaryGrid/GallaryGrid.js";
import "../views/segments/galleries/GridGallery/GridGallery.js";
import "../views/segments/menu/RecetMenu/RecetMenu.js";
import "../views/segments/slider/SliderSimple/SliderSimple.js";
import "../views/segments/posts/PostsIconSimple/PostsIconSimple.js";
import "../views/segments/index/CounterGrid/CounterGrid.js";
import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks.js";
import "../views/segments/posts/PostIndexImage/PostIndexImage.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/card/NsCard/NsCard.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/product/ProductKaren/ProductKaren.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/header/SimpleHeader/SimpleHeader.js";
import "../views/segments/post/PostSidebar/PostSidebar.js";
import "../views/segments/footer/WaveFooter/WaveFooter.js";
import "../views/segments/products/LatestProducts/LatestProducts.js";

@ -1,17 +1,19 @@
// PLEASE DO NOT EDIT THIS FILE,
// IF YOU WANT ADD ANY CODE CREATE NEW SCSS INTO client-custom
$xshop-background:#eeeeee;
$xshop-primary:#6e0000;
$xshop-primary:#03b2b5;
$xshop-diff:#ffffff;
$xshop-secondary:#ff0000;
$xshop-diff2:#ffffff;
$xshop-secondary:#0064c2;
$xshop-text:#111111;
$xshop-border-radius:7px;
$xshop-shadow:2px 2px 4px #777777;
:root{
--xshop-background:#eeeeee;
--xshop-primary:#6e0000;
--xshop-primary:#03b2b5;
--xshop-diff:#ffffff;
--xshop-secondary:#ff0000;
--xshop-diff2:#ffffff;
--xshop-secondary:#0064c2;
--xshop-text:#111111;
--xshop-border-radius:7px;
--xshop-shadow:2px 2px 4px #777777;
@ -21,8 +23,26 @@ $xshop-shadow:2px 2px 4px #777777;
@import "client-custom/general";
@import "client-custom/zfix";
@import "../views/segments/preloader/PreloaderCircle/PreloaderCircle";
@import "../views/segments/header/ParallaxHeaderPin/ParallaxHeaderPin";
@import "../views/segments/group/SubGroupsGrid/SubGroupsGrid";
@import "../views/segments/posts_page/SimplePostList/SimplePostList";
@import "../views/segments/gallery/GallaryGrid/GallaryGrid";
@import "../views/segments/galleries/GridGallery/GridGallery";
@import "../views/segments/menu/RecetMenu/RecetMenu";
@import "../views/segments/slider/SliderSimple/SliderSimple";
@import "../views/segments/posts/PostsIconSimple/PostsIconSimple";
@import "../views/segments/index/CounterGrid/CounterGrid";
@import "../views/segments/categories/CategoriesFavImageLinks/CategoriesFavImageLinks";
@import "../views/segments/posts/PostIndexImage/PostIndexImage";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/card/NsCard/NsCard";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/products_page/ProductGridSidebar/ProductGridSidebar";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/product/ProductKaren/ProductKaren";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/posts_page/GridPostListSidebar/GridPostListSidebar";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/header/SimpleHeader/SimpleHeader";
@import "../views/segments/post/PostSidebar/PostSidebar";
@import "../views/segments/footer/WaveFooter/WaveFooter";
@import "../views/segments/products/LatestProducts/LatestProducts";

@ -20,6 +20,8 @@
top: 35%;
inset-inline-end: 10%;
font-weight: 300;
overflow: hidden;
width: 50%;
}
}

@ -1,4 +1,6 @@
document.querySelector('#rect-toggle').addEventListener('click',function (e) {
document.addEventListener('DOMContentLoaded',function () {
document.querySelector('#rect-toggle')?.addEventListener('click',function (e) {
e.preventDefault();
document.querySelector('#RecetMenu').classList.toggle('show-menu');
});
})

@ -0,0 +1,56 @@
<section class='LatestProducts'>
<div class="{{gfx()['container']}}">
<h1>
{{__("Latest products")}}
</h1>
<div class="row">
@foreach(\App\Models\Product::where('status',1)->limit(4)->get() as $product)
<div class="col-lg-3 col-md-2">
<div class="product-item">
<a class="fav-btn" data-slug="{{$product->slug}}" data-is-fav="{{$product->isFav()}}"
data-bs-custom-class="custom-tooltip"
data-bs-toggle="tooltip" data-bs-placement="auto"
title="{{__("Add to / Remove from favorites")}}">
<i class="ri-heart-line"></i>
<i class="ri-heart-fill"></i>
</a>
<a class="compare-btn" data-slug="{{$product->slug}}"
data-bs-custom-class="custom-tooltip"
data-bs-toggle="tooltip" data-bs-placement="auto"
title="{{__("Add to/ Remove from compare list")}}">
<i class="ri-scales-3-line"></i>
</a>
<a href="{{$product->webUrl()}}">
<img src="{{$product->imgUrl()}}" alt="{{$product->name}}">
<h3>
{{$product->name}}
</h3>
<div class="prices">
@if($product->hasDiscount())
<span class="old-price">
{{$product->oldPrice()}}
</span>
@endif
<span class="price">
{{$product->getPrice()}}
</span>
</div>
<div class="p-2">
<a href="{{ route('client.product-card-toggle',$product->slug) }}"
class="btn btn-outline-primary w-100 add-to-card">
<i class="ri-shopping-bag-3-line"></i>
{{__("Add to card")}}
</a>
</div>
</a>
</div>
</div>
@endforeach
</div>
<div class="p-4 text-center mt-2">
<a href="{{route('client.products')}}" class="btn btn-secondary">
{{__("All products")}}
</a>
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "LatestProducts",
"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,21 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Part;
class LatestProducts
{
public static function onAdd(Part $part = null)
{
}
public static function onRemove(Part $part = null)
{
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,90 @@
.LatestProducts {
h1{
margin-bottom: 1rem;
font-size: 27px;
font-weight: 300;
}
.product-item {
border: 1px solid silver;
box-shadow: var(--xshop-shadow);
border-radius: var(--xshop-border-radius);
position: relative;
overflow: hidden;
img{
height: 250px;
width: 100%;
object-fit: cover;
}
h3 {
margin-top: 1rem;
text-align: center;
font-size: 20px;
font-weight: 300;
color: var(--xshop-text);
}
.prices {
display: grid;
grid-auto-columns: minmax(0, 1fr);
grid-auto-flow: column;
text-align: center;
span {
display: block;
padding: .5rem;
}
.old-price{
text-decoration: red line-through;
color: gray;
}
}
.fav-btn, .compare-btn {
position: absolute;
inset-inline-start: -12%;
top: 3%;
width: 40px;
height: 40px;
background: #ffffff55;
font-size: 25px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
z-index: 4;
cursor: pointer;
transition: .4s;
&:hover {
background: var(--xshop-primary);
color: var(--xshop-diff);
}
}
.fav-btn {
top: calc(3% + 50px);
&[data-is-fav="-1"]{
display: none;
}
&[data-is-fav="1"]{
.ri-heart-line{
display: none;
}
}
&[data-is-fav="0"]{
.ri-heart-fill{
display: none;
}
}
}
&:hover {
.fav-btn, .compare-btn {
inset-inline-start: 3%;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Loading…
Cancel
Save