From 12e5dbb721ecb44c2a0c76259bf0860605b28277 Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Sun, 5 Feb 2023 21:40:05 +0100 Subject: [PATCH] enhance css --- Gruntfile.js | 1 - .../Admin/Shop/OrderController.php | 5 + .../Controllers/Shop/CategoryController.php | 4 + app/Http/Controllers/Shop/HomeController.php | 3 + .../Controllers/Shop/PayboxController.php | 1 + app/Repositories/Core/Arrays.php | 46 +++ app/Repositories/Shop/Orders.php | 6 + build/css/shadow.css | 4 +- build/css/site.css | 122 +++++++- build/css/site2.css | 281 ++++++++++++++++++ .../partials/sliderByShelve.blade.php | 2 +- resources/views/Shop/home.blade.php | 4 +- .../layout/partials/header-basket.blade.php | 30 +- .../layout/partials/header-catalog.blade.php | 5 + .../Shop/layout/partials/header-nav.blade.php | 11 +- .../layout/partials/header-profile.blade.php | 75 +++-- .../Shop/layout/partials/header.blade.php | 2 +- .../Shop/layout/partials/megamenu.blade.php | 35 ++- .../layout/partials/megamenu_leafs.blade.php | 8 +- .../Shop/layout/partials/search.blade.php | 12 - .../Shop/layout/partials/sections.blade.php | 17 +- 21 files changed, 553 insertions(+), 121 deletions(-) create mode 100644 build/css/site2.css create mode 100644 resources/views/Shop/layout/partials/header-catalog.blade.php diff --git a/Gruntfile.js b/Gruntfile.js index 797a9101..6bfb990c 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -28,7 +28,6 @@ var cssSite = [ 'node_modules/animate.css/animate.min.css', 'node_modules/icheck-bootstrap/icheck-bootstrap.min.css', 'build/js/plugins/smooth_products/css/smoothproducts.css', - 'build/css/shadow.css', 'build/css/site.css', ] diff --git a/app/Http/Controllers/Admin/Shop/OrderController.php b/app/Http/Controllers/Admin/Shop/OrderController.php index 473d91e2..8b1c5aed 100644 --- a/app/Http/Controllers/Admin/Shop/OrderController.php +++ b/app/Http/Controllers/Admin/Shop/OrderController.php @@ -42,4 +42,9 @@ class OrderController extends Controller { return Orders::delete($id); } + + public function download($id) + { + return Orders::download($id); + } } diff --git a/app/Http/Controllers/Shop/CategoryController.php b/app/Http/Controllers/Shop/CategoryController.php index 32dac31b..b039b2aa 100644 --- a/app/Http/Controllers/Shop/CategoryController.php +++ b/app/Http/Controllers/Shop/CategoryController.php @@ -29,6 +29,10 @@ class CategoryController extends Controller $product_type = 'botanic'; $article_nature_id = 2; break; + case 'legumes': + $product_type = 'botanic'; + $article_nature_id = 3; + break; default: $product_type = 'botanic'; $article_nature_id = 1; diff --git a/app/Http/Controllers/Shop/HomeController.php b/app/Http/Controllers/Shop/HomeController.php index 9904d240..99dc2d9e 100644 --- a/app/Http/Controllers/Shop/HomeController.php +++ b/app/Http/Controllers/Shop/HomeController.php @@ -9,6 +9,9 @@ use App\Repositories\Shop\Articles; use App\Repositories\Shop\TagGroups; use App\Repositories\Shop\Homepages; +use App\Repositories\Config; +use App\Repositories\Core\Arrays; + class HomeController extends Controller { public function index(Request $request) diff --git a/app/Http/Controllers/Shop/PayboxController.php b/app/Http/Controllers/Shop/PayboxController.php index 83b7cbc9..f2596efa 100644 --- a/app/Http/Controllers/Shop/PayboxController.php +++ b/app/Http/Controllers/Shop/PayboxController.php @@ -31,6 +31,7 @@ class PayboxController extends Controller public function process(Request $request) { dump($request); + exit; return view('paybox.send'); } } diff --git a/app/Repositories/Core/Arrays.php b/app/Repositories/Core/Arrays.php index a605fae9..2960f0d7 100644 --- a/app/Repositories/Core/Arrays.php +++ b/app/Repositories/Core/Arrays.php @@ -16,4 +16,50 @@ class Arrays unset($array[$oldkey]); return $array; } + + public static function slotify($array, $length) + { + // Create a placeholder array and calculate the number of items + // needed per slot (think card dealing LtoR). + for ($slots = array_fill(0, $length, 0), $count = count($array), $i = 0; $i < $count; $slots[$i % $length]++, $i++); + + // Now just take slices of the original array + // depending on the calculated slot number and place in our slots + foreach ($slots as $k => $n) { + $slots[$k] = array_splice($array, 0, $n); + } + + return $slots; + } + + public static function alternate_chunk($array, $parts) + { + $t = 0; + $result = array(); + $max = ceil(count($array) / $parts); + foreach (array_chunk($array, $max) as $v) { + if ($t < $parts) { + $result[] = $v; + } else { + foreach ($v as $d) { + $result[] = array($d); + } + } + $t += count($v); + } + return $result; + } + + + public static function fill_chunk($array, $parts) + { + $t = 0; + $result = array_fill(0, $parts - 1, array()); + $max = ceil(count($array) / $parts); + foreach ($array as $v) { + count($result[$t]) >= $max and $t ++; + $result[$t][] = $v; + } + return $result; + } } diff --git a/app/Repositories/Shop/Orders.php b/app/Repositories/Shop/Orders.php index d904aac2..91f7aa3b 100644 --- a/app/Repositories/Shop/Orders.php +++ b/app/Repositories/Shop/Orders.php @@ -86,6 +86,12 @@ class Orders return Order::destroy($id); } + public static function download($id) + { + dump($id); + exit; + } + public static function getStatus($id) { return self::statuses()[$id] ?? false; diff --git a/build/css/shadow.css b/build/css/shadow.css index 45835441..06462339 100644 --- a/build/css/shadow.css +++ b/build/css/shadow.css @@ -4,9 +4,7 @@ float:left; width:100%; background:#fff; - -webkit-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - -moz-box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; - box-shadow:0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset; + box-shadow: 0px 10px 21px #344f17; } .drop-shadow:before, diff --git a/build/css/site.css b/build/css/site.css index a1c1950a..884e7ed9 100644 --- a/build/css/site.css +++ b/build/css/site.css @@ -1,16 +1,64 @@ body { font-family: 'noto_sanscondensed', sans-serif; - /* line-height: 1em!important; */ - /* - background-image: linear-gradient(to right top, #1d382e, #234236, #2a4d3d, #315745, #39624c, #3a634d, #3a654d, #3b664e, #355e48, #2f5543, #2a4d3d, #254537); - */ - background: rgb(52,91,71); background: linear-gradient(180deg, rgba(52,91,71,1) 0%, rgba(45,81,63,1) 10%, rgba(24,48,39,1) 90%, rgba(28,54,45,1) 100%); background-size: cover; background-attachment: fixed; } +.h1, h1 { + font-size: 2.5rem; + color: #527C39; + margin-bottom: .5rem; + font-weight: 500; + line-height: 1.2; +} + +.h2, h2 { + font-size: 2rem; + color: #527C39; +} + +.h3, h3 { + font-size: 1.75rem; + color: #527c39; + margin-bottom: .5rem; + font-weight: 500; + line-height: 1.2; + margin-top: 0; +} + +.h4, h4 { + font-size: 1.2rem; + font-weight: bold; + color: #527C39; + text-transform: uppercase; +} + +p { + margin-top: 0; + margin-bottom: 1rem; + color: #344f17; +} + +a { + color: #669d48; + text-decoration: none; +} + +a:hover, a:focus { + color: #527C39; + font-weight: bold; +} + +a.active { + color: #F2B90F; +} + +.card-body { + background-color: #eeeee8; +} + label { margin-top: 0.5rem; } @@ -39,6 +87,10 @@ label { background-color: #335012; } +a.nav-link { + color: #FFF; +} + .bg-green-ultra-dark { background: linear-gradient(to left top, #102723, #112723, #122724, #122724, #132724); color: #a5b94f; @@ -53,7 +105,7 @@ label { } .bg-green-light { - background-color: #F1F7EE; + background-color: #f3f8f1; } .green { @@ -64,28 +116,41 @@ a.green { color: #517C39 !important; } -.green-dark { +.green-dark, a.green-dark { color: #335012; } a.green-dark:hover { color: #335012; - font-weight: 900; text-decoration: none; text-shadow: 4px black; } +.btn-success { + color: #fff; + border-color: #527c39; + background-color: #527c39; +} + +.btn-success:hover { + color: #fff; + border-color: #669d48; + background-color: #669d48; +} + +.btn-link { + color: #527c39; +} + .btn-green-dark { color: #fff; - background-color: #335012; - border-color: #28a745; + background-color: #344f17; + border: 1px solid #527C39; } -.btn-green-dark a:hover { - color: #fff; - font-weight: 900; - text-decoration: none; - text-shadow: 4px black; +.btn-green-dark:hover { + color: #335012; + background-color: #f1f7ee; } .green-light { @@ -128,6 +193,33 @@ a.green-dark:hover { width: 100% } +#navbarContent > ul > li:hover { + background-color: #F2B90F!important; +} + +#navbarContent > ul > li:hover > a { + color: #335012!important; +} + +.shadow2 { + box-shadow: 0px 10px 21px #344f17; +} + +div.megamenu ul.megamenu a, div#megamenu ul.megamenu span.separator +{ + color: #517C39; + font-family: 'noto_sanscondensed', "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: 0.05em; + font-weight: normal; +} + +div.megamenu ul.megamenu li.megamenu.level1 +{ + list-style: none; + text-align: left; + cursor: pointer; +} + .slick-prev:before, .slick-next:before { color: #335012!important; } diff --git a/build/css/site2.css b/build/css/site2.css new file mode 100644 index 00000000..9e6cf74a --- /dev/null +++ b/build/css/site2.css @@ -0,0 +1,281 @@ +body { + font-family: 'noto_sanscondensed', sans-serif; + /* line-height: 1em!important; */ + /* + background-image: linear-gradient(to right top, #1d382e, #234236, #2a4d3d, #315745, #39624c, #3a634d, #3a654d, #3b664e, #355e48, #2f5543, #2a4d3d, #254537); + */ + + background: rgb(52,91,71); + background: linear-gradient(180deg, rgba(52,91,71,1) 0%, rgba(45,81,63,1) 10%, rgba(24,48,39,1) 90%, rgba(28,54,45,1) 100%); + background-size: cover; + background-attachment: fixed; +} + +.h1, h1 { + font-size: 2.5rem; + color: #527C39; + margin-bottom: .5rem; + font-weight: 500; + line-height: 1.2; +} + +.h2, h2 { + font-size: 2rem; + color: #527C39; +} + +.h3, h3 { + font-size: 1.75rem; + color: #527c39; + margin-bottom: .5rem; + font-weight: 500; + line-height: 1.2; + margin-top: 0; +} + +.h4, h4 { + font-size: 1.2rem; + font-weight: bold; + color: #527C39; + text-transform: uppercase; +} + +p { + margin-top: 0; + margin-bottom: 1rem; + color: #344f17; +} + +a { + color: #669d48; + text-decoration: none; +} + +a:hover, a:focus { + color: #527C39; + font-weight: bold; +} + +a.active { + color: #F2B90F; +} + +.card-body { + background-color: #eeeee8; +} + +label { + margin-top: 0.5rem; +} + +.gradient-green1 { + background: linear-gradient(to right top, #395339, #3c573a, #3f5b3c, #425f3d, #45633e); +} + +.gradient-green2 { + background: linear-gradient(to right top, #2c5f45, #25503c, #1e4233, #19342a, #142620); +} + +.gradient-yellow1 { + background-image: linear-gradient(to left top, #efeac9, #e3dcb8, #d7cea6, #cbc196, #bfb385); +} + +.content-wrapper { + min-height: calc(100vh - 340px); +} + +.bg-green { + background-color: #517C39; +} + +.bg-green-dark { + background-color: #335012; +} + +.bg-green-ultra-dark { + background: linear-gradient(to left top, #102723, #112723, #122724, #122724, #132724); + color: #a5b94f; +} + +.bg-green-ultra-dark a { + color: #a5b94f; +} + +.green-fluo { + color: #a5b94f!important; +} + +.bg-green-light { + background-color: #F1F7EE; +} + +.green { + color: #517C39; +} + +a.green { + color: #517C39 !important; +} + +.green-dark, a.green-dark { + color: #335012!important; +} + +a.green-dark:hover { + color: #335012; + font-weight: 900; + text-decoration: none; + text-shadow: 4px black; +} + +.btn-success { + color: #fff; + border-color: #527c39; + background-color: #527c39; +} + +.btn-success:hover { + color: #fff; + border-color: #669d48; + background-color: #669d48; +} + +.btn-link { + color: #527c39; +} + +.btn-green-dark { + color: #fff; + background-color: #344f17; + border: 1px solid #527C39; +} + +.btn-green-dark:hover { + color: #335012; + background-color: #f1f7ee; +} + +.green-light { + color: #F1F7EE; +} + +.bg-yellow { + background-color: transparent; +} + +.bg-yellow-light { + background-color: #f9e7b4; +} + +.bg-grey { + background-color: #AAA; +} + +.yellow { + color: #e5c551; +} + +.yellow2 { + color: #F2B90F; +} + +.light { + color: #F5F5F5; +} + +.nav-item:hover { + color: #f2c64b; + text-shadow: 0px 1px 0px #5b8a3c; +} + +.megamenu .dropdown-menu { + background: none; + border: none; + width: 100%; +} + +div.megamenu ul.megamenu a, div#megamenu ul.megamenu span.separator +{ + color: #517C39; + font-family: 'noto_sanscondensed', "Helvetica Neue", Helvetica, Arial, sans-serif; + letter-spacing: 0.05em; + font-weight: normal; +} + +div.megamenu ul.megamenu li.megamenu.level1 +{ + list-style: none; + text-align: left; + cursor: pointer; +} + +.slick-prev:before, .slick-next:before { + color: #335012!important; +} + +@font-face { + font-family: 'noto_sanscondensed'; + src: url('/fonts/notosans-condensed/notosans-condensed-webfont.eot'); + src: url('/fonts/notosans-condensed/notosans-condensed-webfont.eot?#iefix') format('embedded-opentype'), + url('/fonts/notosans-condensed/notosans-condensed-webfont.woff2') format('woff2'), + url('/fonts/notosans-condensed/notosans-condensed-webfont.woff') format('woff'), + url('/fonts/notosans-condensed/notosans-condensed-webfont.ttf') format('truetype'), + url('/fonts/notosans-condensed/notosans-condensed-webfont.svg#noto_sanscondensed') format('svg'); + font-weight: normal; + font-style: normal; +} + +@media (min-width: 992px){ + .dropdown-menu .dropdown-toggle:after{ + border-top: .3em solid transparent; + border-right: 0; + border-bottom: .3em solid transparent; + border-left: .3em solid; + } + .dropdown-menu .dropdown-menu{ + margin-left:0; margin-right: 0; + } + .dropdown-menu li{ + position: relative; + } + .nav-item .submenu{ + display: none; + position: absolute; + left:100%; top:-7px; + } + .nav-item .submenu-left{ + right:100%; left:auto; + } + .dropdown-menu > li:hover{ background-color: #f1f1f1 } + .dropdown-menu > li:hover > .submenu{ + display: block; + } +} + +.btn-rectangle { + box-shadow: 0px 10px 14px -7px #3e7327; + background-color:#344f17 ; + border-radius:5px; + border:1px solid #527C39; + display:inline-block; + cursor:pointer; + color:#fff; + font-size: 112.5%; + line-height: 1.5; + font-weight:normal; + padding: 1em 2em 1em 2em; + text-decoration:none; + margin: 4px; + text-transform: uppercase; + letter-spacing: 1px; +} +.btn-rectangle:hover { + background-color : #f1f7ee; + color:#527C39 ; +} + +.btn:hover { + color: #335012; + text-decoration: none; + background-color: #f1f7ee; + } \ No newline at end of file diff --git a/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php b/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php index eee3e8fb..d7518d20 100644 --- a/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php +++ b/resources/views/Shop/Homepage/partials/sliderByShelve.blade.php @@ -1,5 +1,5 @@ @if ($shelve['articles']) -
+

{{ $shelve['name'] }}

diff --git a/resources/views/Shop/home.blade.php b/resources/views/Shop/home.blade.php index e6127831..3baaa44b 100644 --- a/resources/views/Shop/home.blade.php +++ b/resources/views/Shop/home.blade.php @@ -7,12 +7,12 @@ @if (!empty($text))
-
{!! $text !!}
+
{!! $text !!}
@endif
-
+
@foreach ($shelves as $shelve) @include('Shop.Homepage.partials.sliderByShelve') @endforeach diff --git a/resources/views/Shop/layout/partials/header-basket.blade.php b/resources/views/Shop/layout/partials/header-basket.blade.php index 94964971..91149bd7 100644 --- a/resources/views/Shop/layout/partials/header-basket.blade.php +++ b/resources/views/Shop/layout/partials/header-basket.blade.php @@ -1,17 +1,13 @@ - + + + diff --git a/resources/views/Shop/layout/partials/header-catalog.blade.php b/resources/views/Shop/layout/partials/header-catalog.blade.php new file mode 100644 index 00000000..b55efdad --- /dev/null +++ b/resources/views/Shop/layout/partials/header-catalog.blade.php @@ -0,0 +1,5 @@ + + + diff --git a/resources/views/Shop/layout/partials/header-nav.blade.php b/resources/views/Shop/layout/partials/header-nav.blade.php index 52dcfbde..0a4f9f76 100644 --- a/resources/views/Shop/layout/partials/header-nav.blade.php +++ b/resources/views/Shop/layout/partials/header-nav.blade.php @@ -1,18 +1,17 @@
-
+
+ Variétés Paysannes de la Semence à l'Assiette
-
+
@include("Shop.layout.partials.search")
-
+
+ @include('Shop.layout.partials.header-catalog') @include("Shop.layout.partials.header-profile") -
- -
@include("Shop.layout.partials.header-basket")
diff --git a/resources/views/Shop/layout/partials/header-profile.blade.php b/resources/views/Shop/layout/partials/header-profile.blade.php index ce9610ba..f718df12 100644 --- a/resources/views/Shop/layout/partials/header-profile.blade.php +++ b/resources/views/Shop/layout/partials/header-profile.blade.php @@ -1,43 +1,38 @@ -
-
- + -
-
+ + @else + + + @endif + diff --git a/resources/views/Shop/layout/partials/header.blade.php b/resources/views/Shop/layout/partials/header.blade.php index 2c890089..21cb5855 100644 --- a/resources/views/Shop/layout/partials/header.blade.php +++ b/resources/views/Shop/layout/partials/header.blade.php @@ -1,4 +1,4 @@ -