From 740e24d2feb750bce4a042d4c9a2dfceaa651c80 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 10 Sep 2019 18:20:04 +0200 Subject: [PATCH] wip #2752 @3 --- .env.production | 4 +- .env.staging | 4 +- resources/js/home.js | 1 - resources/js/logowall.js | 41 +++++++++++++++++++++ resources/styles/components/logowall.styl | 21 +++++++++++ resources/views/pages/aboutus.blade.php | 5 +++ resources/views/pages/home.blade.php | 10 ++--- resources/views/partials/logowall.blade.php | 28 ++++++++++++++ webpack.mix.js | 3 +- 9 files changed, 104 insertions(+), 13 deletions(-) delete mode 100644 resources/js/home.js create mode 100644 resources/js/logowall.js create mode 100644 resources/styles/components/logowall.styl create mode 100644 resources/views/partials/logowall.blade.php diff --git a/.env.production b/.env.production index 0e25ba7..86ca6d2 100644 --- a/.env.production +++ b/.env.production @@ -59,5 +59,5 @@ FEATURE_NEWS=true FEATURE_SEARCH=true FEATURE_I18N=false FEATURE_TEAM=false -FEATURE_CLIENTS=false -FEATURE_PARTNERS=false +FEATURE_CLIENTS=true +FEATURE_PARTNERS=true diff --git a/.env.staging b/.env.staging index e5fed56..e29a749 100644 --- a/.env.staging +++ b/.env.staging @@ -58,6 +58,6 @@ FEATURE_NEWS=true FEATURE_SEARCH=true FEATURE_I18N=false FEATURE_TEAM=false -FEATURE_CLIENTS=false -FEATURE_PARTNERS=false +FEATURE_CLIENTS=true +FEATURE_PARTNERS=true diff --git a/resources/js/home.js b/resources/js/home.js deleted file mode 100644 index 2232cdf..0000000 --- a/resources/js/home.js +++ /dev/null @@ -1 +0,0 @@ -require('./carrousel'); diff --git a/resources/js/logowall.js b/resources/js/logowall.js new file mode 100644 index 0000000..894618b --- /dev/null +++ b/resources/js/logowall.js @@ -0,0 +1,41 @@ +document.addEventListener('DOMContentLoaded', function () { + window.wall = new Logowall(document.getElementsByClassName('.logowall')[0]); +}); + +function Logowall(element) { + this.element = element; + this.items = element.children; + this.nbItems = this.items.length; + this.nbLines = 2; + this.perLine = this.nbItems / this.nbLines; + this.init(); +} + + +logowall.prototype = { + init: function () { + this.distributeLines(); + this.initEvents(); + }, + + distributeLines: function () { + + }, + + initEvents: function () { + var $this = this; + + window.addEventListener('resize', function () { + $this.resize(); + }); + window.addEventListener('orientationchange', function () { + $this.resize(); + }); + + $this.resize(); + }, + + resize: function () { + + }, +}; diff --git a/resources/styles/components/logowall.styl b/resources/styles/components/logowall.styl new file mode 100644 index 0000000..607f6db --- /dev/null +++ b/resources/styles/components/logowall.styl @@ -0,0 +1,21 @@ +.logowall + max-width 100% + overflow hidden + + .line + display block + white-space nowrap + + > div + display: inline-block; + width 25% + padding: 0 20px 20px 0 + + @media (max-width 1024px) + width 33.333% + + @media (max-width 640px) + width 50% + + > * + background: #fff; diff --git a/resources/views/pages/aboutus.blade.php b/resources/views/pages/aboutus.blade.php index 4b29fcf..71ae393 100644 --- a/resources/views/pages/aboutus.blade.php +++ b/resources/views/pages/aboutus.blade.php @@ -1,5 +1,10 @@ @extends('layouts/app') +@push('scripts') + +@endpush + + @section('content') @intro(['padding' => 'pb-4v']) diff --git a/resources/views/pages/home.blade.php b/resources/views/pages/home.blade.php index 02caa75..3273899 100644 --- a/resources/views/pages/home.blade.php +++ b/resources/views/pages/home.blade.php @@ -5,7 +5,7 @@ @endsection @push('scripts') - + @endpush @section('content') @@ -166,13 +166,9 @@ {{-- Our Clients --}} - + - - @for ($i = 1; $i <= 8; $i++) -
- @endfor -
+ @include("partials.logowall",['logos'=>$page->get('logos')])
@endif diff --git a/resources/views/partials/logowall.blade.php b/resources/views/partials/logowall.blade.php new file mode 100644 index 0000000..2511f53 --- /dev/null +++ b/resources/views/partials/logowall.blade.php @@ -0,0 +1,28 @@ +@php + if(count($logos)%2==1){ + array_pop($logos); + } +@endphp + +@foreach ($logos as $i=>$logo) + @php + $stack='line'.($i%2); + @endphp + + @push($stack) +
+ @if($logo['url']) + + @endif + {{$logo['title']}} + @if($logo['url']) + + @endif +
+ @endpush +@endforeach + +
+
@stack('line0')
+
@stack('line1')
+
diff --git a/webpack.mix.js b/webpack.mix.js index 1dbfd4f..fde20ab 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -26,7 +26,8 @@ mix.browserSync({ mix.js('resources/js/app.js', 'public/js') .js('resources/js/vendor/**/**/app.js', 'public/js/vendor.js') - .js('resources/js/home.js', 'public/js') + .js('resources/js/carrousel.js', 'public/js') + .js('resources/js/logowall.js', 'public/js') .js('resources/js/product-details.js','public/js') .stylus('resources/styles/app.styl', 'public/css', { use: [ -- 2.39.5