globals.scss 5.3 KB

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