Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

242 Zeilen
7.8 KiB

  1. <html>
  2. <head>
  3. <style>
  4. /* Some miscellenous widget manipulation */
  5. .rw-launcher {
  6. -webkit-animation-delay: 0;
  7. -webkit-animation-duration: 0.5s;
  8. -webkit-animation-name: slide-in;
  9. -webkit-animation-fill-mode: forwards;
  10. -moz-animation-delay: 0;
  11. -moz-animation-duration: 0.5s;
  12. -moz-animation-name: slide-in;
  13. -moz-animation-fill-mode: forwards;
  14. animation-delay: 0;
  15. animation-duration: 0.5s;
  16. animation-name: slide-in;
  17. animation-fill-mode: forwards;
  18. display: flex;
  19. align-items: center !important;
  20. justify-content: center;
  21. background-color: white !important;
  22. border: 0 !important;
  23. box-shadow: 0 2px 10px 1px white!important;
  24. height: 125px !important;
  25. margin: 0;
  26. width: 125px !important;
  27. box-sizing:border-box
  28. }
  29. /* Resizing the widget */
  30. .rw-launcher img {
  31. width: 125 !important;
  32. max-height: 125 !important;
  33. object-fit: contain !important;
  34. }
  35. /* Getting rid of the rotation animation of the widget while closing */
  36. .rw-close-launcher {
  37. -webkit-animation-delay: 0;
  38. -webkit-animation-duration: 0s !important;
  39. -webkit-animation-name: rotation-lr !important;
  40. -webkit-animation-fill-mode: forwards;
  41. -moz-animation-delay: 0;
  42. -moz-animation-duration: 0s !important;
  43. -moz-animation-name: rotation-lr !important;
  44. -moz-animation-fill-mode: forwards;
  45. animation-delay: 0;
  46. animation-duration: 0s !important;
  47. animation-name: rotation-lr !important;
  48. animation-fill-mode: forwards;
  49. }
  50. /* Getting rid of the rotation animation of the widget while opening */
  51. .rw-open-launcher {
  52. -webkit-animation-delay: 0;
  53. -webkit-animation-duration: 0.5s;
  54. -webkit-animation-name: rotation-rl;
  55. -webkit-animation-fill-mode: forwards;
  56. -moz-animation-delay: 0;
  57. -moz-animation-duration: .5s;
  58. -moz-animation-name: rotation-rl;
  59. -moz-animation-fill-mode: forwards;
  60. animation-delay: 0;
  61. animation-duration: 0s !important;
  62. animation-name: rotation-rl;
  63. animation-fill-mode: forwards;
  64. }
  65. </style>
  66. </head>
  67. <body>
  68. <style>
  69. /* Background color for the header */
  70. .rw-conversation-container .rw-header{background-color: #233e80;}
  71. /* Correction of the shadow for the chat window */
  72. .rw-conversation-container {
  73. -webkit-animation-delay: 0;
  74. -webkit-animation-duration: .5s;
  75. -webkit-animation-name: slide-in;
  76. -webkit-animation-fill-mode: forwards;
  77. -moz-animation-delay: 0;
  78. -moz-animation-duration: .5s;
  79. -moz-animation-name: slide-in;
  80. -moz-animation-fill-mode: forwards;
  81. animation-delay: 0;
  82. animation-duration: .5s;
  83. animation-name: slide-in;
  84. animation-fill-mode: forwards;
  85. border-radius: 10px;
  86. box-shadow: 0px -20px 12px 0px hsl(0deg 14% 89% / 0%), inset 4px -7px 3.7px -1px rgb(0 0 0 / 7%), 0 5px 7px -1px hsl(0deg 0% 0% / 9%), 2px -8px 12.5px -1px rgb(84 25 25 / 10%), 2px -6px 23.4px 0px rgb(255 0 0 / 12%), inset -3px -5px 56px 0px rgb(237 0 0 / 17%);
  87. overflow: hidden;
  88. width: 370px;
  89. }
  90. /* Resizing avatar (to the left of replies) */
  91. .rw-conversation-container .rw-avatar {
  92. width: 55px;
  93. height: 55px;
  94. border-radius: 100%;
  95. margin-right: -3px;
  96. /* position: relative; */
  97. bottom: 0px;
  98. }
  99. /* Positioning the avatar to the left of replies rather than at the top*/
  100. .rw-conversation-container .rw-message {
  101. margin: 10px;
  102. font-size: 16px;
  103. line-height: 20px;
  104. display: flex;
  105. font-family: Inter,sans-serif;
  106. flex-wrap: unset !important;
  107. position: relative;
  108. }
  109. /* Header avatar resizing */
  110. .rw-conversation-container .rw-header .rw-avatar {
  111. all: initial;
  112. height: 57px;
  113. width: 57px;
  114. position: absolute;
  115. top: 4px;
  116. left: 0px;
  117. }
  118. /* Color box for buttons (payload) */
  119. .rw-conversation-container .rw-reply {
  120. -webkit-transition: box-shadow .3s ease,top .3s ease;
  121. -moz-transition: box-shadow .3s ease,top .3s ease;
  122. -o-transition: box-shadow .3s ease,top .3s ease;
  123. transition: box-shadow .3s ease,top .3s ease;
  124. display: -webkit-box;
  125. display: -webkit-flex;
  126. display: -moz-box;
  127. display: -ms-flexbox;
  128. display: flex;
  129. -webkit-flex-align: center;
  130. -ms-flex-align: center;
  131. -webkit-align-items: center;
  132. align-items: center;
  133. background-color: #fafafa;
  134. border: 1px solid #135afe;
  135. border-radius: 15px;
  136. color: #233e80;
  137. padding: 4px 8px;
  138. max-width: 215px;
  139. min-height: 1.7em;
  140. font-weight: 500;
  141. text-align: center;
  142. font-family: Inter,sans-serif;
  143. cursor: pointer;
  144. margin: 0.25em;
  145. text-decoration: unset;
  146. box-shadow: unset !important/*0 .2px .7px -7pxrgba(0,0,0,.277),0 .5px 1.8px -7pxrgba(0,0,0,.369),0 1.2px 3.8px -7pxrgba(0,0,0,.442),0 4px 13px -7pxrgba(0,0,0,.64);*/
  147. }
  148. </style>
  149. <script>
  150. // For Device information (Desktop or Mobile)
  151. device = ""
  152. let details = navigator.userAgent;
  153. /* Creating a regular expression
  154. containing some mobile devices keywords
  155. to search it in details string*/
  156. let regexp = /android|iphone|kindle|ipad/i;
  157. /* Using test() method to search regexp in details
  158. it returns boolean value*/
  159. let isMobileDevice = regexp.test(details);
  160. if (isMobileDevice) {
  161. device = "Mobile";
  162. } else {
  163. device = "Desktop";
  164. }
  165. // For Browser information
  166. navigator.saysWho = (() => {
  167. const { userAgent } = navigator
  168. let match = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []
  169. let temp
  170. if (/trident/i.test(match[1])) {
  171. temp = /\brv[ :]+(\d+)/g.exec(userAgent) || []
  172. return `IE ${temp[1] || ''}`
  173. }
  174. if (match[1] === 'Chrome') {
  175. temp = userAgent.match(/\b(OPR|Edge)\/(\d+)/)
  176. if (temp !== null) {
  177. return temp.slice(1).join(' ').replace('OPR', 'Opera')
  178. }
  179. temp = userAgent.match(/\b(Edg)\/(\d+)/)
  180. if (temp !== null) {
  181. return temp.slice(1).join(' ').replace('Edg', 'Edge (Chromium)')
  182. }
  183. }
  184. match = match[2] ? [match[1], match[2]] : [navigator.appName, navigator.appVersion, '-?']
  185. temp = userAgent.match(/version\/(\d+)/i)
  186. if (temp !== null) {
  187. match.splice(1, 1, temp[1])
  188. }
  189. return match.join(' ')
  190. })()
  191. browser = navigator.saysWho // outputs: `Chrome 89
  192. device_and_browser = device.concat(",", browser);
  193. </script>
  194. <script>!(function () {
  195. let e = document.createElement("script"),
  196. t = document.head || document.getElementsByTagName("head")[0];
  197. (e.src =
  198. "https://cdn.jsdelivr.net/npm/rasa-webchat@1.x.x/lib/index.js"),
  199. // Replace 1.x.x with the version that you want
  200. (e.async = !0),
  201. (e.onload = () => {
  202. window.localStorage.clear()
  203. window.WebChat.default(
  204. {
  205. showCloseButton: false,
  206. showFullScreenButton: true,
  207. initPayload: ['/greet{"device_and_browser": "', device_and_browser, '"}'].join(''),
  208. customData: { language: "en" },
  209. socketUrl: "http://localhost:5005",
  210. profileAvatar: "./assets/bot_widget-removebg-preview.png",
  211. openLauncherImage: "./assets/robo_small.gif",
  212. closeImage: "./assets/closebutton.jpg",
  213. title: "PM-KUSUM",
  214. inputTextFieldHint: "Start a conversation",
  215. connectingText: 'Waiting for server...'
  216. // add other props here
  217. },
  218. null
  219. );
  220. }),
  221. t.insertBefore(e, t.firstChild);
  222. })();
  223. </script>
  224. </body>
  225. </html>