Banner.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <template>
  2. <LayoutContainer>
  3. <LayoutUITitlePage
  4. title="Besoin d'aide ?"
  5. subtitle="Notre équipe est là pour vous. contactez-nous!. "
  6. />
  7. <v-row>
  8. <v-col cols="12" style="position: relative">
  9. <img
  10. src="/images/formation/banner.jpg"
  11. alt="line"
  12. class="cover-image"
  13. />
  14. </v-col>
  15. </v-row>
  16. <div class="container-contact">
  17. <v-form ref="form" v-model="valid" lazy-validation>
  18. <v-container>
  19. <h4 class="title-h4">Veuillez remplir le formulaire ci-dessous</h4>
  20. <h6 class="infos">Vos coordonnées</h6>
  21. <!-- Gender selection -->
  22. <v-row>
  23. <v-col cols="12">
  24. <v-radio-group v-model="gender" row mandatory inline>
  25. <v-radio label="Madame" value="Madame"></v-radio>
  26. <v-radio label="Monsieur" value="Monsieur"></v-radio>
  27. </v-radio-group>
  28. </v-col>
  29. </v-row>
  30. <!-- Name and Surname -->
  31. <v-row>
  32. <v-col cols="12" md="6">
  33. <v-text-field
  34. v-model="name"
  35. :rules="nameRules"
  36. label="Nom*"
  37. required
  38. ></v-text-field>
  39. </v-col>
  40. <v-col cols="12" md="6">
  41. <v-text-field
  42. v-model="surname"
  43. :rules="surnameRules"
  44. label="Prénom*"
  45. required
  46. ></v-text-field>
  47. </v-col>
  48. </v-row>
  49. <!-- Postal code and city -->
  50. <v-row>
  51. <v-col cols="12" md="6">
  52. <v-text-field
  53. v-model="postalCode"
  54. label="Code postal*"
  55. type="number"
  56. ></v-text-field>
  57. </v-col>
  58. <v-col cols="12" md="6">
  59. <v-text-field v-model="city" label="Ville"></v-text-field>
  60. </v-col>
  61. </v-row>
  62. <!-- Email and phone on the same line -->
  63. <v-row>
  64. <v-col cols="12" md="6">
  65. <v-text-field
  66. v-model="email"
  67. :rules="emailRules"
  68. label="Email*"
  69. required
  70. type="email"
  71. ></v-text-field>
  72. </v-col>
  73. <v-col cols="12" md="6">
  74. <v-text-field
  75. v-model="phone"
  76. label="Téléphone*"
  77. type="tel"
  78. ></v-text-field>
  79. </v-col>
  80. </v-row>
  81. <!-- Structure name -->
  82. <v-row>
  83. <v-col cols="12">
  84. <v-text-field
  85. v-model="structureName"
  86. :rules="structureNameRules"
  87. label="Nom de la structure*"
  88. required
  89. ></v-text-field>
  90. </v-col>
  91. </v-row>
  92. <h6 class="infos">Votre demande concerne</h6>
  93. <!-- Request type and product concerned -->
  94. <v-row>
  95. <v-col cols="12" md="6">
  96. <v-select
  97. v-model="requestType"
  98. :items="requestTypes"
  99. label="Votre demande concerne*"
  100. outlined
  101. dense
  102. ></v-select>
  103. </v-col>
  104. <v-col cols="12" md="6">
  105. <v-text-field
  106. v-model="concernedProduct"
  107. label="Le produit concerné"
  108. outlined
  109. dense
  110. ></v-text-field>
  111. </v-col>
  112. </v-row>
  113. <h6 class="infos">Votre message</h6>
  114. <!-- Message -->
  115. <v-row>
  116. <v-col cols="12">
  117. <v-textarea
  118. v-model="message"
  119. :rules="messageRules"
  120. label="Votre message*"
  121. required
  122. outlined
  123. dense
  124. maxlength="400"
  125. ></v-textarea>
  126. </v-col>
  127. </v-row>
  128. <!-- Policy and checkboxes -->
  129. <v-checkbox
  130. v-model="privacyPolicy"
  131. :rules="[(v) => !!v || 'You must accept the privacy policy']"
  132. label="J'ai pris connaissance de la politique de confidentialité et j'accepte le traitement de mes données personnelles par Opentalent."
  133. ></v-checkbox>
  134. <v-checkbox
  135. v-model="newsletterSubscription"
  136. label="Je souhaite recevoir des communications d'Opentalent par email (promotions, informations logiciel…). Je pourrai me désinscrire à tout moment."
  137. ></v-checkbox>
  138. <v-checkbox
  139. v-model="captchaChecked"
  140. :rules="[(v) => !!v || 'You must pass the captcha']"
  141. label="Captcha"
  142. ></v-checkbox>
  143. <!-- Submit Button -->
  144. <v-row>
  145. <v-col cols="12">
  146. <v-btn :disabled="!valid" @click="submitForm">Envoyer</v-btn>
  147. </v-col>
  148. </v-row>
  149. </v-container>
  150. </v-form>
  151. <div v-if="submissionStatus">
  152. {{ submissionStatus }}
  153. </div>
  154. </div>
  155. <div id="map" style="height: 500px"></div>
  156. </LayoutContainer>
  157. </template>
  158. <script setup>
  159. import { ref, reactive, computed, toRefs } from "vue";
  160. import { useRoute } from "vue-router";
  161. import { onMounted } from "vue";
  162. import L from "leaflet";
  163. import "leaflet/dist/leaflet.css";
  164. onMounted(() => {
  165. const map = L.map("map").setView([46.075245, 6.570162], 16);
  166. L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", {
  167. maxZoom: 19,
  168. attribution: "© OpenStreetMap contributors",
  169. }).addTo(map);
  170. const marker = L.marker([46.075245, 6.570162]).addTo(map);
  171. });
  172. const route = useRoute();
  173. const defaultRequestType = route.query.request;
  174. const captchaChecked = ref(false);
  175. const name = ref("");
  176. const surname = ref("");
  177. const email = ref("");
  178. const structureName = ref("");
  179. const message = ref("");
  180. const privacyPolicy = ref(false);
  181. const gender = ref(null);
  182. const postalCode = ref(null);
  183. const city = ref("");
  184. const phone = ref(null);
  185. const concernedProduct = ref("");
  186. const newsletterSubscription = ref(false);
  187. const submissionStatus = ref("");
  188. const validateName = (name) => !!name || "Name is required";
  189. const validateSurname = (surname) => !!surname || "Surname is required";
  190. const validateEmail = (email) =>
  191. (!!email && /.+@.+\..+/.test(email)) || "E-mail must be valid";
  192. const validateStructureName = (structureName) =>
  193. !!structureName || "Structure name is required";
  194. const validateMessage = (message) =>
  195. (!!message && message.length <= 400) ||
  196. "Message cannot exceed 400 characters";
  197. const valid = computed(() => {
  198. return (
  199. validateName(name.value) === true &&
  200. validateSurname(surname.value) === true &&
  201. validateEmail(email.value) === true &&
  202. validateStructureName(structureName.value) === true &&
  203. validateMessage(message.value) === true &&
  204. privacyPolicy.value === true &&
  205. captchaChecked.value === true
  206. );
  207. });
  208. const requestTypes = [
  209. "Demande d'information",
  210. "Demande de devis",
  211. "Demande de démonstration",
  212. "Demande d'option supplémentaire",
  213. "Autre",
  214. ];
  215. const requestType = ref(
  216. defaultRequestType === "demo" ? "Demande de démonstration" : null
  217. );
  218. const formData = reactive({
  219. gender: null,
  220. postalCode: null,
  221. city: "",
  222. phone: null,
  223. requestType: null,
  224. concernedProduct: "",
  225. newsletterSubscription,
  226. });
  227. // Methods
  228. const submitForm = () => {
  229. if (valid.value) {
  230. // Logique d'envoi du formulaire
  231. submissionStatus.value = "Mail envoyé à contact@opentalent.fr";
  232. } else {
  233. console.log("Validation failed!");
  234. submissionStatus.value = "";
  235. }
  236. };
  237. const formDataRefs = toRefs(formData);
  238. const formRefs = {
  239. ...formDataRefs,
  240. name,
  241. surname,
  242. email,
  243. structureName,
  244. message,
  245. privacyPolicy,
  246. valid,
  247. };
  248. </script>
  249. <style scoped>
  250. #map {
  251. height: 100%;
  252. width: 70%;
  253. margin-left: auto;
  254. margin-right: auto;
  255. }
  256. .infos {
  257. font-size: 20px;
  258. color: #000000;
  259. margin-bottom: 1rem;
  260. }
  261. .container-contact {
  262. max-width: 1400px;
  263. margin: 0 auto;
  264. }
  265. .title-h4 {
  266. font-size: 40px;
  267. line-height: 95px;
  268. color: #000000;
  269. margin-bottom: 1rem;
  270. color: rgba(0, 0, 0, 0.3);
  271. }
  272. .image-text {
  273. position: absolute;
  274. top: 40px;
  275. left: 20px;
  276. font-family: "Barlow";
  277. color: white;
  278. font-size: 3rem;
  279. width: 30rem;
  280. font-style: italic;
  281. font-weight: 300;
  282. line-height: 40px;
  283. }
  284. :deep().subtitle {
  285. font-size: 1.5rem;
  286. line-height: 2rem;
  287. letter-spacing: 0.1rem;
  288. margin-bottom: 1rem;
  289. text-transform: uppercase;
  290. }
  291. .formation {
  292. font-family: "Barlow";
  293. font-style: normal;
  294. font-weight: 600;
  295. font-size: 90px;
  296. line-height: 85px;
  297. text-align: center;
  298. color: #000000;
  299. margin-bottom: 1rem;
  300. }
  301. .menu-container {
  302. display: flex;
  303. justify-content: space-around;
  304. padding: 1rem 10rem;
  305. background: white;
  306. color: #bbb8b8;
  307. font-family: "Barlow";
  308. font-size: 12px;
  309. line-height: 16px;
  310. display: flex;
  311. align-items: center;
  312. text-align: center;
  313. letter-spacing: 0.18em;
  314. text-transform: uppercase;
  315. }
  316. .v-chip.active-menu {
  317. background: black;
  318. color: white;
  319. }
  320. .cover-image {
  321. width: 100%;
  322. height: 15rem;
  323. object-fit: cover;
  324. object-position: center 30%;
  325. margin: 0 auto;
  326. transform: scaleX(-1);
  327. }
  328. </style>