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.

206 lines
4.3 KiB

  1. // maunium-stickerpicker - A fast and simple Matrix sticker picker widget.
  2. // Copyright (C) 2020 Tulir Asokan
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Affero General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Affero General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Affero General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. *
  17. font-family: sans-serif
  18. body
  19. margin: 0
  20. h1
  21. font-size: 1rem
  22. \:root
  23. --stickers-per-row: 4
  24. --sticker-size: calc(100vw / var(--stickers-per-row))
  25. $nav-sticker-size: 12vw
  26. $nav-bottom-highlight: 2px
  27. $nav-height: calc(#{$nav-sticker-size} + #{$nav-bottom-highlight})
  28. $nav-height-inverse: calc(-#{$nav-sticker-size} - #{$nav-bottom-highlight})
  29. $search-box-icon-size: 1rem
  30. $search-box-input-height: 1rem
  31. $search-box-input-padding: .7rem
  32. $search-box-input-margin: .5rem
  33. $search-box-height: calc(2 * #{$search-box-input-padding} + 2 * #{$search-box-input-margin} + #{$search-box-input-height})
  34. main
  35. color: var(--text-color)
  36. &.spinner
  37. margin-top: 5rem
  38. &.error, &.empty
  39. margin: 2rem
  40. &.empty
  41. text-align: center
  42. &.has-content
  43. position: fixed
  44. top: 0
  45. left: 0
  46. right: 0
  47. bottom: 0
  48. display: grid
  49. grid-template-rows: $nav-height min-content auto
  50. main.theme-light
  51. --highlight-color: #eee
  52. --search-box-color: var(--highlight-color)
  53. --text-color: black
  54. background-color: white
  55. main.theme-dark
  56. --highlight-color: #444
  57. --search-box-color: #383e4b
  58. --text-color: white
  59. background-color: #22262e
  60. main.theme-black
  61. --highlight-color: #222
  62. --search-box-color: var(--highlight-color)
  63. --text-color: white
  64. background-color: black
  65. .icon
  66. width: 100%
  67. height: 100%
  68. background-color: var(--text-color)
  69. mask-size: contain
  70. -webkit-mask-size: contain
  71. mask-image: var(--icon-image)
  72. -webkit-mask-image: var(--icon-image)
  73. &.icon-settings
  74. --icon-image: url(../res/settings.svg)
  75. &.icon-recent
  76. --icon-image: url(../res/recent.svg)
  77. &.icon.icon-search
  78. --icon-image: url(../res/search.svg)
  79. nav
  80. display: flex
  81. overflow-x: auto
  82. > a
  83. border-bottom: $nav-bottom-highlight solid transparent
  84. &.visible
  85. border-bottom-color: green
  86. > div.sticker
  87. width: $nav-sticker-size
  88. height: $nav-sticker-size
  89. div.pack-list, nav
  90. scrollbar-width: none
  91. &::-webkit-scrollbar
  92. display: none
  93. div.pack-list
  94. overflow-y: auto
  95. div.pack-list.ios-safari-hack
  96. position: fixed
  97. top: calc(#{$nav-height} + #{$search-box-height})
  98. bottom: 0
  99. left: 0
  100. right: 0
  101. -webkit-overflow-scrolling: touch
  102. div.search-empty
  103. margin: 1.2rem
  104. text-align: center
  105. section.stickerpack
  106. margin-top: .75rem
  107. > div.sticker-list
  108. display: flex
  109. flex-wrap: wrap
  110. > h1
  111. margin: 0 0 0 .75rem
  112. div.sticker
  113. display: flex
  114. padding: 4px
  115. cursor: pointer
  116. position: relative
  117. width: var(--sticker-size)
  118. height: var(--sticker-size)
  119. box-sizing: border-box
  120. &:hover
  121. background-color: var(--highlight-color)
  122. > img
  123. display: none
  124. width: 100%
  125. object-fit: contain
  126. &.visible
  127. display: initial
  128. > .icon
  129. width: 70%
  130. height: 70%
  131. margin: 15%
  132. div.search-box
  133. position: relative
  134. display: flex
  135. >input[type="text"]
  136. flex-grow: 1
  137. background-color: var(--search-box-color)
  138. outline: none
  139. border: none
  140. border-radius: .25rem
  141. height: $search-box-input-height
  142. padding: $search-box-input-padding
  143. padding-right: calc(#{$search-box-icon-size} + #{$search-box-input-padding})
  144. margin: $search-box-input-margin
  145. font-size: 1rem
  146. color: var(--text-color)
  147. >span.icon
  148. display: flex
  149. position: absolute
  150. top: calc(50% - #{$search-box-icon-size} / 2)
  151. right: $search-box-icon-size
  152. width: $search-box-icon-size
  153. height: $search-box-icon-size
  154. box-sizing: border-box
  155. div.settings-list
  156. display: flex
  157. flex-direction: column
  158. > *
  159. margin: .5rem
  160. button
  161. padding: .5rem
  162. border-radius: .25rem
  163. input
  164. width: 100%