ldc-jeusselin/resources/js/main.js
Jérémy Munsch de4dcfb283
Closes #2 and #4
- Add status checker + admin secure packages + upgrade enum + add sentry + upgrade to sitemap generator + bump to CRMV2
- Set customer role enum and user role enum
- Update customer migration to set roles
- phpcbf
- faker local to fr
- update lang
- composer update
- bump laravel ui
- Redo all user crud
- npm bump
- Create admin command
- rearrange views
- redo all auth system
- redo customer pro bo
2023-08-21 15:43:33 +02:00

203 lines
9.1 KiB
JavaScript
Vendored

//import vue
import Swiper from 'swiper/swiper-bundle';
import Vue from 'vue';
require('./bootstrap');
require('./fontawesome');
// cookie notice
import { LdcwebCn } from "./ldcweb-cn.js";
window.LdcwebCn = LdcwebCn;
require('@fancyapps/fancybox');
/**
* 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 -> <example-component></example-component>
*/
Vue.component('objectives', require('./components/pro/Objectives.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',
});
$(document).ready(function() {
// HEADER
// GESTION RESPONSIVE DU MENU
$('.toggle-menu').click(function(){
$(this).toggleClass('active');
$('nav').toggleClass('active')
$('body').toggleClass('mobile-nav-active');
})
$('header .disconnect, header .mobile-disconnect').click(function(e){
e.preventDefault();
$(this).removeClass('logged');
$('header .connect-contain p').removeClass('logged')
// $('header .connect').removeClass('account')
})
// BORDER VISIBLE SUR LE MENU AFFICHE
$('nav ul li').click(function() {
$(this).toggleClass('active');
})
// HOME PAGE
// SLIDER
//initialize swiper when document ready
const mySwiper = new Swiper ('.swiper-container', {
speed: 2000,
parallax: true,
effect: 'slide',
slidesPerView: 1,
autoplay: {
delay: 5000,
},
loop: true,
pagination: {
el: '.swiper-pagination',
type: 'bullets',
clickable: true,
},
});
// Section VIDEO
$('.screenplay').click(function(e) {
e.preventDefault();
$(this).siblings().removeClass('active')
$(this).toggleClass('active');
// $('.popup-detail').addClass('active');
if ($(this)[0].classList[1]) {
switch ($(this)[0].classList[1]) {
case "marolles":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510307128?autoplay=1")
break;
case "cherre":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510306947?autoplay=1")
break;
case "monce":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510307183?autoplay=1")
break;
case "nogent-le-bernard":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510306862?autoplay=1")
break;
case "mamers":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510307063?autoplay=1")
break;
case "thoigne-les-mees":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510306899?autoplay=1")
break;
case "les-mees":
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510306998?autoplay=1")
break;
case "sille-guillaume":
$('.player-bloc.wide iframe').attr("src", "images/silo-sille.jpg")
break;
default:
$('.player-bloc.wide iframe').attr("src", "https://player.vimeo.com/video/510306998?autoplay=1")
break;
}
}
})
// PAGE "QUI SOMMES NOUS"
// AFFICHAGE DU DETAIL DE LA CHRONOLOGIE
$('.frise .event').click(function() {
$('body .bg-opacity').addClass('active');
$('.' + $(this)[0].classList[1] + ' .popup-detail').addClass('active');
})
$('.frise #close-cross').click(function() {
$('body .bg-opacity').removeClass('active');
$(this).parent().removeClass('active');
return false;
})
// PAGE "NOUS CONTACTER"
// On prend l'url pour savoir si on affiche ou pas la popup
// Si "/nous-contacter#collecte" => pas de popup et affichage de tous les silos
// Si pas d'ancre => affichage de la popup
let pathName = window.location.pathname;
let hash = window.location.hash;
if (pathName === "/nous-contacter" && hash === "#collecte") {
$('body .bg-opacity').removeClass('active');
$('.contact--main .popup-choice').removeClass('active');
} else if (pathName === "/nous-contacter" && hash === "") {
$('body .bg-opacity').addClass('active');
$('.contact--main .popup-choice').addClass('active');
$('body').addClass('popup-choice-active');
}
// Quand on clique sur un des 2 choix, On cache la popup d'information et on affiche les silos voulus
// Si "Agriculteur" => Affichage de tous les silos
// Si "Particulier" => Affichage de 5 silos
$('.choice--btn').click(function() {
if ($(this)[0].classList[1] != "agri") {
$('.site--bloc.agri').addClass('hidden');
} else {
$('.site--bloc.agri').removeClass('hidden');
}
$('body .bg-opacity').removeClass('active');
$('.popup-choice').removeClass('active');
$('body').removeClass('popup-choice-active');
})
// On rempli le contenu de l'ancre du bouton cliqué (carte google)
$('.contact--row .bloc--btn').click(function(e) {
// e.preventDefault();
if ($(this)[0].classList[1]) {
// $( "#collect--map" ).fadeOut(0).fadeIn(500);
$('#collect--map').empty();
switch ($(this)[0].classList[1]) {
case "marolles":
$('#collect--map').append('<iframe width="100%" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=marolles-les-brault%20jeusselin&amp;z=17&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe>');
break;
case "cherre":
$('#collect--map').append('<iframe width="100%" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=8%20Rue%20Princesse%20Alice%20de%20Monaco,%2072400%20Cherr%C3%A9&amp;z=17&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe>');
break;
case "monce":
$('#collect--map').append('<iframe width="100%" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=monc%C3%A9%20en%20saosnois%20jeusselin&amp;z=17&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe>');
break;
case "nogent-le-bernard":
$('#collect--map').append('<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1117.2914302876688!2d0.48414369744826813!3d48.23777666920131!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zNDjCsDE0JzE2LjEiTiAwwrAyOScwNi4yIkU!5e0!3m2!1sfr!2sfr!4v1614339962855!5m2!1sfr!2sfr" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>');
break;
case "mamers":
$('#collect--map').append('<iframe width="100%" height="450" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="https://maps.google.com/maps?q=mamers%20jeusselin&amp;z=17&amp;ie=UTF8&amp;iwloc=B&amp;output=embed"></iframe>');
break;
case "thoigne-les-mees":
$('#collect--map').append('<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d684.8675256600119!2d0.25121078570016875!3d48.29166291969703!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zNDjCsDE3JzMwLjAiTiAwwrAxNScwNi40IkU!5e0!3m2!1sfr!2sfr!4v1614340298291!5m2!1sfr!2sfr" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>');
break;
case "les-mees":
$('#collect--map').append('<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d938.0259842406967!2d0.2293244494024086!3d48.31942522912142!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x0%3A0x0!2zNDjCsDE5JzA5LjkiTiAwwrAxMyc0OC4wIkU!5e0!3m2!1sfr!2sfr!4v1614344416993!5m2!1sfr!2sfr" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>');
break;
case "sille-le-guillaume":
$('#collect--map').append('<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d1330.273278394541!2d-0.14506682996032197!3d48.17681993475754!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x4809d1eb78257d43%3A0x11526a18898cf526!2sEvialis%20France!5e0!3m2!1sfr!2sfr!4v1614345037843!5m2!1sfr!2sfr" width="100%" height="450" style="border:0;" allowfullscreen="" loading="lazy"></iframe>');
break;
default:
$('#collect--map').append('<iframe src="https://www.google.com/maps/embed?pb=!1m14!1m12!1m3!1d120205.41598827539!2d0.26861220027133315!3d48.26072718402679!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!5e0!3m2!1sfr!2sfr!4v1613659020066!5m2!1sfr!2sfr" width="100%" height="450" frameborder="0" style="border:0;" allowfullscreen="" aria-hidden="false" tabindex="0"></iframe>');
break;
}
}
})
// FOOTER
// MENU TOUJOURS PRESENT
$(window).on('scroll',function() {
if($(window).scrollTop()) {
$('header').addClass('sticky-bar')
$('.pageup').addClass('see')
}
else {
$('header').removeClass('sticky-bar')
$('.pageup').removeClass('see')
}
})
});