globals.scss 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  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. touch-action: pan-x pan-y;
  84. font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons",
  85. "PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  86. @media only screen and (max-width: 600px) {
  87. background-color: var(--second);
  88. }
  89. }
  90. ::-webkit-scrollbar {
  91. --bar-width: 5px;
  92. width: var(--bar-width);
  93. height: var(--bar-width);
  94. }
  95. ::-webkit-scrollbar-track {
  96. background-color: transparent;
  97. }
  98. ::-webkit-scrollbar-thumb {
  99. background-color: var(--bar-color);
  100. border-radius: 20px;
  101. background-clip: content-box;
  102. border: 1px solid transparent;
  103. }
  104. select {
  105. border: var(--border-in-light);
  106. padding: 10px;
  107. border-radius: 10px;
  108. appearance: none;
  109. cursor: pointer;
  110. background-color: var(--white);
  111. color: var(--black);
  112. text-align: center;
  113. }
  114. label {
  115. cursor: pointer;
  116. }
  117. input {
  118. text-align: center;
  119. font-family: inherit;
  120. }
  121. input[type="checkbox"] {
  122. cursor: pointer;
  123. background-color: var(--white);
  124. color: var(--black);
  125. appearance: none;
  126. border: var(--border-in-light);
  127. border-radius: 5px;
  128. height: 16px;
  129. width: 16px;
  130. display: inline-flex;
  131. align-items: center;
  132. justify-content: center;
  133. }
  134. input[type="checkbox"]:checked::after {
  135. display: inline-block;
  136. width: 8px;
  137. height: 8px;
  138. background-color: var(--primary);
  139. content: " ";
  140. border-radius: 2px;
  141. }
  142. input[type="range"] {
  143. appearance: none;
  144. background-color: var(--white);
  145. color: var(--black);
  146. }
  147. @mixin thumb() {
  148. appearance: none;
  149. height: 8px;
  150. width: 20px;
  151. background-color: var(--primary);
  152. border-radius: 10px;
  153. cursor: pointer;
  154. transition: all ease 0.3s;
  155. margin-left: 5px;
  156. border: none;
  157. }
  158. input[type="range"]::-webkit-slider-thumb {
  159. @include thumb();
  160. }
  161. input[type="range"]::-moz-range-thumb {
  162. @include thumb();
  163. }
  164. input[type="range"]::-ms-thumb {
  165. @include thumb();
  166. }
  167. @mixin thumbHover() {
  168. transform: scaleY(1.2);
  169. width: 24px;
  170. }
  171. input[type="range"]::-webkit-slider-thumb:hover {
  172. @include thumbHover();
  173. }
  174. input[type="range"]::-moz-range-thumb:hover {
  175. @include thumbHover();
  176. }
  177. input[type="range"]::-ms-thumb:hover {
  178. @include thumbHover();
  179. }
  180. input[type="number"],
  181. input[type="text"],
  182. input[type="password"] {
  183. appearance: none;
  184. border-radius: 10px;
  185. border: var(--border-in-light);
  186. min-height: 36px;
  187. box-sizing: border-box;
  188. background: var(--white);
  189. color: var(--black);
  190. padding: 0 10px;
  191. max-width: 50%;
  192. font-family: inherit;
  193. }
  194. div.math {
  195. overflow-x: auto;
  196. }
  197. .modal-mask {
  198. z-index: 9999;
  199. position: fixed;
  200. top: 0;
  201. left: 0;
  202. height: var(--full-height);
  203. width: 100vw;
  204. background-color: rgba($color: #000000, $alpha: 0.5);
  205. display: flex;
  206. align-items: center;
  207. justify-content: center;
  208. }
  209. .link {
  210. font-size: 12px;
  211. color: var(--primary);
  212. text-decoration: none;
  213. &:hover {
  214. text-decoration: underline;
  215. }
  216. }
  217. pre {
  218. position: relative;
  219. &:hover .copy-code-button {
  220. pointer-events: all;
  221. transform: translateX(0px);
  222. opacity: 0.5;
  223. }
  224. .copy-code-button {
  225. position: absolute;
  226. right: 10px;
  227. top: 1em;
  228. cursor: pointer;
  229. padding: 0px 5px;
  230. background-color: var(--black);
  231. color: var(--white);
  232. border: var(--border-in-light);
  233. border-radius: 10px;
  234. transform: translateX(10px);
  235. pointer-events: none;
  236. opacity: 0;
  237. transition: all ease 0.3s;
  238. &:after {
  239. content: "copy";
  240. }
  241. &:hover {
  242. opacity: 1;
  243. }
  244. }
  245. }
  246. .clickable {
  247. cursor: pointer;
  248. &:hover {
  249. filter: brightness(0.9);
  250. }
  251. }
  252. .error {
  253. width: 80%;
  254. border-radius: 20px;
  255. border: var(--border-in-light);
  256. box-shadow: var(--card-shadow);
  257. padding: 20px;
  258. overflow: auto;
  259. background-color: var(--white);
  260. color: var(--black);
  261. pre {
  262. overflow: auto;
  263. }
  264. }