added homayon menu theme part

master
A1Gard 3 weeks ago
parent 6707a2055d
commit 54035e8caa

@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
id="Shahabjasemi"
width="364"
height="325"
viewBox="0 0 364 325"
version="1.1"
sodipodi:docname="Central_Curve_shadow2.svg"
inkscape:version="1.2.2 (b0a8486541, 2022-12-01)"
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"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:x="adobe:ns:meta/">
<sodipodi:namedview
id="namedview1367"
pagecolor="#ffffff"
bordercolor="#000000"
borderopacity="0.25"
inkscape:showpageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:deskcolor="#d1d1d1"
showgrid="false"
inkscape:zoom="0.93338095"
inkscape:cx="7.4996174"
inkscape:cy="136.06449"
inkscape:window-width="1920"
inkscape:window-height="1020"
inkscape:window-x="0"
inkscape:window-y="32"
inkscape:window-maximized="1"
inkscape:current-layer="Shahabjasemi" />
<metadata
id="metadata1335">
<?xpacket begin="" id="W5M0MpCehiHzreSzNTczkc9d"?> <x:xmpmeta
x:xmptk="Adobe XMP Core 5.6-c142 79.160924, 2017/07/13-01:06:39 ">
<rdf:RDF>
<rdf:Description
rdf:about="" />
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?> </metadata>
<defs
id="defs1361">
<style
id="style1337">
.cls-1, .cls-2, .cls-3 {
fill: #fff;
fill-rule: evenodd;
}
.cls-1 {
filter: url(#filter);
}
.cls-2 {
filter: url(#filter-2);
}
</style>
<filter
id="filter"
x="770"
y="36"
width="364"
height="325"
filterUnits="userSpaceOnUse">
<feOffset
result="offset"
dy="10"
in="SourceAlpha"
id="feOffset1339" />
<feGaussianBlur
result="blur"
stdDeviation="5.477"
id="feGaussianBlur1341" />
<feFlood
result="flood"
flood-color="#346"
flood-opacity="0.12"
id="feFlood1343" />
<feComposite
result="composite"
operator="in"
in2="blur"
id="feComposite1345" />
<feBlend
result="blend"
in="SourceGraphic"
in2="composite"
id="feBlend1347" />
</filter>
<filter
id="filter-2"
x="786"
y="46"
width="332"
height="304"
filterUnits="userSpaceOnUse">
<feOffset
result="offset"
dy="10"
in="SourceAlpha"
id="feOffset1350" />
<feGaussianBlur
result="blur"
stdDeviation="4.472"
id="feGaussianBlur1352" />
<feFlood
result="flood"
flood-color="#346"
flood-opacity="0.1"
id="feFlood1354" />
<feComposite
result="composite"
operator="in"
in2="blur"
id="feComposite1356" />
<feBlend
result="blend"
in="SourceGraphic"
in2="composite"
id="feBlend1358" />
</filter>
</defs>
<g
id="g1489">
<path
id="Shadowholder"
class="cls-1"
d="M1104,226h-10.23c-14.83,2.746-12.32,11.245-22.77,26l-4,5,0.03-.521a133.028,133.028,0,0,1-228.063,0L839,257l-4-5c-10.444-14.745-19.925-23.246-34.735-26H799V152.927c0.83,0.035,1.659.073,2.5,0.073,22.052,0,20.53-8.69,33.5-27l0.928-1.16a133.042,133.042,0,0,1,234.142,0L1071,126c12.67,17.889,11.92,26.59,33,26.981V226Z"
transform="translate(-770 -36)" />
<path
id="Shadowfader"
class="cls-2"
d="M1090,217l-0.23,8c-14.83,2.746-9.32,11.245-19.77,26l-4,5,0.03-.521C1042.77,294.137,1001.41,320,953,320s-89.767-25.863-113.033-64.521L840,256l-4-5c-10.444-14.745-14.925-23.246-29.735-26L805,214V152.927c0.83,0.035,1.659.073,2.5,0.073,22.052,0,15.53-8.69,28.5-27l0.928-1.16C859.412,83.252,902.406,55,953,55s93.59,28.252,116.07,69.84L1070,126c12.67,17.889,6.92,26.59,28,26.981Z"
transform="translate(-770 -36)" />
<path
id="Central_Curve"
class="cls-3"
d="M1116,226h-10.23c-14.83,2.746-24.32,11.245-34.77,26l-4,5,0.03-.521a133.028,133.028,0,0,1-228.063,0L839,257l-4-5c-10.444-14.745-19.925-23.246-34.735-26H786V152.927c0.83,0.035,1.659.073,2.5,0.073,22.052,0,33.53-8.69,46.5-27l0.928-1.16a133.042,133.042,0,0,1,234.142,0L1071,126c12.67,17.889,23.92,26.59,45,26.981V226Z"
transform="translate(-770 -36)" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

@ -64,7 +64,7 @@
<div class="address mt-3" > <div class="address mt-3" >
<div class="address-box"> <div class="address-box">
<h4> <h4>
{{getSetting($data->area_name.'_'.$data->part.'_title')}}{{getSetting($data->area_name.'_'.$data->part.'_titl')}} {{getSetting($data->area_name.'_'.$data->part.'_title')}}
</h4> </h4>
<p> <p>

@ -0,0 +1,134 @@
<header class='HomayonMenu'>
<div class="homayon-logo"
style="background-image: url('{{asset('upload/images/'.$data->area_name.'.'.$data->part.'.svg')}}')">
<div class="logo-container">
<img src="{{asset('upload/images/logo.png')}}" alt="logo">
</div>
</div>
<div class="homayon-top">
<div class="container">
<div class="row pt-4">
<div class="col-6">
<ul class="social mt-5">
@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-6 text-end">
<a href="{{route('client.products')}}" class="btn btn-primary mt-5">
{{getSetting($data->area_name.'_'.$data->part.'_title')}}
</a>
</div>
</div>
</div>
</div>
<div class="container homayon-middle">
<ul>
<li id="homa-toggle-menu" class="icon-menu ms-auto">
<a href="#">
<i class="ri-menu-line"></i>
</a>
</li>
<li class="icon-menu">
<a data-bs-toggle="modal" data-bs-target="#homa-search">
<i class="ri-search-line"></i>
</a>
</li>
@if(auth('customer')->check())
<li class="icon-menu">
<a href="{{route('client.profile')}}">
<i class="ri-user-line"></i>
</a>
</li>
@else
<li class="icon-menu">
<a href="{{route('client.sign-in')}}">
<i class="ri-user-line"></i>
</a>
</li>
@endif
<li class="icon-menu">
<a href="{{route('client.card')}}">
<i class="ri-shopping-bag-2-line"></i>
<span class="badge bg-danger card-count">
@if(cardCount() > 0)
{{cardCount()}}
@endif
</span>
</a>
</li>
</ul>
</div>
<div class="homayon-bottom">
<div class="container">
<nav>
<ul>
@php($items = getMenuBySetting($data->area_name.'_'.$data->part.'_menu')->items)
@php($menuShow = false)
@foreach($items as $i => $item)
{{-- find center --}}
@if(!$menuShow && ($i > (count($items) / 2) -1 ) )
@php($menuShow = true)
<li class="homayon-divider">
&nbsp;
</li>
@endif
<li>
<a href="{{$item->webUrl()}}">
{{$item->title}}
</a>
</li>
@endforeach
</ul>
</nav>
</div>
</div>
<nav class="homayon-resp-menu" style="display: none">
<ul >
@foreach(getMenuBySettingItems($data->area_name.'_'.$data->part.'_menu') as $item)
<li>
<a href="{{$item->webUrl()}}">
{{$item->title}}
</a>
</li>
@endforeach
</ul>
</nav>
</header>
<!-- Modal -->
<div class="modal fade" id="homa-search" tabindex="-1" aria-labelledby="apl-search" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title fs-5" id="apl-search">
{{__("Search")}}
</h4>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{route('client.search')}}" class="side-data">
<div class="input-group mb-3">
<input type="search" name="q" class="form-control" placeholder="{{__('Search')}}...">
<button class="btn btn-outline-secondary" type="submit" id="button-addon2">
<i class="ri-search-2-line"></i>
</button>
</div>
</form>
</div>
{{-- <div class="modal-footer">--}}
{{-- <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>--}}
{{-- </div>--}}
</div>
</div>
</div>

@ -0,0 +1,26 @@
const scrollBreakpoint = window.innerHeight * 0.2;
let fixmenu = function () {
if (window.scrollY > scrollBreakpoint){
document.querySelector('.HomayonMenu').classList.add('fix');
document.querySelector('.HomayonMenu').querySelector('.homayon-middle').classList.remove('container');
}else{
document.querySelector('.HomayonMenu').classList.remove('fix')
document.querySelector('.HomayonMenu').querySelector('.homayon-middle').classList.add('container');
}
}
window.addEventListener('scroll',fixmenu);
fixmenu();
const toggleSideMenu = function (e) {
e.preventDefault();
if (document.querySelector('.homayon-resp-menu').style.display == 'none'){
document.querySelector('.homayon-resp-menu').style.display = 'block';
}else{
document.querySelector('.homayon-resp-menu').style.display = 'none';
}
};
document.addEventListener('DOMContentLoaded',function () {
document.querySelector('#homa-toggle-menu')?.addEventListener('click',toggleSideMenu);
});

@ -0,0 +1,10 @@
{
"name": "HomayonMenu",
"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,74 @@
<?php
namespace Resources\Views\Segments;
use App\Models\Menu;
use App\Models\Part;
use App\Models\Setting;
use Illuminate\Support\Facades\File;
class HomayonMenu
{
public static function onAdd(Part $part = null)
{
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_title';
$setting->value = __("Shop");
$setting->size = 6;
$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.'_menu';
$setting->value = Menu::first()->id;
$setting->type = 'MENU';
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' menu';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_bg';
$setting->value = '#dddddd';
$setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'homayon-bg']);
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' background color';
$setting->save();
$setting = new Setting();
$setting->section = 'theme';
$setting->key = $part->area_name . '_' . $part->part.'_bg2';
$setting->value = gfx()['primary'];
$setting->type = 'COLOR';
$setting->data = json_encode(['name' => 'homayon-bg-menu']);
$setting->size = 6;
$setting->title = $part->area_name . ' ' . $part->part .' background color';
$setting->save();
File::copy(__DIR__.'/../../default-assets/header-circle.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.'_title')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_bg')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_bg2')->first()?->delete();
Setting::where('key',$part->area_name . '_' . $part->part.'_menu')->first()?->delete();
}
public static function onMount(Part $part = null)
{
return $part;
}
}

