globals.scss 6.1 KB

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