demo.css 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425
  1. :root {
  2. --bg-color: #111;
  3. --text-color: #9b9b9b;
  4. --highlight-color: #ff4b4b;
  5. --secondary-color: #2a2a2e;
  6. --accent-color: #ff9f43;
  7. --code-bg: #000;
  8. --orange: #FF8F42;
  9. --border-color: #222;
  10. --panel-bg: #171717;
  11. --panel-bg-2: #141414;
  12. --muted-1: #666;
  13. --muted-2: #888;
  14. --text-strong: #e6e6e6;
  15. --shadow-1: 0 10px 40px rgba(0,0,0,0.25);
  16. }
  17. body {
  18. background-color: var(--bg-color);
  19. color: var(--text-color);
  20. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  21. margin: 0;
  22. padding: 60px 60px;
  23. display: flex;
  24. justify-content: center;
  25. overflow-y: auto;
  26. }
  27. /* Auto-hide scrollbar (shown only on scroll/hover via parent) */
  28. html, body {
  29. scrollbar-width: none; /* Firefox (hidden by default) */
  30. -ms-overflow-style: none; /* IE/old Edge */
  31. }
  32. html::-webkit-scrollbar,
  33. body::-webkit-scrollbar {
  34. width: 0 !important;
  35. height: 0 !important;
  36. }
  37. /* Some pages may scroll a nested container; hide vertical scrollbars by default */
  38. *::-webkit-scrollbar:vertical {
  39. width: 0 !important;
  40. }
  41. /* Shown when scrolling (class is toggled by doc/index.html) */
  42. html.scrolling,
  43. body.scrolling {
  44. scrollbar-width: thin; /* Firefox */
  45. scrollbar-color: rgba(0, 0, 0, 0.9) transparent;
  46. }
  47. html.scrolling::-webkit-scrollbar,
  48. body.scrolling::-webkit-scrollbar {
  49. width: 6px !important;
  50. height: 6px !important;
  51. }
  52. html.scrolling::-webkit-scrollbar-track,
  53. body.scrolling::-webkit-scrollbar-track {
  54. background: transparent;
  55. }
  56. html.scrolling::-webkit-scrollbar-thumb,
  57. body.scrolling::-webkit-scrollbar-thumb {
  58. background: rgba(0, 0, 0, 0.95) !important;
  59. border-radius: 999px;
  60. }
  61. html.scrolling::-webkit-scrollbar-thumb:hover,
  62. body.scrolling::-webkit-scrollbar-thumb:hover {
  63. background: rgba(0, 0, 0, 1);
  64. }
  65. /* Show vertical scrollbars (narrow + black) for any scrolled container while scrolling */
  66. html.scrolling *::-webkit-scrollbar:vertical,
  67. body.scrolling *::-webkit-scrollbar:vertical {
  68. width: 6px !important;
  69. }
  70. html.scrolling *::-webkit-scrollbar-thumb,
  71. body.scrolling *::-webkit-scrollbar-thumb {
  72. background: rgba(0, 0, 0, 0.95) !important;
  73. border-radius: 999px;
  74. }
  75. html.scrolling *::-webkit-scrollbar-track,
  76. body.scrolling *::-webkit-scrollbar-track {
  77. background: transparent !important;
  78. }
  79. .container {
  80. width: 100%;
  81. }
  82. h1 {
  83. color: var(--orange);
  84. font-size: 42px;
  85. margin-bottom: 15px;
  86. font-weight: 600;
  87. letter-spacing: -1px;
  88. }
  89. .description {
  90. font-size: 18px;
  91. line-height: 1.5;
  92. margin-bottom: 40px;
  93. color: #ccc;
  94. }
  95. h2 {
  96. font-size: 24px;
  97. color: #fff;
  98. margin-bottom: 10px;
  99. font-weight: 500;
  100. }
  101. p {
  102. margin-top: 0;
  103. margin-bottom: 20px;
  104. line-height: 1.6;
  105. }
  106. code.inline {
  107. background: rgba(255,255,255,0.1);
  108. color: #e6e6e6;
  109. padding: 2px 6px;
  110. border-radius: 3px;
  111. font-family: 'Roboto Mono', monospace;
  112. font-size: 0.9em;
  113. }
  114. /* Page top meta (breadcrumb + since) */
  115. .page-top {
  116. display: flex;
  117. align-items: center;
  118. justify-content: space-between;
  119. margin-bottom: 18px;
  120. }
  121. .crumb {
  122. font-size: 10px;
  123. font-weight: 800;
  124. letter-spacing: 1px;
  125. color: var(--highlight-color);
  126. text-transform: uppercase;
  127. }
  128. .since {
  129. font-size: 10px;
  130. font-weight: 700;
  131. letter-spacing: 1px;
  132. color: #7a6a55;
  133. text-transform: uppercase;
  134. }
  135. /* Code & Demo Box */
  136. .box-container {
  137. margin-top: 50px;
  138. background: var(--panel-bg);
  139. border-radius: 6px;
  140. overflow: hidden;
  141. box-shadow: var(--shadow-1);
  142. }
  143. .box-header {
  144. display: flex;
  145. justify-content: space-between;
  146. align-items: center;
  147. padding: 0 20px;
  148. height: 50px;
  149. background: rgba(255,255,255,0.02);
  150. border-bottom: 1px solid var(--border-color);
  151. }
  152. .box-title {
  153. color: var(--orange);
  154. font-weight: 600;
  155. font-size: 14px;
  156. }
  157. .box-right {
  158. display: flex;
  159. align-items: center;
  160. gap: 14px;
  161. height: 100%;
  162. }
  163. .tabs {
  164. display: flex;
  165. gap: 20px;
  166. height: 100%;
  167. }
  168. .tab {
  169. display: flex;
  170. align-items: center;
  171. height: 100%;
  172. cursor: pointer;
  173. color: #666;
  174. font-weight: 600;
  175. font-size: 13px;
  176. border-bottom: 2px solid transparent;
  177. transition: color 0.2s;
  178. }
  179. .tab:hover {
  180. color: #999;
  181. }
  182. .tab.active {
  183. color: var(--orange);
  184. border-bottom-color: var(--orange);
  185. }
  186. /* Code Views */
  187. .code-view, .html-view, .css-view {
  188. background: var(--code-bg);
  189. padding: 20px;
  190. font-family: 'Roboto Mono', 'Monaco', monospace;
  191. font-size: 13px;
  192. line-height: 1.6;
  193. color: #abb2bf;
  194. overflow-x: auto;
  195. display: none;
  196. white-space: pre; /* Use pre to respect indentation */
  197. margin: 0;
  198. }
  199. .code-view.active, .html-view.active, .css-view.active {
  200. display: block;
  201. }
  202. /* Reduce background paint cost while a layer is open */
  203. .layer-open .box-header,
  204. .layer-open .code-view,
  205. .layer-open .html-view,
  206. .layer-open .css-view,
  207. .layer-open .feature-desc {
  208. visibility: hidden;
  209. }
  210. /* Syntax Highlighting */
  211. .kwd { color: #c678dd; }
  212. .str { color: #98c379; }
  213. .fun { color: #61afef; }
  214. .num { color: #d19a66; }
  215. .tag { color: #e06c75; }
  216. .attr { color: #d19a66; }
  217. .val { color: #98c379; }
  218. .punc { color: #abb2bf; }
  219. .com { color: #5c6370; font-style: italic; }
  220. /* Header icon buttons (copy, etc.) */
  221. .icon-btn {
  222. appearance: none;
  223. border: 1px solid transparent;
  224. background: transparent;
  225. color: #777;
  226. width: 28px;
  227. height: 28px;
  228. border-radius: 8px;
  229. display: inline-flex;
  230. align-items: center;
  231. justify-content: center;
  232. cursor: pointer;
  233. transition: border-color 0.15s, background 0.15s, color 0.15s;
  234. }
  235. .icon-btn:hover {
  236. color: #b0b0b0;
  237. border-color: #2a2a2a;
  238. background: rgba(255,255,255,0.03);
  239. }
  240. .icon-btn:active {
  241. transform: translateY(1px);
  242. }
  243. .icon-btn svg {
  244. width: 16px;
  245. height: 16px;
  246. display: block;
  247. }
  248. /* Visual Demo Area */
  249. .demo-visual {
  250. padding: 30px;
  251. background: #1a1a1a;
  252. border-top: 1px solid var(--border-color);
  253. min-height: 150px;
  254. /* Flex alignment defaults, can be overridden by specific page styles */
  255. display: flex;
  256. flex-direction: column;
  257. justify-content: center;
  258. }
  259. .action-bar {
  260. padding: 15px 30px;
  261. display: flex;
  262. justify-content: flex-end;
  263. align-items: center;
  264. gap: 10px;
  265. border-top: 1px solid var(--border-color);
  266. }
  267. .play-btn {
  268. background: transparent;
  269. border: 1px solid #444;
  270. color: #fff;
  271. padding: 6px 14px;
  272. border-radius: 100px;
  273. font-size: 12px;
  274. font-weight: 600;
  275. cursor: pointer;
  276. transition: all 0.2s;
  277. }
  278. .play-btn:hover {
  279. border-color: var(--orange);
  280. color: var(--orange);
  281. }
  282. /* Secondary action button (pause/resume) */
  283. .play-btn.secondary {
  284. border-color: #2f2f2f;
  285. color: #c8c8c8;
  286. background: rgba(255, 255, 255, 0.02);
  287. }
  288. .play-btn.secondary:hover {
  289. border-color: #5a5a5a;
  290. color: #e6e6e6;
  291. }
  292. /* Small per-demo note block (feature description) */
  293. .feature-desc {
  294. padding: 14px 20px;
  295. border-top: 1px solid var(--border-color);
  296. background: rgba(255, 255, 255, 0.01);
  297. color: #9a9a9a;
  298. font-size: 12px;
  299. line-height: 1.6;
  300. }
  301. .feature-desc strong {
  302. color: #ddd;
  303. font-weight: 700;
  304. }
  305. /* Toast */
  306. .toast {
  307. position: fixed;
  308. right: 16px;
  309. bottom: 16px;
  310. background: rgba(20,20,20,0.95);
  311. border: 1px solid #2a2a2a;
  312. color: #ddd;
  313. padding: 10px 12px;
  314. border-radius: 10px;
  315. font-size: 12px;
  316. box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  317. opacity: 0;
  318. transform: translateY(10px);
  319. transition: opacity 0.18s, transform 0.18s;
  320. pointer-events: none;
  321. }
  322. .toast.show {
  323. opacity: 1;
  324. transform: translateY(0);
  325. }
  326. /* Previous / Next nav */
  327. .doc-nav {
  328. margin-top: 28px;
  329. padding-top: 18px;
  330. border-top: 1px solid var(--border-color);
  331. display: flex;
  332. align-items: center;
  333. justify-content: space-between;
  334. color: #aaa;
  335. font-size: 12px;
  336. }
  337. .doc-nav a {
  338. color: #aaa;
  339. text-decoration: none;
  340. padding: 10px 12px;
  341. border-radius: 10px;
  342. border: 1px solid transparent;
  343. min-width: 180px;
  344. display: inline-flex;
  345. align-items: center;
  346. justify-content: space-between;
  347. gap: 14px;
  348. background: rgba(255,255,255,0.02);
  349. }
  350. .doc-nav a:hover {
  351. border-color: #2a2a2a;
  352. background: rgba(255,255,255,0.03);
  353. color: #ddd;
  354. }
  355. .doc-nav .nav-label {
  356. color: #777;
  357. font-weight: 700;
  358. text-transform: uppercase;
  359. letter-spacing: 0.8px;
  360. font-size: 10px;
  361. }
  362. .doc-nav .nav-title {
  363. color: #cfcfcf;
  364. font-weight: 600;
  365. font-size: 12px;
  366. }
  367. .doc-nav .nav-center {
  368. color: #7a7a7a;
  369. font-weight: 600;
  370. letter-spacing: 0.4px;
  371. }