globals.scss 6.0 KB

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