globals.scss 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307
  1. @mixin light {
  2. /* color */
  3. --white: white;
  4. --black: rgb(48, 48, 48);
  5. --gray: rgb(250, 250, 250);
  6. --primary: rgb(29, 147, 171);
  7. --second: rgb(231, 248, 255);
  8. --hover-color: #f3f3f3;
  9. --bar-color: rgba(0, 0, 0, 0.1);
  10. --theme-color: var(--gray);
  11. /* shadow */
  12. --shadow: 50px 50px 100px 10px rgb(0, 0, 0, 0.1);
  13. --card-shadow: 0px 2px 4px 0px rgb(0, 0, 0, 0.05);
  14. /* stroke */
  15. --border-in-light: 1px solid rgb(222, 222, 222);
  16. }
  17. @mixin dark {
  18. /* color */
  19. --white: rgb(30, 30, 30);
  20. --black: rgb(187, 187, 187);
  21. --gray: rgb(21, 21, 21);
  22. --primary: rgb(29, 147, 171);
  23. --second: rgb(27 38 42);
  24. --hover-color: #323232;
  25. --bar-color: rgba(255, 255, 255, 0.1);
  26. --border-in-light: 1px solid rgba(255, 255, 255, 0.192);
  27. --theme-color: var(--gray);
  28. }
  29. .light {
  30. @include light;
  31. }
  32. .dark {
  33. @include dark;
  34. }
  35. .mask {
  36. filter: invert(0.8);
  37. }
  38. :root {
  39. @include light;
  40. --window-width: 90vw;
  41. --window-height: 90vh;
  42. --sidebar-width: 300px;
  43. --window-content-width: calc(100% - var(--sidebar-width));
  44. --message-max-width: 80%;
  45. --full-height: 100%;
  46. }
  47. @media only screen and (max-width: 600px) {
  48. :root {
  49. --window-width: 100vw;
  50. --window-height: var(--full-height);
  51. --sidebar-width: 100vw;
  52. --window-content-width: var(--window-width);
  53. --message-max-width: 100%;
  54. }
  55. .no-mobile {
  56. display: none;
  57. }
  58. }
  59. @media (prefers-color-scheme: dark) {
  60. :root {
  61. @include dark;
  62. }
  63. }
  64. html {
  65. height: var(--full-height);
  66. }
  67. body {
  68. background-color: var(--gray);
  69. color: var(--black);
  70. margin: 0;
  71. padding: 0;
  72. height: var(--full-height);
  73. width: 100vw;
  74. display: flex;
  75. justify-content: center;
  76. align-items: center;
  77. user-select: none;
  78. font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons",
  79. "PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  80. @media only screen and (max-width: 600px) {
  81. background-color: var(--second);
  82. }
  83. }
  84. ::-webkit-scrollbar {
  85. --bar-width: 5px;
  86. width: var(--bar-width);
  87. height: var(--bar-width);
  88. }
  89. ::-webkit-scrollbar-track {
  90. background-color: transparent;
  91. }
  92. ::-webkit-scrollbar-thumb {
  93. background-color: var(--bar-color);
  94. border-radius: 20px;
  95. background-clip: content-box;
  96. border: 1px solid transparent;
  97. }
  98. select {
  99. border: var(--border-in-light);
  100. padding: 10px;
  101. border-radius: 10px;
  102. appearance: none;
  103. cursor: pointer;
  104. background-color: var(--white);
  105. color: var(--black);
  106. text-align: center;
  107. }
  108. label {
  109. cursor: pointer;
  110. }
  111. input {
  112. text-align: center;
  113. }
  114. input[type="checkbox"] {
  115. cursor: pointer;
  116. background-color: var(--white);
  117. color: var(--black);
  118. appearance: none;
  119. border: var(--border-in-light);
  120. border-radius: 5px;
  121. height: 16px;
  122. width: 16px;
  123. display: inline-flex;
  124. align-items: center;
  125. justify-content: center;
  126. }
  127. input[type="checkbox"]:checked::after {
  128. display: inline-block;
  129. width: 8px;
  130. height: 8px;
  131. background-color: var(--primary);
  132. content: " ";
  133. border-radius: 2px;
  134. }
  135. input[type="range"] {
  136. appearance: none;
  137. background-color: var(--white);
  138. color: var(--black);
  139. }
  140. @mixin thumb() {
  141. appearance: none;
  142. height: 8px;
  143. width: 20px;
  144. background-color: var(--primary);
  145. border-radius: 10px;
  146. cursor: pointer;
  147. transition: all ease 0.3s;
  148. margin-left: 5px;
  149. border: none;
  150. }
  151. input[type="range"]::-webkit-slider-thumb {
  152. @include thumb();
  153. }
  154. input[type="range"]::-moz-range-thumb {
  155. @include thumb();
  156. }
  157. input[type="range"]::-ms-thumb {
  158. @include thumb();
  159. }
  160. @mixin thumbHover() {
  161. transform: scaleY(1.2);
  162. width: 24px;
  163. }
  164. input[type="range"]::-webkit-slider-thumb:hover {
  165. @include thumbHover();
  166. }
  167. input[type="range"]::-moz-range-thumb:hover {
  168. @include thumbHover();
  169. }
  170. input[type="range"]::-ms-thumb:hover {
  171. @include thumbHover();
  172. }
  173. input[type="number"],
  174. input[type="text"],
  175. input[type="password"] {
  176. appearance: none;
  177. border-radius: 10px;
  178. border: var(--border-in-light);
  179. min-height: 36px;
  180. box-sizing: border-box;
  181. background: var(--white);
  182. color: var(--black);
  183. padding: 0 10px;
  184. max-width: 50%;
  185. }
  186. div.math {
  187. overflow-x: auto;
  188. }
  189. .modal-mask {
  190. z-index: 9999;
  191. position: fixed;
  192. top: 0;
  193. left: 0;
  194. height: var(--full-height);
  195. width: 100vw;
  196. background-color: rgba($color: #000000, $alpha: 0.5);
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. }
  201. .link {
  202. font-size: 12px;
  203. color: var(--primary);
  204. text-decoration: none;
  205. &:hover {
  206. text-decoration: underline;
  207. }
  208. }
  209. pre {
  210. position: relative;
  211. &:hover .copy-code-button {
  212. pointer-events: all;
  213. transform: translateX(0px);
  214. opacity: 0.5;
  215. }
  216. .copy-code-button {
  217. position: absolute;
  218. right: 10px;
  219. top: 1em;
  220. cursor: pointer;
  221. padding: 0px 5px;
  222. background-color: var(--black);
  223. color: var(--white);
  224. border: var(--border-in-light);
  225. border-radius: 10px;
  226. transform: translateX(10px);
  227. pointer-events: none;
  228. opacity: 0;
  229. transition: all ease 0.3s;
  230. &:after {
  231. content: "copy";
  232. }
  233. &:hover {
  234. opacity: 1;
  235. }
  236. }
  237. }
  238. .clickable {
  239. cursor: pointer;
  240. div:not(.no-dark) > svg {
  241. filter: invert(0.5);
  242. }
  243. &:hover {
  244. filter: brightness(0.9);
  245. }
  246. }
  247. .error {
  248. width: 80%;
  249. border-radius: 20px;
  250. border: var(--border-in-light);
  251. box-shadow: var(--card-shadow);
  252. padding: 20px;
  253. overflow: auto;
  254. background-color: var(--white);
  255. color: var(--black);
  256. pre {
  257. overflow: auto;
  258. }
  259. }