mirror of https://github.com/4xmen/xshop.git
Compare commits
4 Commits
8fdf482786
...
9c5f2e5158
Author | SHA1 | Date |
---|---|---|
|
9c5f2e5158 | 3 weeks ago |
|
84f09829f0 | 3 weeks ago |
|
e3a1d72bfd | 3 weeks ago |
|
0ea18cd7df | 3 weeks ago |
@ -0,0 +1,18 @@
|
|||||||
|
<section class='GridGroup live-setting' data-live="{{$data->area_name.'_'.$data->part}}">
|
||||||
|
<div class="{{gfx()['container']}}">
|
||||||
|
<div class="grid-grp-container">
|
||||||
|
@foreach(getGroupsSet($data->area_name.'_'.$data->part.'_groups') as $group)
|
||||||
|
<div class="grid-grp-item">
|
||||||
|
<i class="ri-quote-text"></i>
|
||||||
|
<a href="{{$group->webUrl()}}">
|
||||||
|
<img src="{{$group->imgUrl()}}" alt="{{$group->name}}">
|
||||||
|
<h3>
|
||||||
|
{{$group->name}}
|
||||||
|
</h3>
|
||||||
|
</a>
|
||||||
|
{{-- <img src="{{$clip->imgUrl()}}" alt="">--}}
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</section>
|
@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
"name": "GridGroup",
|
||||||
|
"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,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Resources\Views\Segments;
|
||||||
|
|
||||||
|
use App\Models\Group;
|
||||||
|
use App\Models\Part;
|
||||||
|
use App\Models\Setting;
|
||||||
|
|
||||||
|
class GridGroup
|
||||||
|
{
|
||||||
|
public static function onAdd(Part $part = null)
|
||||||
|
{
|
||||||
|
$setting = new Setting();
|
||||||
|
$setting->section = 'theme';
|
||||||
|
$setting->key = $part->area_name . '_' . $part->part.'_title';
|
||||||
|
$setting->value = "group set list";
|
||||||
|
$setting->type = 'TEXT';
|
||||||
|
$setting->size = 6;
|
||||||
|
$setting->title = $part->area_name . ' ' . $part->part;
|
||||||
|
$setting->save();
|
||||||
|
|
||||||
|
$setting = new Setting();
|
||||||
|
$setting->section = 'theme';
|
||||||
|
$setting->key = $part->area_name . '_' . $part->part.'_groups';
|
||||||
|
$setting->value = json_encode(Group::inRandomOrder()->limit(4)->pluck('id')->toArray());
|
||||||
|
$setting->type = 'GROUP_SET';
|
||||||
|
$setting->size = 6;
|
||||||
|
$setting->title = $part->area_name . ' ' . $part->part;
|
||||||
|
$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.'_groups')->first()?->delete();
|
||||||
|
|
||||||
|
}
|
||||||
|
public static function onMount(Part $part = null)
|
||||||
|
{
|
||||||
|
return $part;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,130 @@
|
|||||||
|
.GridGroup {
|
||||||
|
// scss
|
||||||
|
// scss
|
||||||
|
padding: 3rem 0;
|
||||||
|
|
||||||
|
.grid-grp-container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 10px;
|
||||||
|
grid-template-rows: repeat(2, 1fr);
|
||||||
|
height: 70vh; // Set the height of the grid
|
||||||
|
width: 100%; // Full width of the container
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-grp-item {
|
||||||
|
border-radius: var(--xshop-border-radius);
|
||||||
|
overflow: hidden;
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
i{
|
||||||
|
position: absolute;
|
||||||
|
top: 1rem;
|
||||||
|
inset-inline-end: 1rem;
|
||||||
|
z-index: 3;
|
||||||
|
padding: .3rem;
|
||||||
|
background: #ffffff66;
|
||||||
|
font-size: 30px;
|
||||||
|
display: inline-block;
|
||||||
|
border-radius: var(--xshop-border-radius);
|
||||||
|
backdrop-filter: blur(7px);
|
||||||
|
}
|
||||||
|
h3{
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
text-align: center;
|
||||||
|
background: var(--xshop-diff);
|
||||||
|
padding: 1rem;
|
||||||
|
background: #ffffff66;
|
||||||
|
color: black;
|
||||||
|
backdrop-filter: blur(7px);
|
||||||
|
opacity: 0;
|
||||||
|
transition: 400ms;
|
||||||
|
transform: translateY(-50%);
|
||||||
|
}
|
||||||
|
img {
|
||||||
|
object-fit: cover;
|
||||||
|
transition: 400ms;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
h3{
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
img{
|
||||||
|
transform: rotateZ(3deg) scale(1.3) ;
|
||||||
|
filter: contrast(1.7) grayscale(.75);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// First item (half of the grid)
|
||||||
|
&:nth-child(1) {
|
||||||
|
grid-column: 1 / 3; // Span columns 1 and 2
|
||||||
|
grid-row: 1 / 3; // First row
|
||||||
|
}
|
||||||
|
|
||||||
|
// Second item (25% width, 50% height)
|
||||||
|
&:nth-child(2) {
|
||||||
|
grid-column: 3; // Third column
|
||||||
|
grid-row: 1 / 2; // First row
|
||||||
|
}
|
||||||
|
|
||||||
|
// Third item (25% width, 50% height)
|
||||||
|
&:nth-child(3) {
|
||||||
|
grid-column: 3; // Fourth column
|
||||||
|
grid-row: 2 / 3; // First row
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fourth item (full height, 25% width)
|
||||||
|
&:nth-child(4) {
|
||||||
|
grid-column: 4; // Third column
|
||||||
|
grid-row: 1 / 3; // Second row
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*-992px width*/
|
||||||
|
@media (max-width: 992px) {
|
||||||
|
|
||||||
|
.grid-grp-container {
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 10px;
|
||||||
|
grid-template-rows: repeat(4, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
.grid-grp-item {
|
||||||
|
|
||||||
|
// First item (half of the grid)
|
||||||
|
&:nth-child(1) {
|
||||||
|
grid-column: 1 / 5; // Span columns 1 and 2
|
||||||
|
grid-row: 1 / 3; // First row
|
||||||
|
}
|
||||||
|
|
||||||
|
// Second item (25% width, 50% height)
|
||||||
|
&:nth-child(2) {
|
||||||
|
grid-column: 1 / 3; // Third column
|
||||||
|
grid-row: 3 / 4; // First row
|
||||||
|
}
|
||||||
|
|
||||||
|
// Third item (25% width, 50% height)
|
||||||
|
&:nth-child(3) {
|
||||||
|
grid-column: 1 / 3; // Fourth column
|
||||||
|
grid-row: 4 / 5; // First row
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fourth item (full height, 25% width)
|
||||||
|
&:nth-child(4) {
|
||||||
|
grid-column: 3 / 5; // Third column
|
||||||
|
grid-row: 3 / 5; // Second row
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
h3{
|
||||||
|
font-size: 17px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Binary file not shown.
After Width: | Height: | Size: 57 KiB |
Loading…
Reference in New Issue