globals.scss 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338
  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. font-family: inherit;
  119. }
  120. input[type="checkbox"] {
  121. cursor: pointer;
  122. background-color: var(--white);
  123. color: var(--black);
  124. appearance: none;
  125. border: var(--border-in-light);
  126. border-radius: 5px;
  127. height: 16px;
  128. width: 16px;
  129. display: inline-flex;
  130. align-items: center;
  131. justify-content: center;
  132. }
  133. input[type="checkbox"]:checked::after {
  134. display: inline-block;
  135. width: 8px;
  136. height: 8px;
  137. background-color: var(--primary);
  138. content: " ";
  139. border-radius: 2px;
  140. }
  141. input[type="range"] {
  142. appearance: none;
  143. background-color: var(--white);
  144. color: var(--black);
  145. }
  146. @mixin thumb() {
  147. appearance: none;
  148. height: 8px;
  149. width: 20px;
  150. background-color: var(--primary);
  151. border-radius: 10px;
  152. cursor: pointer;
  153. transition: all ease 0.3s;
  154. margin-left: 5px;
  155. border: none;
  156. }
  157. input[type="range"]::-webkit-slider-thumb {
  158. @include thumb();
  159. }
  160. input[type="range"]::-moz-range-thumb {
  161. @include thumb();
  162. }
  163. input[type="range"]::-ms-thumb {
  164. @include thumb();
  165. }
  166. @mixin thumbHover() {
  167. transform: scaleY(1.2);
  168. width: 24px;
  169. }
  170. input[type="range"]::-webkit-slider-thumb:hover {
  171. @include thumbHover();
  172. }
  173. input[type="range"]::-moz-range-thumb:hover {
  174. @include thumbHover();
  175. }
  176. input[type="range"]::-ms-thumb:hover {
  177. @include thumbHover();
  178. }
  179. input[type="number"],
  180. input[type="text"],
  181. input[type="password"] {
  182. appearance: none;
  183. border-radius: 10px;
  184. border: var(--border-in-light);
  185. min-height: 36px;
  186. box-sizing: border-box;
  187. background: var(--white);
  188. color: var(--black);
  189. padding: 0 10px;
  190. max-width: 50%;
  191. font-family: inherit;
  192. }
  193. div.math {
  194. overflow-x: auto;
  195. }
  196. .modal-mask {
  197. z-index: 9999;
  198. position: fixed;
  199. top: 0;
  200. left: 0;
  201. height: var(--full-height);
  202. width: 100vw;
  203. background-color: rgba($color: #000000, $alpha: 0.5);
  204. display: flex;
  205. align-items: center;
  206. justify-content: center;
  207. }
  208. .link {
  209. font-size: 12px;
  210. color: var(--primary);
  211. text-decoration: none;
  212. &:hover {
  213. text-decoration: underline;
  214. }
  215. }
  216. pre {
  217. position: relative;
  218. &:hover .copy-code-button {
  219. pointer-events: all;
  220. transform: translateX(0px);
  221. opacity: 0.5;
  222. }
  223. .copy-code-button {
  224. position: absolute;
  225. right: 10px;
  226. top: 1em;
  227. cursor: pointer;
  228. padding: 0px 5px;
  229. background-color: var(--black);
  230. color: var(--white);
  231. border: var(--border-in-light);
  232. border-radius: 10px;
  233. transform: translateX(10px);
  234. pointer-events: none;
  235. opacity: 0;
  236. transition: all ease 0.3s;
  237. &:after {
  238. content: "copy";
  239. }
  240. &:hover {
  241. opacity: 1;
  242. }
  243. }
  244. }
  245. .clickable {
  246. cursor: pointer;
  247. &:hover {
  248. filter: brightness(0.9);
  249. }
  250. }
  251. .error {
  252. width: 80%;
  253. border-radius: 20px;
  254. border: var(--border-in-light);
  255. box-shadow: var(--card-shadow);
  256. padding: 20px;
  257. overflow: auto;
  258. background-color: var(--white);
  259. color: var(--black);
  260. pre {
  261. overflow: auto;
  262. }
  263. }
  264. .password-input-container {
  265. max-width: 50%;
  266. display: flex;
  267. justify-content: flex-end;
  268. .password-eye {
  269. margin-right: 4px;
  270. }
  271. .password-input {
  272. min-width: 80%;
  273. }
  274. }
  275. .user-avtar {
  276. height: 30px;
  277. width: 30px;
  278. display: flex;
  279. align-items: center;
  280. justify-content: center;
  281. border: var(--border-in-light);
  282. box-shadow: var(--card-shadow);
  283. border-radius: 10px;
  284. }