暫無描述
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

app-chat.scss 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. /* App Chat
  2. ******************************************************************************* */
  3. @import "../_bootstrap-extended/include";
  4. @import "../_components/include";
  5. // Variables
  6. $chat-app-height: calc(100vh - 11.3rem);
  7. $chat-app-height-with-no-navbar: calc(100vh - 6.5rem);
  8. $chat-app-horizontal-height-diff: 3rem;
  9. $chat-contact-width: 21rem;
  10. $chat-contact-list-padding-x: .75rem;
  11. $chat-contact-list-padding-y: .528rem;
  12. $chat-contact-list-margin-x: $chat-contact-list-padding-x;
  13. $chat-contact-list-margin-y: .25rem;
  14. $chat-history-padding-x: 1.5rem;
  15. $chat-history-padding-y: 1.5rem;
  16. $chat-history-height: calc(100vh - 22rem);
  17. $chat-history-height-with-no-nabvar: calc(100vh - 17.6rem);
  18. $chat-history-header-padding-x: $chat-history-padding-x;
  19. $chat-history-header-padding-y: 1.05rem;
  20. $chat-history-footer-padding: .5rem;
  21. $chat-history-footer-margin: $chat-history-padding-x;
  22. $chat-message-text-padding-x: 1rem;
  23. $chat-message-text-padding-y: .543rem;
  24. $chat-message-text-border-radius: $border-radius;
  25. $chat-list-margin: 3rem;
  26. /* App Chat Global */
  27. .app-chat {
  28. --#{$prefix}chat-bg: #f7f8f8;
  29. position: relative;
  30. block-size: $chat-app-height;
  31. .layout-navbar-hidden & {
  32. block-size: $chat-app-height-with-no-navbar;
  33. }
  34. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  35. .layout-horizontal & {
  36. block-size: calc($chat-app-height - $chat-app-horizontal-height-diff);
  37. }
  38. }
  39. /* Common Styles Of two sidebars */
  40. .app-sidebar {
  41. @media (width <= 992px) {
  42. z-index: 4;
  43. }
  44. .sidebar-header {
  45. position: relative;
  46. .close-sidebar {
  47. position: absolute;
  48. inset-block-start: 1.25rem;
  49. inset-inline-end: 1.25rem;
  50. }
  51. .chat-sidebar-avatar {
  52. block-size: 84px;
  53. inline-size: 84px;
  54. &::after {
  55. block-size: 16.8px;
  56. box-shadow: 0 0 0 .25rem var(--#{$prefix}paper-bg);
  57. inline-size: 16.8px;
  58. inset-block-end: 6px;
  59. }
  60. }
  61. }
  62. }
  63. .app-chat-contacts,
  64. .app-chat-sidebar-left {
  65. background-color: var(--#{$prefix}paper-bg);
  66. .chat-actions {
  67. .chat-search-input {
  68. background-color: var(--#{$prefix}body-bg);
  69. }
  70. }
  71. .sidebar-body {
  72. .chat-contact-list {
  73. li {
  74. &.active {
  75. background-color: var(--#{$prefix}primary);
  76. box-shadow: 0 .125rem .25rem 0 rgba(var(--#{$prefix}primary-rgb), .4);
  77. color: var(--#{$prefix}white);
  78. h6,
  79. .chat-contact-list-item-time {
  80. color: var(--#{$prefix}white);
  81. }
  82. }
  83. .chat-contact-list-item-time {
  84. color: var(--#{$prefix}secondary-color);
  85. }
  86. }
  87. }
  88. .chat-sidebar-avatar {
  89. block-size: 84px;
  90. inline-size: 84px;
  91. &::after {
  92. block-size: 16.8px;
  93. inline-size: 16.8px;
  94. inset-block-end: 6px;
  95. }
  96. }
  97. }
  98. }
  99. .app-chat-contacts {
  100. position: absolute;
  101. flex-basis: $chat-contact-width;
  102. block-size: $chat-app-height;
  103. inline-size: $chat-contact-width;
  104. inset-inline-start: calc(-#{$chat-contact-width} - 1rem);
  105. transition: all .25s ease;
  106. .sidebar-header {
  107. block-size: 4.75rem;
  108. }
  109. .layout-navbar-hidden & {
  110. block-size: $chat-app-height-with-no-navbar;
  111. }
  112. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  113. .layout-horizontal & {
  114. block-size: calc($chat-app-height - $chat-app-horizontal-height-diff);
  115. }
  116. }
  117. @media (width >= 992px) {
  118. position: static;
  119. }
  120. &.show {
  121. inset-inline-start: 0;
  122. }
  123. .sidebar-body {
  124. block-size: calc(#{$chat-app-height} - 4.7rem);
  125. .layout-navbar-hidden & {
  126. block-size: calc(#{$chat-app-height-with-no-navbar} - 4.7rem);
  127. }
  128. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  129. .layout-horizontal & {
  130. block-size: calc(#{$chat-app-height} - 4.7rem - #{$chat-app-horizontal-height-diff});
  131. }
  132. }
  133. .chat-contact-list {
  134. li.chat-contact-list-item {
  135. display: flex;
  136. justify-content: space-between;
  137. @include border-radius($chat-message-text-border-radius);
  138. cursor: pointer;
  139. margin-block: $chat-contact-list-margin-y;
  140. margin-inline: $chat-contact-list-margin-x;
  141. padding-block: $chat-contact-list-padding-y;
  142. padding-inline: $chat-contact-list-padding-x;
  143. a {
  144. inline-size: 100%;
  145. }
  146. .chat-contact-info {
  147. min-inline-size: 0;
  148. .chat-contact-name {
  149. line-height: 1.5;
  150. }
  151. }
  152. small {
  153. white-space: nowrap;
  154. }
  155. }
  156. li.chat-contact-list-item-title {
  157. padding-block: $chat-contact-list-padding-y ($chat-contact-list-padding-y * .5);
  158. padding-inline: ($chat-contact-list-padding-y * 1.9);
  159. }
  160. }
  161. }
  162. }
  163. .app-chat-sidebar-left,
  164. .app-chat-sidebar-right {
  165. position: absolute;
  166. z-index: 5;
  167. block-size: $chat-app-height;
  168. inline-size: $chat-contact-width;
  169. inset-block-start: 0;
  170. opacity: 0;
  171. transition: all .25s ease;
  172. .layout-navbar-hidden & {
  173. block-size: $chat-app-height-with-no-navbar;
  174. }
  175. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  176. .layout-horizontal & {
  177. block-size: calc($chat-app-height - $chat-app-horizontal-height-diff);
  178. }
  179. }
  180. &.show {
  181. opacity: 1;
  182. }
  183. }
  184. .app-chat-sidebar-left {
  185. inset-inline-start: calc(-#{$chat-contact-width} - 1rem);
  186. &.show {
  187. inset-inline-start: 0;
  188. }
  189. .sidebar-body {
  190. block-size: calc(#{$chat-app-height} - 12.5rem);
  191. .layout-navbar-hidden & {
  192. block-size: calc(#{$chat-app-height-with-no-navbar} - 12.5rem);
  193. }
  194. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  195. .layout-horizontal & {
  196. block-size: calc(#{$chat-app-height} - 12.3rem - #{$chat-app-horizontal-height-diff});
  197. }
  198. }
  199. }
  200. }
  201. .app-chat-conversation {
  202. background-color: var(--#{$prefix}chat-bg);
  203. block-size: $chat-app-height;
  204. .layout-navbar-hidden & {
  205. block-size: $chat-app-height-with-no-navbar;
  206. }
  207. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  208. .layout-horizontal & {
  209. block-size: calc($chat-app-height - $chat-app-horizontal-height-diff);
  210. }
  211. }
  212. .app-chat-conversation-btn {
  213. display: none;
  214. @media (width <= 992px) {
  215. display: block;
  216. }
  217. }
  218. }
  219. .app-chat-history {
  220. position: relative;
  221. background-color: var(--#{$prefix}chat-bg);
  222. block-size: $chat-app-height;
  223. transition: all .25s ease;
  224. .layout-navbar-hidden & {
  225. block-size: $chat-app-height-with-no-navbar;
  226. }
  227. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  228. .layout-horizontal & {
  229. block-size: calc($chat-app-height - $chat-app-horizontal-height-diff);
  230. }
  231. }
  232. .chat-history-wrapper {
  233. background-color: var(--#{$prefix}chat-bg);
  234. }
  235. .chat-history-header,
  236. .chat-history-footer {
  237. background-color: var(--#{$prefix}paper-bg);
  238. }
  239. .chat-history-header {
  240. margin-block-start: -1px;
  241. padding-block: $chat-history-header-padding-y;
  242. padding-inline: $chat-history-header-padding-x;
  243. }
  244. .chat-history-body {
  245. overflow: hidden;
  246. block-size: $chat-history-height;
  247. padding-block: $chat-history-padding-y;
  248. padding-inline: $chat-history-padding-x;
  249. .layout-navbar-hidden & {
  250. block-size: $chat-history-height-with-no-nabvar;
  251. }
  252. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  253. .layout-horizontal & {
  254. block-size: calc($chat-history-height - $chat-app-horizontal-height-diff);
  255. }
  256. }
  257. .chat-history {
  258. .chat-message {
  259. display: flex;
  260. justify-content: flex-start;
  261. .chat-message-text {
  262. @include border-radius($chat-message-text-border-radius);
  263. background-color: var(--#{$prefix}paper-bg);
  264. box-shadow: var(--#{$prefix}box-shadow-xs);
  265. padding-block: $chat-message-text-padding-y;
  266. padding-inline: $chat-message-text-padding-x;
  267. }
  268. &.chat-message-right {
  269. justify-content: flex-end;
  270. .chat-message-text {
  271. background-color: var(--#{$prefix}primary);
  272. border-start-end-radius: 0;
  273. color: var(--#{$prefix}white);
  274. }
  275. }
  276. &:not(.chat-message-right) .chat-message-text {
  277. border-start-start-radius: 0;
  278. }
  279. .thumbnail {
  280. cursor: zoom-in;
  281. }
  282. &:not(:last-child) {
  283. margin-block-end: $chat-list-margin;
  284. }
  285. }
  286. }
  287. }
  288. .chat-history-footer {
  289. padding: $chat-history-footer-padding;
  290. @include border-radius($chat-message-text-border-radius);
  291. margin: $chat-history-footer-margin;
  292. box-shadow: var(--#{$prefix}box-shadow-xs);
  293. padding-inline-start: 2px;
  294. .form-control.message-input {
  295. padding-block: calc($input-padding-y - $input-border-width);
  296. padding-inline: calc($input-padding-x - $input-border-width);
  297. }
  298. }
  299. }
  300. .app-chat-sidebar-right {
  301. background-color: var(--#{$prefix}paper-bg);
  302. box-shadow: 16px 1px 45px 3px rgba($black, .5);
  303. inset-inline-end: calc(-#{$chat-contact-width} - 1rem);
  304. &.show {
  305. inset-inline-end: 0;
  306. }
  307. .sidebar-body {
  308. block-size: calc(#{$chat-app-height} - 12.3rem);
  309. .layout-navbar-hidden & {
  310. block-size: calc(#{$chat-app-height-with-no-navbar} - 12.3rem);
  311. }
  312. @include media-breakpoint-up($menu-collapsed-layout-breakpoint) {
  313. .layout-horizontal & {
  314. block-size: calc(#{$chat-app-height} - 12.1rem - #{$chat-app-horizontal-height-diff});
  315. }
  316. }
  317. }
  318. }
  319. }
  320. /* Small screen media */
  321. @media (width <= 576px) {
  322. .app-chat {
  323. .app-chat-sidebar-right,
  324. .app-chat-sidebar-left,
  325. .app-chat-contacts {
  326. &.show {
  327. inline-size: 100%;
  328. }
  329. }
  330. }
  331. }
  332. /* Dark Theme */
  333. @if $enable-dark-mode {
  334. @include color-mode(dark) {
  335. .app-chat {
  336. --#{$prefix}chat-bg: #20202e;
  337. }
  338. }
  339. }