globals.scss 6.2 KB

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