templates/utils/help-coach.html.twig line 1

Open in your IDE?
  1. <div id="help-coach">
  2. <div class="cursor-pointer step-0">
  3. <div class="d-flex justify-content-center align-items-center gap-3 mobile-display-none" style="padding-right: 70px;">
  4. <div class="text-white">
  5. Un <b>coaching <br/>gratuit</b>
  6. avec Sacha ?
  7. </div>
  8. <div class="position-absolute" style="right: -10px; bottom: -5px;">
  9. <img src="{{ asset('assets/media/sacha-reverse.png') }}" style="max-width: 100px; max-height: 150px; object-fit: contain;" />
  10. </div>
  11. </div>
  12. <div class="mobile-display-block">
  13. <div class="d-flex justify-content-end align-items-center gap-3">
  14. <div class="text-white" id="help-coach-mobile-text-animation">
  15. Parler<br/>
  16. avec <b>Sacha</b> ?
  17. </div>
  18. <div>
  19. <img src="{{ asset('assets/media/sacha-croped.png') }}" style="max-width: 40px; max-height: 40px; object-fit: contain; transform: rotateY(3.142rad);" />
  20. </div>
  21. </div>
  22. </div>
  23. </div>
  24. <div class="step step-1 shadow-xs bg-white border-radius10">
  25. <div class="text-primary fw-bolder text-center" style="font-size: 16px; line-height: 22px;">Bienvenue dans l'espace de coaching ZenDez-Vous</div>
  26. <div class="mt-7">
  27. <div>
  28. <button class="d-flex justify-content-between align-items-center talk-to-sacha" style="padding: 15px;">
  29. <div><img src="{{ asset('assets/media/sacha.png') }}" style="max-width: 60px; max-height: 70px; object-fit: contain;" /></div>
  30. <div>Parler avec Sacha, c'est gratuit. Allons-y !</div>
  31. </button>
  32. </div>
  33. <div class="mt-5">
  34. <a href="{{ path('default_conseils') }}"><button style="padding: 15px;">Prendre rendez-vous avec un coach professionnel</button></a>
  35. </div>
  36. </div>
  37. </div>
  38. <div class="close close1" style="display: none;">
  39. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 384 512"><path fill="#FFFFFF" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>
  40. </div>
  41. <div class="expand expand2 tablet-display-none" style="display: none;">
  42. <svg xmlns="http://www.w3.org/2000/svg" width="10" height="10" viewBox="0 0 512 512"><path fill="#FFFFFF" d="M344 0H488c13.3 0 24 10.7 24 24V168c0 9.7-5.8 18.5-14.8 22.2s-19.3 1.7-26.2-5.2l-39-39-87 87c-9.4 9.4-24.6 9.4-33.9 0l-32-32c-9.4-9.4-9.4-24.6 0-33.9l87-87L327 41c-6.9-6.9-8.9-17.2-5.2-26.2S334.3 0 344 0zM168 512H24c-13.3 0-24-10.7-24-24V344c0-9.7 5.8-18.5 14.8-22.2s19.3-1.7 26.2 5.2l39 39 87-87c9.4-9.4 24.6-9.4 33.9 0l32 32c9.4 9.4 9.4 24.6 0 33.9l-87 87 39 39c6.9 6.9 8.9 17.2 5.2 26.2s-12.5 14.8-22.2 14.8z"/></svg>
  43. </div>
  44. <div class="close close2" style="display: none;">
  45. <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 384 512"><path fill="#FFFFFF" d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>
  46. </div>
  47. <div class="step step-3 shadow-xs bg-white border-radius10">
  48. <div class="text-primary fw-bolder text-center" style="font-size: 16px; line-height: 22px;">Vous préférez parler à un humain ?</div>
  49. <div class="mt-7">
  50. <div class="mt-5">
  51. <a href="{{ path('default_conseils') }}" target="_blank"><button style="padding: 15px;">Prendre rendez-vous avec un coach professionnel</button></a>
  52. </div>
  53. </div>
  54. <div class="mt-3">
  55. <div class="text-center text-decoration-underline cursor-pointer close3">Non merci</div>
  56. </div>
  57. </div>
  58. </div>
  59. <script>
  60. (function() {
  61. var step0 = document.querySelector("#help-coach .step-0");
  62. var step1 = document.querySelector("#help-coach .step-1");
  63. var close1 = document.querySelector("#help-coach .close1");
  64. var talkToSachaBtn = document.querySelector("#help-coach .step-1 .talk-to-sacha");
  65. var close2 = document.querySelector("#help-coach .close2");
  66. var expand2 = document.querySelector("#help-coach .expand2");
  67. var step3 = document.querySelector("#help-coach .step-3");
  68. var close3= document.querySelector("#help-coach .close3");
  69. step0.addEventListener("click", (event) => {
  70. step0.style.display = "none";
  71. step1.style.maxWidth = "300px";
  72. step1.style.maxHeight = "initial";
  73. step1.style.padding = "25px";
  74. close1.style.display = "block";
  75. });
  76. talkToSachaBtn.addEventListener("click", (event) => {
  77. step1.style.maxWidth = "0";
  78. step1.style.maxHeight = "0";
  79. step1.style.padding = "0";
  80. close1.style.display = "none";
  81. close2.style.display = "block";
  82. expand2.style.display = "block";
  83. openTalkToSacha();
  84. });
  85. close1.addEventListener("click", (event) => {
  86. step0.style.display = "block";
  87. step1.style.maxWidth = "0";
  88. step1.style.maxHeight = "0";
  89. step1.style.padding = "0";
  90. close1.style.display = "none";
  91. });
  92. close2.addEventListener("click", (event) => {
  93. document.querySelector("#botmanWidgetRoot > div").insertAdjacentHTML('beforeend', '<div id="close-sacha">Étes-vous sûr de vouloir arrêter la conversation avec Sacha ?<div class="buttons"><a id="close-sacha-yes" href="#">Oui</a><a id="close-sacha-no" href="#">Non</a></div></div>');
  94. close2.style.display = "none";
  95. document.getElementById("close-sacha-yes").addEventListener("click", (event) => {
  96. document.getElementById("close-sacha").remove();
  97. step3.style.maxWidth = "300px";
  98. step3.style.maxHeight = "initial";
  99. step3.style.padding = "25px";
  100. expand2.style.display = "none";
  101. closeTalkToSacha();
  102. });
  103. document.getElementById("close-sacha-no").addEventListener("click", (event) => {
  104. document.getElementById("close-sacha").remove();
  105. close2.style.display = "block";
  106. });
  107. });
  108. expand2.addEventListener("click", (event) => {
  109. var botDivEl = document.querySelector("#botmanWidgetRoot > div");
  110. if (expand2.classList.contains('active')) {
  111. botDivEl.style.height = "initial";
  112. botDivEl.style.width = "370px";
  113. botDivEl.childNodes[1].style.height = "450px";
  114. } else {
  115. botDivEl.style.height = "650px";
  116. botDivEl.style.width = "600px";
  117. botDivEl.style.maxWidth = "100%";
  118. botDivEl.childNodes[1].style.height = "600px";
  119. }
  120. expand2.classList.toggle('active');
  121. });
  122. close3.addEventListener("click", (event) => {
  123. step0.style.display = "block";
  124. step3.style.maxWidth = "0";
  125. step3.style.maxHeight = "0";
  126. step3.style.padding = "0";
  127. });
  128. })();
  129. </script>
  130. <script>
  131. var botmanWidget = {
  132. frameEndpoint: '{{ path("chat_frame") }}',
  133. chatServer: '{{ path("chat_message") }}?userId={{ random()~random() }}',
  134. introMessage: "Bonjour, je suis Sacha, en quoi puis-je vous aider ?",
  135. title: 'Parler avec Sacha',
  136. mobileWidth: "100%",
  137. headerTextColor: '#fff',
  138. mainColor: '#336c7a',
  139. color: '#ffffff',
  140. bubbleBackground: '#FFFFFF',
  141. aboutLink: '#',
  142. aboutText: '',
  143. placeholderText: 'Répondre ...',
  144. displayMessageTime: true
  145. };
  146. function openTalkToSacha() {
  147. botmanChatWidget.open();
  148. }
  149. function closeTalkToSacha() {
  150. botmanChatWidget.close();
  151. }
  152. </script>
  153. <script src='https://cdn.jsdelivr.net/npm/botman-web-widget@0/build/js/widget.js'></script>
  154. <script>
  155. // Prevent header on click closing
  156. (function() {
  157. function removeOnClick(element) {
  158. function onClickFunction(event) {
  159. event.preventDefault();
  160. event.stopPropagation();
  161. return false;
  162. }
  163. element.addEventListener('click', onClickFunction, true);
  164. }
  165. // Fonction à exécuter lors de l'observation des mutations
  166. function observerCallback(mutationsList, observer) {
  167. // Parcourir les mutations
  168. for(let mutation of mutationsList) {
  169. if (mutation.type === 'childList' && mutation.addedNodes && mutation.addedNodes[0].id === 'botmanWidgetRoot') {
  170. const botmanWidgetRootDiv = document.querySelector('#botmanWidgetRoot > div');
  171. const config2 = { childList: true };
  172. const observer2 = new MutationObserver(observerCallback2);
  173. observer2.observe(botmanWidgetRootDiv, config2);
  174. }
  175. }
  176. }
  177. function observerCallback2(mutationsList, observer) {
  178. // Parcourir les mutations
  179. for(let mutation of mutationsList) {
  180. if (mutation.target) {
  181. const targettedDiv = mutation.target.querySelector('div');
  182. if (targettedDiv) {
  183. removeOnClick(targettedDiv);
  184. }
  185. }
  186. }
  187. }
  188. // Sélectionner l'élément à observer
  189. const targetNode = document.body;
  190. const config = { childList: true };
  191. const observer = new MutationObserver(observerCallback);
  192. observer.observe(targetNode, config);
  193. })();
  194. </script>
  195. <script>
  196. // Hide text on mobile
  197. (function() {
  198. setTimeout(function(){
  199. document.getElementById('help-coach-mobile-text-animation').style.maxWidth = '0';
  200. }, 3000);
  201. })();
  202. </script>
  203. <style>
  204. #botmanWidgetRoot .desktop-closed-message-avatar {
  205. display: none !important;
  206. }
  207. #botmanWidgetRoot div {
  208. cursor: default !important;
  209. font-weight: 500 !important;
  210. font-family: "Montserrat", sans-serif !important;
  211. z-index: 99999 !important;
  212. }
  213. #botmanWidgetRoot svg {
  214. display: none !important;
  215. }
  216. #help-coach-mobile-text-animation {
  217. width: 100%;
  218. max-width: 100%;
  219. overflow: hidden;
  220. white-space: nowrap;
  221. transition: max-width 0.3s linear;
  222. }
  223. #botmanWidgetRoot #close-sacha {
  224. position: absolute;
  225. top: 0;
  226. left: 0;
  227. background-color: #e9e9e994;
  228. backdrop-filter: blur(10px);
  229. -webkit-backdrop-filter: blur(10px);
  230. height: 100%;
  231. width: 100%;
  232. display: flex;
  233. flex-direction: column;
  234. align-items: center;
  235. justify-content: center;
  236. font-size: 16px;
  237. text-align: center;
  238. padding: 30px;
  239. }
  240. #botmanWidgetRoot #close-sacha .buttons {
  241. margin-top: 15px;
  242. }
  243. #botmanWidgetRoot #close-sacha .buttons a {
  244. display: inline-block;
  245. margin-left: 20px;
  246. margin-right: 20px;
  247. }
  248. </style>