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.

227 lines
4.7 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-empty
  114. margin: 1.2rem
  115. text-align: center
  116. section.stickerpack
  117. margin-top: .75rem
  118. > div.sticker-list
  119. display: flex
  120. flex-wrap: wrap
  121. > h1
  122. margin: 0 0 0 .75rem
  123. section.stickerpack#pack-giphy
  124. display: flex
  125. justify-content: space-between
  126. flex-direction: column
  127. min-height: 100%
  128. div.sticker
  129. display: flex
  130. padding: 4px
  131. cursor: pointer
  132. position: relative
  133. width: var(--sticker-size)
  134. height: var(--sticker-size)
  135. box-sizing: border-box
  136. &:hover
  137. background-color: var(--highlight-color)
  138. > img
  139. display: none
  140. width: 100%
  141. object-fit: contain
  142. &.visible
  143. display: initial
  144. > .icon
  145. width: 70%
  146. height: 70%
  147. margin: 15%
  148. div.search-box
  149. position: relative
  150. display: flex
  151. >input[type="text"]
  152. flex-grow: 1
  153. background-color: var(--search-box-color)
  154. outline: none
  155. border: none
  156. border-radius: .25rem
  157. height: $search-box-input-height
  158. padding: $search-box-input-padding
  159. padding-right: calc(#{$search-box-icon-size} + #{$search-box-input-padding})
  160. margin: $search-box-input-margin
  161. font-size: 1rem
  162. color: var(--text-color)
  163. >span.icon
  164. display: flex
  165. position: absolute
  166. top: calc(50% - #{$search-box-icon-size} / 2)
  167. right: $search-box-icon-size
  168. width: $search-box-icon-size
  169. height: $search-box-icon-size
  170. box-sizing: border-box
  171. div.settings-list
  172. display: flex
  173. flex-direction: column
  174. > *
  175. margin: .5rem
  176. button
  177. padding: .5rem
  178. border-radius: .25rem
  179. input
  180. width: 100%