_navigation.scss 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. // Separator for navigation items
  2. @mixin nav-item-separator() {
  3. border-bottom: 1px solid $border-grey;
  4. }
  5. #navigation-header {
  6. background-color: #f5f5f5;
  7. box-shadow: -2px 2px 4px -2px rgba(0,0,0,0.4);
  8. z-index: 18;
  9. .main {
  10. display: flex;
  11. flex-direction: row;
  12. justify-content: flex-start;
  13. align-items: center;
  14. .md-nav-item{
  15. :first-of-type {
  16. margin-left: 0px;
  17. }
  18. }
  19. .md-button {
  20. min-width: 42px;
  21. }
  22. }
  23. .search {
  24. input[type="text"] {
  25. border: 1px solid #ddd;
  26. border-radius: $material-radius;
  27. padding: $main-padding;
  28. box-sizing: border-box;
  29. width: 100%;
  30. margin: 0;
  31. background-color: white;
  32. .md-errors-spacer {
  33. display: none;
  34. }
  35. }
  36. $duration-opacity: 0.1s;
  37. $duration-height: 0.2s;
  38. max-height: 0;
  39. opacity: 0;
  40. visibility: hidden;
  41. // Animation when disappearing
  42. transition: opacity $duration-opacity linear,
  43. max-height $duration-height ease-out $duration-opacity,
  44. visibility 0s linear $duration-height;
  45. &.visible {
  46. padding: $main-padding;
  47. max-height: 50px;
  48. opacity: 1;
  49. visibility: visible;
  50. // Animation when appearing
  51. transition: visibility 0s,
  52. max-height $duration-height ease-in,
  53. opacity $duration-opacity linear $duration-height;
  54. }
  55. }
  56. }
  57. #navigation-conversations,
  58. #navigation-contacts {
  59. .empty {
  60. color: $material-grey;
  61. margin-top: 1em;
  62. margin-left: 4px;
  63. font-size: 1.2em;
  64. font-weight: 300;
  65. }
  66. }
  67. #navigation-conversations {
  68. $border-width: 4px;
  69. $border-count: 2;
  70. overflow-y: auto;
  71. background-color: white;
  72. flex: 1;
  73. .loading-element {
  74. margin-top: 50px;
  75. }
  76. .conversation-wrapper {
  77. display: block;
  78. @include nav-item-separator;
  79. .conversation {
  80. display: flex;
  81. flex-direction: row;
  82. align-items: center;
  83. padding: (1.5 * $main-padding) $main-padding - ($border-width * ($border-count - 1));
  84. border-left: $border-width * $border-count solid white;
  85. &.active, &:hover {
  86. background-color: $dark-background-color;
  87. border-color: $dark-background-color;
  88. }
  89. &:hover:not(.active) {
  90. @include mouse-hand;
  91. }
  92. // Only unread
  93. &.unread {
  94. border-image: linear-gradient(to right, $status-error, $status-error 50%, white 50%, white 100%) 1 100%;
  95. &.active {
  96. border-image: linear-gradient(to right, $status-error, $status-error 50%, $dark-background-color 50%, $dark-background-color 100%) 1 100%;
  97. }
  98. }
  99. // Only starred
  100. &.starred {
  101. border-image: linear-gradient(to right, $status-starred, $status-starred 50%, white 50%, white 100%) 1 100%;
  102. &.active {
  103. border-image: linear-gradient(to right, $status-starred, $status-starred 50%, $dark-background-color 50%, $dark-background-color 100%) 1 100%;
  104. }
  105. }
  106. // Both starred and unread
  107. &.starred.unread {
  108. border-image: linear-gradient(to right, $status-error, $status-error 50%, $status-starred 50%, $status-starred 100%) 1 100%;
  109. }
  110. .avatar-box {
  111. margin-right: 8px;
  112. position: relative;
  113. .loading {
  114. position: absolute;
  115. }
  116. }
  117. .conversation-box {
  118. flex-grow: 1;
  119. display: flex;
  120. flex-direction: column;
  121. overflow: hidden;
  122. .receiver-box,
  123. .message-box {
  124. flex-wrap: nowrap;
  125. line-height: 1.4em;
  126. }
  127. .receiver-box {
  128. flex-grow: 1;
  129. display: flex;
  130. flex-direction: row;
  131. justify-content: space-between;
  132. font-weight: bold;
  133. color: black;
  134. .title {
  135. flex: 1;
  136. white-space: nowrap;
  137. overflow: hidden;
  138. text-overflow: ellipsis;
  139. margin-right: $main-padding;
  140. }
  141. .disabled {
  142. text-decoration: line-through;
  143. }
  144. .muted {
  145. margin: 1px 0 0 4px;
  146. padding: 0;
  147. height: 20px;
  148. i {
  149. color: $material-grey;
  150. font-size: 20px;
  151. margin: 0;
  152. padding: 0;
  153. }
  154. }
  155. }
  156. .message-box {
  157. flex-grow: 1;
  158. .latest-message {
  159. display: flex;
  160. flex-direction: row;
  161. justify-content: space-between;
  162. align-items: center;
  163. color: rgba(0, 0, 0, 0.54); // TODO: Extract color
  164. .left {
  165. white-space: nowrap;
  166. overflow: hidden;
  167. text-overflow: ellipsis;
  168. display: flex;
  169. }
  170. .right {
  171. flex-shrink: 0;
  172. text-align: right;
  173. margin-left: 24px;
  174. .draft {
  175. color: #C62828;
  176. }
  177. }
  178. .message-name, .message-text {
  179. line-height: 1.7em;
  180. }
  181. .message-name:after {
  182. content: ':';
  183. margin-right: 4px;
  184. }
  185. .message-text {
  186. white-space: nowrap;
  187. overflow: hidden;
  188. text-overflow: ellipsis;
  189. }
  190. &.is-hidden {
  191. .no-hidden {
  192. display: none;
  193. }
  194. }
  195. &.is-typing {
  196. .no-typing {
  197. display: none;
  198. }
  199. }
  200. &.show-draft {
  201. .no-draft {
  202. display: none;
  203. }
  204. }
  205. &:not(.is-typing) {
  206. .typing {
  207. display: none;
  208. }
  209. }
  210. &:not(.show-draft) {
  211. .draft {
  212. display: none;
  213. }
  214. }
  215. &:not(.is-hidden) {
  216. .hidden {
  217. display: none;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. .badge.unread-count {
  224. background-color: $status-error;
  225. border-radius: 5px;
  226. color: white;
  227. font-size: 0.9em;
  228. padding: 0 5px;
  229. margin-left: 4px;
  230. }
  231. }
  232. }
  233. }
  234. #navigation-contacts {
  235. overflow-y: scroll;
  236. flex: 1;
  237. .contact {
  238. display: flex;
  239. flex-direction: row;
  240. justify-content: flex-start;
  241. align-items: center;
  242. padding: 12px 8px;
  243. border-left: 4px solid white;
  244. @include nav-item-separator;
  245. .avatar-box {
  246. padding-right: 8px;
  247. }
  248. .left {
  249. flex-grow: 1;
  250. display: flex;
  251. flex-direction: column;
  252. }
  253. .right {
  254. display: flex;
  255. flex-direction: column;
  256. align-items: flex-end;
  257. }
  258. .name {
  259. font-weight: bold;
  260. }
  261. .nickname {
  262. font-size: 0.8em;
  263. }
  264. }
  265. .contact:hover {
  266. @include mouse-hand;
  267. background-color: #f5f5f5;
  268. }
  269. .contact.inactive {
  270. opacity: 0.5;
  271. }
  272. }
  273. #navigation-fab {
  274. position: relative;
  275. md-icon {
  276. color: white;
  277. }
  278. .fab-button-add-contact {
  279. background-color: #D32F2F;
  280. }
  281. .fab-button-add-group {
  282. background-color: #FF9800;
  283. }
  284. .fab-button-add-distribution-list {
  285. background-color: #3F51B5;
  286. }
  287. }