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.

233 lines
4.8 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. .icon.icon-giphy
  61. background-image: url(../res/giphy-dark.svg)
  62. main.theme-black
  63. --highlight-color: #222
  64. --search-box-color: var(--highlight-color)
  65. --text-color: white
  66. background-color: black
  67. .icon.icon-giphy
  68. background-image: url(../res/giphy-dark.svg)
  69. div.powered-by-giphy
  70. padding: 1rem
  71. > img
  72. width: 100%
  73. .icon
  74. width: 100%
  75. height: 100%
  76. background-color: var(--text-color)
  77. mask-size: contain
  78. -webkit-mask-size: contain
  79. mask-image: var(--icon-image)
  80. -webkit-mask-image: var(--icon-image)
  81. &.icon-settings
  82. --icon-image: url(../res/settings.svg)
  83. &.icon-recent
  84. --icon-image: url(../res/recent.svg)
  85. &.icon.icon-search
  86. --icon-image: url(../res/search.svg)
  87. &.icon.icon-giphy
  88. background: center / contain no-repeat url(../res/giphy-light.svg)
  89. mask: unset
  90. nav
  91. display: flex
  92. overflow-x: auto
  93. > a
  94. border-bottom: $nav-bottom-highlight solid transparent
  95. &.visible
  96. border-bottom-color: green
  97. > div.sticker
  98. width: $nav-sticker-size
  99. height: $nav-sticker-size
  100. div.pack-list, nav
  101. scrollbar-width: none
  102. &::-webkit-scrollbar
  103. display: none
  104. div.pack-list
  105. overflow-y: auto
  106. div.pack-list.ios-safari-hack
  107. position: fixed
  108. top: calc(#{$nav-height} + #{$search-box-height})
  109. bottom: 0
  110. left: 0
  111. right: 0
  112. -webkit-overflow-scrolling: touch
  113. div.search-error,
  114. div.search-empty
  115. margin: 1.2rem
  116. text-align: center
  117. font-weight: bold
  118. div.search-error
  119. color: #c43e3e
  120. section.stickerpack
  121. margin-top: .75rem
  122. > div.sticker-list
  123. display: flex
  124. flex-wrap: wrap
  125. > h1
  126. margin: 0 0 0 .75rem
  127. section.stickerpack#pack-giphy
  128. display: flex
  129. justify-content: space-between
  130. flex-direction: column
  131. min-height: 100%
  132. div.sticker
  133. display: flex
  134. padding: 4px
  135. cursor: pointer
  136. position: relative
  137. width: var(--sticker-size)
  138. height: var(--sticker-size)
  139. box-sizing: border-box
  140. &:hover
  141. background-color: var(--highlight-color)
  142. > img
  143. display: none
  144. width: 100%
  145. object-fit: contain
  146. &.visible
  147. display: initial
  148. > .icon
  149. width: 70%
  150. height: 70%
  151. margin: 15%
  152. div.search-box
  153. position: relative
  154. display: flex
  155. >input[type="text"]
  156. flex-grow: 1
  157. background-color: var(--search-box-color)
  158. outline: none
  159. border: none
  160. border-radius: .25rem
  161. height: $search-box-input-height
  162. padding: $search-box-input-padding
  163. padding-right: calc(#{$search-box-icon-size} + #{$search-box-input-padding})
  164. margin: $search-box-input-margin
  165. font-size: 1rem
  166. color: var(--text-color)
  167. >.search-spinner,
  168. >span.icon
  169. display: flex
  170. position: absolute
  171. top: calc(50% - #{$search-box-icon-size} / 2)
  172. right: $search-box-icon-size
  173. width: $search-box-icon-size
  174. height: $search-box-icon-size
  175. box-sizing: border-box
  176. div.settings-list
  177. display: flex
  178. flex-direction: column
  179. > *
  180. margin: .5rem
  181. button
  182. padding: .5rem
  183. border-radius: .25rem
  184. input
  185. width: 100%