globals.scss 4.3 KB

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