diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3dfd8cd2..b3c176d8 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -2,12 +2,18 @@ namespace App\Http\Controllers; +use App\Models\HomeSliderPictures; use Illuminate\Http\Request; class HomeController extends Controller { public function index(Request $request) { - return view('home'); + // TODO : Order By ORDRE ASC + $slides = HomeSliderPictures::where([ + ['day'.date('N'), 1], + ['status', 1] + ])->get(); + return view('home', compact('slides')); } } diff --git a/app/Models/HomeSliderPictures.php b/app/Models/HomeSliderPictures.php index 04f4f938..8ec9746c 100644 --- a/app/Models/HomeSliderPictures.php +++ b/app/Models/HomeSliderPictures.php @@ -6,5 +6,17 @@ use Illuminate\Database\Eloquent\Model; class HomeSliderPictures extends Model { - // + protected $hidden = [ + 'id', + 'day1', + 'day2', + 'day3', + 'day4', + 'day5', + 'day6', + 'day7', + 'status', + 'created_at', + 'updated_at' + ]; } diff --git a/package-lock.json b/package-lock.json index 0b6b7bd8..e42159fe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4396,6 +4396,11 @@ "parse-passwd": "1.0.0" } }, + "hooper": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/hooper/-/hooper-0.3.4.tgz", + "integrity": "sha512-hV1c+MCiCfVjltdvZIgTrGYHInvhKiNLVNOT/hRWbfjZNIS9H6F6ZUPeaxhxrYkjsEL96Z0RIs+4YPoBqrrrHQ==" + }, "hpack.js": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/hpack.js/-/hpack.js-2.1.6.tgz", diff --git a/package.json b/package.json index 8624b826..3bb6cdf5 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ }, "dependencies": { "@fortawesome/fontawesome-free": "^5.15.1", + "hooper": "^0.3.4", "normalize.css": "^8.0.1" } } diff --git a/resources/js/components/ExampleComponent.vue b/resources/js/components/ExampleComponent.vue deleted file mode 100644 index 3fb9f9aa..00000000 --- a/resources/js/components/ExampleComponent.vue +++ /dev/null @@ -1,23 +0,0 @@ - - - diff --git a/resources/js/components/HomeSliderComponent.vue b/resources/js/components/HomeSliderComponent.vue new file mode 100644 index 00000000..2591a450 --- /dev/null +++ b/resources/js/components/HomeSliderComponent.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/resources/js/main.js b/resources/js/main.js index e50ed509..78725c6b 100644 --- a/resources/js/main.js +++ b/resources/js/main.js @@ -1,4 +1,29 @@ require('@fortawesome/fontawesome-free/js/all'); +window.Vue = require('vue'); + +/** + * The following block of code may be used to automatically register your + * Vue components. It will recursively scan this directory for the Vue + * components and automatically register them with their "basename". + * + * Eg. ./components/ExampleComponent.vue -> + */ + +// const files = require.context('./', true, /\.vue$/i) +// files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)) + +Vue.component('home-slider', require('./components/HomeSliderComponent.vue').default); + +/** + * Next, we will create a fresh Vue application instance and attach it to + * the page. Then, you may begin adding components to this application + * or customize the JavaScript scaffolding to fit your unique needs. + */ + +const app = new Vue({ + el: '#app', +}); + /** TODO : METTRE CE CODE DANS UN MODULE **/ // The debounce function receives our function as a parameter const debounce = (fn) => { diff --git a/resources/sass/front/_sub_header.scss b/resources/sass/front/_sub_header.scss index 18827e49..3b4ad208 100644 --- a/resources/sass/front/_sub_header.scss +++ b/resources/sass/front/_sub_header.scss @@ -6,15 +6,47 @@ background-position: center center; position: relative; - background-color: #2d995b; - & .content { + position: relative; & .text { position: absolute; - top: 40%; + top: 25%; right: 10%; width: 45%; text-align: right; + + & .catch { + position: relative; + text-align: right; + margin-bottom: 10px; + font-size: 3.2em; + font-family: 'CreamyScriptRegular'; + color: #02621e; + } + + & .title { + position: relative; + text-align: right; + text-decoration: none; + line-height: 1em; + margin-bottom: 35px; + font-size: 7em; + font-family: 'Veneer'; + color: #02621e; + } + + & .btn { + position: relative; + text-align: right; + text-transform: uppercase; + color: white; + font-family: "catamaran-black"; + font-size: 1.4em; + border-radius: 20px; + padding: 3px 20px 7px; + overflow: hidden; + background-color: #37b35b; + } } & img { width: 100%; diff --git a/resources/views/home.blade.php b/resources/views/home.blade.php index e0f97473..0da4de30 100644 --- a/resources/views/home.blade.php +++ b/resources/views/home.blade.php @@ -4,14 +4,7 @@ @section('sub_header')
-
-
-

La charcuterie se met au vert

-

de bons émincés bio, pour des repas sains et gourmands

- Découvrez ce produit -
- Image - Le Gaulois -
+
@endsection diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 40367be3..1a36f458 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -37,10 +37,12 @@ +
@include('layouts.app-header') @yield('sub_header') @yield('content') @include('layouts.app-footer') +