added port modern posts theme part

master
A1Gard 1 month ago
parent 6f1b9ed1e6
commit 84ac62409e

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="169mm"
height="169mm"
viewBox="0 0 169 169"
version="1.1"
id="svg5"
xml:space="preserve"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
sodipodi:docname="mask.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="0.54047838"
inkscape:cx="821.49447"
inkscape:cy="288.63319"
inkscape:window-width="1920"
inkscape:window-height="1020"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" /><defs
id="defs2" /><g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"><path
style="fill:#eeeeee;stroke-width:0.264583"
d="M 0.03740046,84.421334 V 0.01925433 H 84.704071 169.37074 V 84.421334 168.82343 H 84.704071 0.03740046 Z M 70.284281,159.98515 c 1.78515,-0.49298 2.8038,-0.95107 6.00683,-2.7013 1.49843,-0.81878 11.17786,-6.07218 21.50984,-11.67421 10.331969,-5.60203 22.297759,-12.09198 26.590619,-14.42211 4.29286,-2.33013 10.48411,-5.69065 13.75833,-7.46782 3.27422,-1.77718 8.33438,-4.52164 11.24479,-6.0988 5.91943,-3.20775 6.6566,-3.68834 8.29003,-5.40457 2.49094,-2.61719 3.74852,-5.91538 3.74852,-9.83105 0,-3.334246 -0.63024,-5.039226 -4.48863,-12.143126 -1.85739,-3.41974 -5.28208,-9.73005 -7.61043,-14.02291 -2.32834,-4.29287 -6.13894,-11.31755 -8.468,-15.61042 -2.32906,-4.29286 -8.84876,-16.31818 -14.48823,-26.72291 -5.63947,-10.40474 -10.66819,-19.54425 -11.17495,-20.31003 -1.63832,-2.47572 -4.32508,-4.3913107 -7.55667,-5.3877007 -1.4943,-0.46074 -2.27271,-0.53398 -4.6302,-0.43562 -3.382082,0.1411 -4.418812,0.47037 -8.522479,2.7066907 -3.00246,1.63622 -9.67979,5.26174 -15.61042,8.47583 -1.67349,0.90695 -5.18583,2.81195 -7.8052,4.23333 -2.61938,1.42139 -6.13172,3.32639 -7.80521,4.23334 -1.67349,0.90694 -5.18584,2.81194 -7.80521,4.23333 -2.61938,1.42139 -6.13172,3.32639 -7.80521,4.23333 -1.67349,0.90694 -5.1263,2.78078 -7.67291,4.16408 -5.36672,2.91515 -12.67295,6.87549 -17.5948,9.53724 -7.15711,3.8706 -8.19782,4.52061 -9.67687,6.04405 -2.70082,2.78188 -3.9491704,5.97365 -3.9491704,10.09721 0,3.12317 0.6408,4.96691 3.6755904,10.57557 1.31925,2.43812 3.96569,7.31968 5.88098,10.84791 4.76287,8.77387 10.55007,19.442406 23.64505,43.588946 1.77565,3.27421 4.93389,9.10828 7.01829,12.96458 4.85528,8.98258 5.97452,10.88859 7.12644,12.13592 1.86112,2.01527 4.189,3.44921 6.69497,4.12401 1.79716,0.48393 5.78477,0.50378 7.47431,0.0372 z"
id="path436" /></g></svg>

After

Width:  |  Height:  |  Size: 3.0 KiB

@ -0,0 +1,25 @@
<section class='PostModernPosts'>
<div class="{{gfx()['container']}}">
<h1>
{{getSetting($data->area_name.'_'.$data->part.'_title')}}
</h1>
<div class="row">
@foreach( getGroupPostsBySetting($data->area_name.'_'.$data->part.'_group',4) as $post )
<div class="col-lg-3 col-md-6">
<a href="{{$post->webUrl()}}">
<div class="post-modern-post" style="background-image: url('{{$post->imgUrl()}}')">
<img src="{{asset('upload/images/'.$data->area_name.'.'.$data->part.'.svg')}}"
class="img-fluid" alt="">
</div>
<h4>
{{$post->title}}
</h4>
</a>
</div>
@endforeach
</div>
</div>
</section>

@ -0,0 +1,10 @@
{
"name": "PostModernPosts",
"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,73 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Group;
use App\Models\Part;
use App\Models\Setting;
use Illuminate\Support\Facades\File;
class PostModernPosts
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_title';
$setting->value = __("Hello world");
$setting->size = 12;
$setting->type = 'TEXT';
// $setting->data = json_encode(['xmin' => 2, 'xmax' => 90]);
$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 = 4;
$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.'_bg';
$setting->value = '#eeeeee';
$setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'post-modern-bg']);
$setting->size = 4;
$setting->title = $part->area_name . ' ' . $part->part .' background color';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_color';
$setting->value = gfx()['secondary'];
$setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'post-modern-color']);
$setting->size = 4;
$setting->title = $part->area_name . ' ' . $part->part .' text color';
$setting->save();
File::copy(__DIR__.'/../../default-assets/mask-post-modern.svg',public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg');
}
public static function onRemove(Part $part = null)
{
Setting::where('key',$part->area_name . '_' . $part->part.'_group')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_title')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_bg')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_color')->first()?->delete();
}
public static function onMount(Part $part = null)
{
$data = file_get_contents(public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg');
$data = str_replace('fill:#eeeeee','fill:'.getSetting($part->area_name.'_'.$part->part.'_bg'),$data);
file_put_contents(public_path('upload/images/').$part->area_name . '.' . $part->part.'.svg',$data);
return $part;
}
}

@ -0,0 +1,21 @@
.PostModernPosts {
// scss
h1{
font-size: 34px;
font-weight: 300;
text-align: center;
}
background: var(--post-modern-bg);
padding: 4rem 0;
.post-modern-post{
}
h4{
background: var(--post-modern-bg);
padding: 1rem;
margin-top: -3px;
text-align: center;
color: var(--post-modern-color);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 KiB

Loading…
Cancel
Save