globals.scss 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. @mixin light {
  2. /* color */
  3. --white: white;
  4. --black: rgb(48, 48, 48);
  5. --gray: rgb(250, 250, 250);
  6. --primary: rgb(29, 147, 171);
  7. --second: rgb(231, 248, 255);
  8. --hover-color: #f3f3f3;
  9. --bar-color: rgba(0, 0, 0, 0.1);
  10. --theme-color: var(--gray);
  11. /* shadow */
  12. --shadow: 50px 50px 100px 10px rgb(0, 0, 0, 0.1);
  13. --card-shadow: 0px 2px 4px 0px rgb(0, 0, 0, 0.05);
  14. /* stroke */
  15. --border-in-light: 1px solid rgb(222, 222, 222);
  16. }
  17. @mixin dark {
  18. /* color */
  19. --white: rgb(30, 30, 30);
  20. --black: rgb(187, 187, 187);
  21. --gray: rgb(21, 21, 21);
  22. --primary: rgb(29, 147, 171);
  23. --second: rgb(27 38 42);
  24. --hover-color: #323232;
  25. --bar-color: rgba(255, 255, 255, 0.1);
  26. --border-in-light: 1px solid rgba(255, 255, 255, 0.192);
  27. --theme-color: var(--gray);
  28. }
  29. .light {
  30. @include light;
  31. }
  32. .dark {
  33. @include dark;
  34. }
  35. .mask {
  36. filter: invert(0.8);
  37. }
  38. :root {
  39. @include light;
  40. --window-width: 90vw;
  41. --window-height: 90vh;
  42. --sidebar-width: 300px;
  43. --window-content-width: calc(100% - var(--sidebar-width));
  44. --message-max-width: 80%;
  45. }
  46. @media only screen and (max-width: 600px) {
  47. :root {
  48. --window-width: 100vw;
  49. --window-height: 100vh;
  50. --sidebar-width: 100vw;
  51. --window-content-width: var(--window-width);
  52. --message-max-width: 100%;
  53. }
  54. .no-mobile {
  55. display: none;
  56. }
  57. }
  58. @media (prefers-color-scheme: dark) {
  59. :root {
  60. @include dark;
  61. }
  62. }
  63. body {
  64. background-color: var(--gray);
  65. color: var(--black);
  66. margin: 0;
  67. padding: 0;
  68. height: 100vh;
  69. width: 100vw;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. user-select: none;
  74. font-family: "Noto Sans SC", "SF Pro SC", "SF Pro Text", "SF Pro Icons",
  75. "PingFang SC", "Helvetica Neue", "Helvetica", "Arial", sans-serif;
  76. @media only screen and (max-width: 600px) {
  77. background-color: var(--second);
  78. }
  79. }
  80. ::-webkit-scrollbar {
  81. --bar-width: 5px;
  82. width: var(--bar-width);
  83. height: var(--bar-width);
  84. }
  85. ::-webkit-scrollbar-track {
  86. background-color: transparent;
  87. }
  88. ::-webkit-scrollbar-thumb {
  89. background-color: var(--bar-color);
  90. border-radius: 20px;
  91. background-clip: content-box;
  92. border: 1px solid transparent;
  93. }
  94. select {
  95. border: var(--border-in-light);
  96. padding: 8px 10px;
  97. border-radius: 10px;
  98. appearance: none;
  99. cursor: pointer;
  100. background-color: var(--white);
  101. color: var(--black);
  102. text-align: center;
  103. }
  104. input {
  105. text-align: center;
  106. }
  107. input[type="checkbox"] {
  108. cursor: pointer;
  109. background-color: var(--white);
  110. color: var(--black);
  111. appearance: none;
  112. border: var(--border-in-light);
  113. border-radius: 5px;
  114. height: 16px;
  115. width: 16px;
  116. display: inline-flex;
  117. align-items: center;
  118. justify-content: center;
  119. }
  120. input[type="checkbox"]:checked::after {
  121. display: inline-block;
  122. width: 8px;
  123. height: 8px;
  124. background-color: var(--primary);
  125. content: " ";
  126. border-radius: 2px;
  127. }
  128. input[type="range"] {
  129. appearance: none;
  130. border: var(--border-in-light);
  131. border-radius: 10px;
  132. padding: 5px 15px 5px 10px;
  133. background-color: var(--white);
  134. color: var(--black);
  135. &::before {
  136. content: attr(value);
  137. font-size: 12px;
  138. }
  139. }
  140. input[type="range"]::-webkit-slider-thumb {
  141. appearance: none;
  142. height: 8px;
  143. width: 20px;
  144. background-color: var(--primary);
  145. border-radius: 10px;
  146. cursor: pointer;
  147. transition: all ease 0.3s;
  148. margin-left: 5px;
  149. }
  150. input[type="range"]::-webkit-slider-thumb:hover {
  151. transform: scaleY(1.2);
  152. width: 24px;
  153. }
  154. input[type="number"],
  155. input[type="text"] {
  156. appearance: none;
  157. border-radius: 10px;
  158. border: var(--border-in-light);
  159. height: 32px;
  160. box-sizing: border-box;
  161. background: var(--white);
  162. color: var(--black);
  163. padding: 0 10px;
  164. max-width: 50%;
  165. }
  166. div.math {
  167. overflow-x: auto;
  168. }
  169. .modal-mask {
  170. z-index: 9999;
  171. position: fixed;
  172. top: 0;
  173. left: 0;
  174. height: 100vh;
  175. width: 100vw;
  176. background-color: rgba($color: #000000, $alpha: 0.5);
  177. display: flex;
  178. align-items: center;
  179. justify-content: center;
  180. }
  181. .link {
  182. font-size: 12px;
  183. color: var(--primary);
  184. text-decoration: none;
  185. &:hover {
  186. text-decoration: underline;
  187. }
  188. }
  189. pre {
  190. position: relative;
  191. &:hover .copy-code-button {
  192. pointer-events: all;
  193. transform: translateX(0px);
  194. opacity: 0.5;
  195. }
  196. .copy-code-button {
  197. position: absolute;
  198. right: 10px;
  199. cursor: pointer;
  200. padding: 0px 5px;
  201. background-color: var(--black);
  202. color: var(--white);
  203. border: var(--border-in-light);
  204. border-radius: 10px;
  205. transform: translateX(10px);
  206. pointer-events: none;
  207. opacity: 0;
  208. transition: all ease 0.3s;
  209. &:after {
  210. content: "copy";
  211. }
  212. &:hover {
  213. opacity: 1;
  214. }
  215. }
  216. }