globals.scss 5.9 KB

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