chat.scss 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  1. .zammad-chat {
  2. color: black;
  3. position: fixed;
  4. right: 30px;
  5. bottom: 0;
  6. font-size: 12px;
  7. width: 33em;
  8. height: 3.5em;
  9. box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  10. border-radius: 5px 5px 0 0;
  11. will-change: bottom;
  12. display: none;
  13. flex-direction: column;
  14. z-index: 999;
  15. @media only screen and (max-width: 768px) {
  16. right: 0;
  17. width: 100%;
  18. border-radius: 0 !important;
  19. font-size: 16px !important;
  20. }
  21. &--animate {
  22. transition: transform 500ms;
  23. }
  24. }
  25. .zammad-chat.zammad-chat-is-loaded {
  26. display: flex;
  27. opacity: 0;
  28. }
  29. .zammad-chat.zammad-chat-is-shown {
  30. opacity: 1;
  31. }
  32. .zammad-chat.zammad-chat-is-open {
  33. height: 30em;
  34. @media only screen and (max-width: 768px) {
  35. height: 100%;
  36. }
  37. }
  38. .zammad-chat-icon {
  39. height: 2em;
  40. width: 2em;
  41. fill: currentColor;
  42. vertical-align: top;
  43. margin-right: 5px;
  44. margin-top: 4px;
  45. }
  46. .zammad-chat-header {
  47. padding: 0.5em 2.5em 0.5em 1em;
  48. background: hsl(203, 67%, 53%);
  49. color: white;
  50. line-height: 2.5em;
  51. height: 3.5em;
  52. box-shadow: 0 -1px rgba(0, 0, 0, 0.1), 0 1px rgba(255, 255, 255, 0.3) inset,
  53. 0 -1px rgba(0, 0, 0, 0.1) inset, 0 1px 1px rgba(0, 0, 0, 0.13);
  54. position: relative;
  55. border-radius: 5px 5px 0 0;
  56. overflow: hidden;
  57. cursor: pointer;
  58. @media only screen and (max-width: 768px) {
  59. border-radius: 0 !important;
  60. }
  61. }
  62. .zammad-chat.zammad-chat-is-open .zammad-chat-header {
  63. cursor: default;
  64. }
  65. .zammad-chat-welcome-text {
  66. font-size: 1.2em;
  67. }
  68. .zammad-chat-header-icon {
  69. position: absolute;
  70. right: 0;
  71. top: 0;
  72. height: 100%;
  73. width: 3.4em;
  74. text-align: center;
  75. line-height: 3.4em;
  76. cursor: pointer;
  77. &::before {
  78. // force the icon to align to center
  79. content: '';
  80. display: inline-block;
  81. }
  82. }
  83. .zammad-chat-header-icon-open,
  84. .zammad-chat-header-icon-close {
  85. fill: currentColor;
  86. width: 1.6em;
  87. height: auto;
  88. vertical-align: middle;
  89. }
  90. .zammad-chat-header-icon-close {
  91. width: 1.3em;
  92. }
  93. .zammad-chat-header-icon-close,
  94. .zammad-chat.zammad-chat-is-open .zammad-chat-header-icon-open {
  95. display: none;
  96. }
  97. .zammad-chat.zammad-chat-is-open .zammad-chat-header-icon-close {
  98. display: inline;
  99. }
  100. .zammad-chat-agent {
  101. float: left;
  102. }
  103. .zammad-chat-header-controls {
  104. float: right;
  105. }
  106. .zammad-chat-agent-avatar {
  107. border-radius: 100%;
  108. margin-right: 0.6em;
  109. float: left;
  110. width: 2.5em;
  111. }
  112. .zammad-chat-agent-name {
  113. font-weight: bold;
  114. }
  115. .zammad-chat-agent-status {
  116. margin: 0.25em 1em;
  117. display: inline-block;
  118. line-height: 2em;
  119. padding: 0 0.7em;
  120. border-radius: 1em;
  121. background: rgba(0, 0, 0, 0.1);
  122. box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
  123. }
  124. .zammad-chat-agent-status::before {
  125. content: '';
  126. background: hsl(19, 90%, 51%);
  127. display: inline-block;
  128. height: 0.9em;
  129. width: 0.9em;
  130. border-radius: 100%;
  131. position: relative;
  132. margin-right: 0.3em;
  133. vertical-align: middle;
  134. box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04) inset;
  135. }
  136. .zammad-chat-agent-status[data-status='online']::before {
  137. background: hsl(145, 51%, 55%);
  138. }
  139. .zammad-chat-agent-status[data-status='connecting']::before {
  140. animation: linear connect-fade 600ms infinite alternate;
  141. background: hsl(41, 100%, 49%);
  142. }
  143. @keyframes connect-fade {
  144. from {
  145. opacity: 0.5;
  146. transform: scale(0.6);
  147. }
  148. to {
  149. opacity: 1;
  150. transform: scale(1);
  151. }
  152. }
  153. .zammad-chat-modal {
  154. position: absolute;
  155. left: 0;
  156. right: 0;
  157. bottom: 0;
  158. top: 3.5em;
  159. margin-top: 1px;
  160. text-align: center;
  161. background: white;
  162. z-index: 1;
  163. padding: 20px;
  164. display: flex;
  165. align-items: center;
  166. justify-content: center;
  167. &:empty {
  168. display: none;
  169. }
  170. }
  171. .zammad-chat-modal-text {
  172. font-size: 1.3em;
  173. line-height: 1.45;
  174. .zammad-chat-loading-animation {
  175. font-size: 0.7em;
  176. }
  177. .zammad-chat-button {
  178. margin-top: 1em;
  179. font-size: 0.8em;
  180. }
  181. }
  182. .zammad-chat-modal .zammad-chat-loading-animation {
  183. margin-right: 8px;
  184. vertical-align: middle;
  185. }
  186. .zammad-scroll-hint {
  187. background: hsl(210, 8%, 98%);
  188. display: flex;
  189. align-items: center;
  190. border-bottom: 1px solid hsl(0, 0%, 91%);
  191. padding: 7px 10px 6px;
  192. color: hsl(0, 0%, 60%);
  193. cursor: pointer;
  194. &.is-hidden {
  195. display: none;
  196. }
  197. }
  198. .zammad-scroll-hint-icon {
  199. fill: hsl(210, 5%, 78%);
  200. margin-right: 8px;
  201. }
  202. .zammad-chat-body {
  203. padding: 0.5em 1em;
  204. overflow: auto;
  205. background: white;
  206. flex: 1;
  207. display: none;
  208. -webkit-overflow-scrolling: touch;
  209. overscroll-behavior: contain;
  210. @media only screen and (max-width: 768px) {
  211. height: auto;
  212. flex: 1;
  213. }
  214. }
  215. .zammad-chat-is-open .zammad-chat-body {
  216. display: block;
  217. }
  218. .zammad-chat-timestamp {
  219. text-align: center;
  220. color: hsl(0, 0%, 60%);
  221. font-size: 0.9em;
  222. margin: 1em 0;
  223. }
  224. .zammad-chat-status {
  225. margin: 1em 0;
  226. text-align: center;
  227. }
  228. .zammad-chat-message {
  229. margin: 0.5em 0;
  230. }
  231. .zammad-chat-message-body {
  232. white-space: pre-line;
  233. word-wrap: break-word;
  234. border-radius: 1em;
  235. }
  236. .zammad-chat-status-inner,
  237. .zammad-chat-message-body {
  238. padding: 0.5em 1em;
  239. line-height: 1.4;
  240. background: hsl(0, 0%, 93%);
  241. display: inline-block;
  242. max-width: 70%;
  243. box-shadow: 0 2px rgba(255, 255, 255, 0.15) inset,
  244. 0 0 0 1px rgba(0, 0, 0, 0.08) inset, 0 1px rgba(0, 0, 0, 0.02);
  245. }
  246. .zammad-chat-status-inner {
  247. background: #eee;
  248. border-radius: 0.5em;
  249. }
  250. .zammad-chat-message--customer {
  251. text-align: right;
  252. }
  253. .zammad-chat-message--customer + .zammad-chat-message--agent,
  254. .zammad-chat-message--agent + .zammad-chat-message--customer {
  255. margin-top: 1em;
  256. }
  257. .zammad-chat-message--customer .zammad-chat-message-body {
  258. background: hsl(203, 67%, 53%);
  259. color: white;
  260. }
  261. .zammad-chat-message--unread {
  262. font-weight: bold;
  263. }
  264. .zammad-chat-message--typing .zammad-chat-message-body {
  265. white-space: normal;
  266. }
  267. .zammad-chat-loading-animation {
  268. display: inline-block;
  269. }
  270. .zammad-chat-loading-circle {
  271. background: hsl(0, 0%, 85%);
  272. border-radius: 100%;
  273. height: 0.55em;
  274. width: 0.55em;
  275. display: inline-block;
  276. animation: ease-in-out load-fade 600ms infinite alternate;
  277. }
  278. .zammad-chat-loading-circle + .zammad-chat-loading-circle {
  279. animation-delay: 0.13s;
  280. }
  281. .zammad-chat-loading-circle
  282. + .zammad-chat-loading-circle
  283. + .zammad-chat-loading-circle {
  284. animation-delay: 0.26s;
  285. }
  286. @keyframes load-fade {
  287. 0% {
  288. opacity: 0.5;
  289. transform: scale(0.6);
  290. }
  291. 67% {
  292. opacity: 1;
  293. transform: scale(1);
  294. }
  295. }
  296. .zammad-chat-controls {
  297. overflow: hidden;
  298. display: none;
  299. align-items: flex-end;
  300. border-top: 1px solid hsl(0, 0%, 93%);
  301. padding: 0;
  302. margin: 0;
  303. line-height: 1.4em;
  304. box-shadow: 0 1px rgba(0, 0, 0, 0.01), 0 -1px rgba(0, 0, 0, 0.02);
  305. position: relative;
  306. background: white;
  307. }
  308. .zammad-chat-is-open .zammad-chat-controls {
  309. display: flex;
  310. }
  311. .zammad-chat-input {
  312. margin: 0;
  313. padding: 1em 2em;
  314. float: left;
  315. max-height: 6em;
  316. min-height: 1.4em;
  317. font-family: inherit;
  318. line-height: 1.4em;
  319. font-size: inherit;
  320. appearance: none;
  321. border: none;
  322. background: none;
  323. box-shadow: none;
  324. box-sizing: content-box;
  325. outline: none;
  326. flex: 1;
  327. overflow: auto;
  328. }
  329. .zammad-chat-input::-webkit-input-placeholder {
  330. color: hsl(0, 0%, 85%);
  331. }
  332. .zammad-chat-button {
  333. appearance: none;
  334. font-family: inherit;
  335. font-size: inherit;
  336. line-height: initial;
  337. background: hsl(203, 67%, 53%);
  338. color: white;
  339. padding: 0.5em 1.2em;
  340. margin: 0.63em 1em;
  341. cursor: pointer;
  342. border: none;
  343. border-radius: 1.5em;
  344. box-shadow: 0 2px rgba(255, 255, 255, 0.25) inset,
  345. 0 0 0 1px rgba(0, 0, 0, 0.1) inset, 0 1px rgba(0, 0, 0, 0.1);
  346. outline: none;
  347. display: inline-block;
  348. }
  349. .zammad-chat-send {
  350. float: right;
  351. }
  352. .zammad-chat-button:disabled,
  353. .zammad-chat-input:disabled {
  354. cursor: not-allowed;
  355. opacity: 0.3;
  356. }
  357. .zammad-chat-is-hidden {
  358. display: none;
  359. }
  360. /*
  361. # Flat Design
  362. */
  363. .zammad-chat--flat .zammad-chat-header,
  364. .zammad-chat--flat .zammad-chat-body {
  365. border: none;
  366. }
  367. .zammad-chat--flat .zammad-chat-header {
  368. box-shadow: none;
  369. }
  370. .zammad-chat--flat .zammad-chat-message-body {
  371. box-shadow: none;
  372. }
  373. .zammad-chat--flat .zammad-chat-agent-status,
  374. .zammad-chat--flat .zammad-chat-button,
  375. .zammad-chat--flat .zammad-chat-status {
  376. box-shadow: none;
  377. }