@ -0,0 +1,225 @@
.HomayonMenu {
// scss
position: relative;
z-index: 999;
transition: 400ms;
.homayon-top {
background: var(--homayon-bg);
height: 10rem;
}
.social {
i {
font-size: 25px;
}
}
.homayon-middle {
margin-top: -35px;
margin-bottom: -40px;
background: #ffffff;
padding: 1.15rem;
border-radius: 75px;
ul {
padding: 0;
margin: 0;
list-style: none;
display: flex;
li {
padding: 0 1rem;
color: var(--xshop-primary);
width: 55px;
}
a {
position: relative;
.badge {
position: absolute;
top: -10px;
left: -15px;
}
}
i {
font-size: 25px;
}
#homa-toggle-menu {
display: none;
}
}
}
.homayon-logo {
text-align: center;
width: 365px;
height: 325px;
position: absolute;
left: 50%;
transform: translateX(-50%);
top: 9px;
.logo-container {
background: var(--homayon-bg);
margin: 40px auto;
border-radius: 50%;
width: 220px;
height: 220px;
display: flex;
align-items: center;
justify-content: center;
}
img {
width: 128px;
}
}
.homayon-bottom {
margin-top: 40px;
margin-bottom: -105px;
nav {
padding: 0 2rem;
}
ul {
display: flex;
justify-content: space-between;
list-style: none;
text-align: center;
overflow: hidden;
background: var(--homayon-bg-menu);
border-bottom-right-radius: 35px;
border-bottom-left-radius: 35px;
li {
transition: 500ms;
flex: 1;
a {
padding: .75rem;
display: block;
}
}
.homayon-divider {
flex-grow: 3;
}
}
a {
color: var(--xshop-diff);
position: relative;
&:after {
transition: 700ms;
opacity: 0;
content: ' ';
background: var(--xshop-diff);
left: 1rem;
right: 1rem;
position: absolute;
top: 0;
bottom: 0;
transform: skew(35deg, 0deg);
}
&:hover {
&:after {
content: ' ';
background: var(--xshop-diff);
opacity: .3;
left: 1rem;
right: 1rem;
position: absolute;
top: 0;
bottom: 0;
transform: skew(35deg, 0deg);
}
}
}
}
/*-875px width*/
@media (max-width: 875px) {
ul {
flex-direction: row-reverse;
}
#homa-toggle-menu {
display: block !important;
}
.homayon-bottom {
display: none;
}
}
&.fix {
position: fixed;
left: 0;
right: 0;
top: 0;
z-index: 999;
.homayon-top {
display: none;
}
.homayon-middle {
margin-top: 0;
border-radius: 0;
}
.homayon-logo {
top: -118px;
}
.logo-container {
background: transparent;
img {
width: 75px;
margin-top: 75px;
}
}
/*-875px width*/
@media (max-width: 875px) {
.homayon-logo {
background: none !important;
img{
width: 40px;
margin-top: 5px;
}
}
}
}
.homayon-resp-menu{
display: none;
position: fixed;
overflow-y: auto;
background: var(--homayon-bg);
top: 73px;
width: 200px;
bottom: 0;
z-index: 77;
inset-inline-end: 0;
ul{
padding-top: .5rem;
list-style: none;
a{
display: block;
padding: .5rem;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 91 KiB

Loading…
Cancel
Save