Style.js 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234
  1. export class Style {
  2. static init() {
  3. if ( document.getElementById( 'profiler-styles' ) ) return;
  4. const css = `
  5. :root {
  6. --profiler-bg: #1e1e24f5;
  7. --profiler-header-bg: #2a2a33aa;
  8. --profiler-header: #2a2a33;
  9. --profiler-border: #4a4a5a;
  10. --text-primary: #e0e0e0;
  11. --text-secondary: #9a9aab;
  12. --accent-color: #00aaff;
  13. --color-green: #4caf50;
  14. --color-yellow: #ffc107;
  15. --color-red: #f44336;
  16. --font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  17. --font-mono: 'Fira Code', 'Courier New', Courier, monospace;
  18. }
  19. @import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600&family=Fira+Code&display=swap');
  20. #profiler-panel *, #profiler-toggle * {
  21. text-transform: initial;
  22. line-height: normal;
  23. box-sizing: border-box;
  24. -webkit-font-smoothing: antialiased;
  25. -moz-osx-font-smoothing: grayscale;
  26. }
  27. #profiler-toggle {
  28. position: fixed;
  29. top: 15px;
  30. right: 15px;
  31. background-color: rgba(30, 30, 36, 0.85);
  32. border: 1px solid #4a4a5a54;
  33. border-radius: 6px 12px 12px 6px;
  34. color: var(--text-primary);
  35. cursor: pointer;
  36. z-index: 1001;
  37. transition: all 0.2s ease-in-out;
  38. font-size: 14px;
  39. backdrop-filter: blur(8px);
  40. box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  41. display: flex;
  42. align-items: stretch;
  43. padding: 0;
  44. overflow: hidden;
  45. font-family: var(--font-family);
  46. }
  47. #profiler-toggle:hover {
  48. border-color: var(--accent-color);
  49. }
  50. #profiler-toggle.hidden {
  51. opacity: 0;
  52. pointer-events: none;
  53. }
  54. #toggle-icon {
  55. display: flex;
  56. align-items: center;
  57. justify-content: center;
  58. width: 40px;
  59. font-size: 20px;
  60. transition: background-color 0.2s;
  61. }
  62. #profiler-toggle:hover #toggle-icon {
  63. background-color: rgba(255, 255, 255, 0.05);
  64. }
  65. .toggle-separator {
  66. width: 1px;
  67. background-color: var(--profiler-border);
  68. }
  69. #toggle-text {
  70. display: flex;
  71. align-items: baseline;
  72. padding: 8px 14px;
  73. min-width: 80px;
  74. justify-content: right;
  75. }
  76. #toggle-text .fps-label {
  77. font-size: 0.7em;
  78. margin-left: 10px;
  79. color: #999;
  80. }
  81. #profiler-panel {
  82. position: fixed;
  83. z-index: 1001 !important;
  84. bottom: 0;
  85. left: 0;
  86. right: 0;
  87. height: 350px;
  88. background-color: var(--profiler-bg);
  89. backdrop-filter: blur(8px);
  90. border-top: 2px solid var(--profiler-border);
  91. color: var(--text-primary);
  92. display: flex;
  93. flex-direction: column;
  94. z-index: 1000;
  95. /*box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.5);*/
  96. transform: translateY(100%);
  97. transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94), height 0.3s ease-out, width 0.3s ease-out;
  98. font-family: var(--font-mono);
  99. }
  100. #profiler-panel.resizing,
  101. #profiler-panel.dragging {
  102. transition: none;
  103. }
  104. #profiler-panel.visible {
  105. transform: translateY(0);
  106. }
  107. #profiler-panel.maximized {
  108. height: 100vh;
  109. }
  110. /* Position-specific styles */
  111. #profiler-panel.position-top {
  112. bottom: auto;
  113. top: 0;
  114. border-top: none;
  115. border-bottom: 2px solid var(--profiler-border);
  116. transform: translateY(-100%);
  117. }
  118. #profiler-panel.position-top.visible {
  119. transform: translateY(0);
  120. }
  121. #profiler-panel.position-bottom {
  122. /* Default position - already defined above */
  123. }
  124. #profiler-panel.position-left {
  125. top: 0;
  126. bottom: 0;
  127. left: 0;
  128. right: auto;
  129. width: 350px;
  130. height: 100%;
  131. border-top: none;
  132. border-right: 2px solid var(--profiler-border);
  133. transform: translateX(-100%);
  134. }
  135. #profiler-panel.position-left.visible {
  136. transform: translateX(0);
  137. }
  138. #profiler-panel.position-right {
  139. top: 0;
  140. bottom: 0;
  141. left: auto;
  142. right: 0;
  143. width: 350px;
  144. height: 100%;
  145. border-top: none;
  146. border-left: 2px solid var(--profiler-border);
  147. transform: translateX(100%);
  148. }
  149. #profiler-panel.position-right.visible {
  150. transform: translateX(0);
  151. }
  152. #profiler-panel.position-floating {
  153. border: 2px solid var(--profiler-border);
  154. border-radius: 8px;
  155. box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  156. transform: none !important;
  157. overflow: hidden;
  158. }
  159. #profiler-panel.position-floating.visible {
  160. transform: none !important;
  161. }
  162. #profiler-panel.position-floating .profiler-header {
  163. border-radius: 6px 6px 0 0;
  164. }
  165. #profiler-panel.position-floating .panel-resizer {
  166. bottom: 0;
  167. right: 0;
  168. top: auto;
  169. left: auto;
  170. width: 16px;
  171. height: 16px;
  172. cursor: nwse-resize;
  173. border-radius: 0 0 6px 0;
  174. }
  175. #profiler-panel.position-floating .panel-resizer::after {
  176. content: '';
  177. position: absolute;
  178. right: 2px;
  179. bottom: 2px;
  180. width: 10px;
  181. height: 10px;
  182. background: linear-gradient(135deg, transparent 0%, transparent 45%, var(--profiler-border) 45%, var(--profiler-border) 55%, transparent 55%);
  183. }
  184. .panel-resizer {
  185. position: absolute;
  186. top: -2px;
  187. left: 0;
  188. width: 100%;
  189. height: 5px;
  190. cursor: ns-resize;
  191. z-index: 1001;
  192. touch-action: none;
  193. }
  194. #profiler-panel.position-top .panel-resizer {
  195. top: auto;
  196. bottom: -2px;
  197. }
  198. #profiler-panel.position-left .panel-resizer {
  199. top: 0;
  200. left: auto;
  201. right: -2px;
  202. width: 5px;
  203. height: 100%;
  204. cursor: ew-resize;
  205. }
  206. #profiler-panel.position-right .panel-resizer {
  207. top: 0;
  208. left: -2px;
  209. right: auto;
  210. width: 5px;
  211. height: 100%;
  212. cursor: ew-resize;
  213. }
  214. .profiler-header {
  215. display: flex;
  216. background-color: var(--profiler-header-bg);
  217. border-bottom: 1px solid var(--profiler-border);
  218. flex-shrink: 0;
  219. justify-content: space-between;
  220. align-items: stretch;
  221. overflow-x: auto;
  222. overflow-y: hidden;
  223. width: calc(100% - 134px);
  224. height: 38px;
  225. user-select: none;
  226. -webkit-user-select: none;
  227. }
  228. /* Adjust header width based on panel position */
  229. #profiler-panel.position-right .profiler-header,
  230. #profiler-panel.position-left .profiler-header {
  231. width: calc(100% - 134px);
  232. }
  233. #profiler-panel.position-bottom .profiler-header,
  234. #profiler-panel.position-top .profiler-header {
  235. width: calc(100% - 134px);
  236. }
  237. /* Adjust header width when position toggle button is hidden (mobile) */
  238. #profiler-panel.hide-position-toggle .profiler-header {
  239. width: calc(100% - 90px);
  240. }
  241. /* ===== RULES FOR WHEN THERE ARE NO TABS ===== */
  242. /* Horizontal mode (bottom/top) without tabs */
  243. #profiler-panel.position-bottom.no-tabs:not(.maximized),
  244. #profiler-panel.position-top.no-tabs:not(.maximized) {
  245. height: 38px !important;
  246. min-height: 38px !important;
  247. }
  248. #profiler-panel.position-bottom.no-tabs .profiler-header,
  249. #profiler-panel.position-top.no-tabs .profiler-header {
  250. width: 100%;
  251. height: 38px;
  252. border-bottom: none;
  253. }
  254. #profiler-panel.position-bottom.no-tabs .profiler-content-wrapper,
  255. #profiler-panel.position-top.no-tabs .profiler-content-wrapper {
  256. display: none;
  257. }
  258. #profiler-panel.position-bottom.no-tabs .panel-resizer,
  259. #profiler-panel.position-top.no-tabs .panel-resizer {
  260. display: none;
  261. }
  262. /* Vertical mode (right/left) without tabs */
  263. #profiler-panel.position-right.no-tabs:not(.maximized),
  264. #profiler-panel.position-left.no-tabs:not(.maximized) {
  265. width: 45px !important;
  266. min-width: 45px !important;
  267. }
  268. /* Vertical layout for header when no tabs */
  269. #profiler-panel.position-right.no-tabs .profiler-header,
  270. #profiler-panel.position-left.no-tabs .profiler-header {
  271. width: 100%;
  272. flex-direction: column;
  273. height: 100%;
  274. border-bottom: none;
  275. }
  276. /* Vertical layout for controls when no tabs */
  277. #profiler-panel.position-right.no-tabs .profiler-controls,
  278. #profiler-panel.position-left.no-tabs .profiler-controls {
  279. position: static;
  280. flex-direction: column-reverse;
  281. justify-content: flex-end;
  282. width: 100%;
  283. height: 100%;
  284. border-bottom: none;
  285. border-left: none;
  286. background: transparent;
  287. }
  288. #profiler-panel.position-right.no-tabs .profiler-controls button,
  289. #profiler-panel.position-left.no-tabs .profiler-controls button {
  290. width: 100%;
  291. height: 45px;
  292. border-left: none;
  293. border-top: none;
  294. border-bottom: 1px solid var(--profiler-border);
  295. }
  296. #profiler-panel.position-right.no-tabs .profiler-content-wrapper,
  297. #profiler-panel.position-left.no-tabs .profiler-content-wrapper {
  298. display: none;
  299. }
  300. #profiler-panel.position-right.no-tabs .profiler-tabs,
  301. #profiler-panel.position-left.no-tabs .profiler-tabs {
  302. display: none;
  303. }
  304. #profiler-panel.position-right.no-tabs .panel-resizer,
  305. #profiler-panel.position-left.no-tabs .panel-resizer {
  306. display: none;
  307. }
  308. /* Hide position toggle on mobile without tabs */
  309. #profiler-panel.hide-position-toggle.position-right.no-tabs:not(.maximized),
  310. #profiler-panel.hide-position-toggle.position-left.no-tabs:not(.maximized) {
  311. width: 45px !important;
  312. min-width: 45px !important;
  313. }
  314. /* Hide drag indicator on mobile devices */
  315. #profiler-panel.hide-position-toggle .tab-btn.active::before {
  316. display: none;
  317. }
  318. .profiler-header::-webkit-scrollbar {
  319. width: 8px;
  320. height: 8px;
  321. }
  322. .profiler-header::-webkit-scrollbar-track {
  323. background: transparent;
  324. }
  325. .profiler-header::-webkit-scrollbar-thumb {
  326. background-color: rgba(0, 0, 0, 0.25);
  327. border-radius: 10px;
  328. transition: background 0.3s ease;
  329. }
  330. .profiler-header::-webkit-scrollbar-thumb:hover {
  331. background-color: rgba(0, 0, 0, 0.4);
  332. }
  333. .profiler-header::-webkit-scrollbar-corner {
  334. background: transparent;
  335. }
  336. #profiler-panel.dragging .profiler-header {
  337. cursor: grabbing !important;
  338. }
  339. #profiler-panel.dragging {
  340. opacity: 0.8;
  341. }
  342. .profiler-tabs {
  343. display: flex;
  344. cursor: grab;
  345. position: relative;
  346. }
  347. .profiler-tabs:active {
  348. cursor: grabbing;
  349. }
  350. .profiler-tabs::-webkit-scrollbar {
  351. width: 8px;
  352. height: 8px;
  353. }
  354. .profiler-tabs::-webkit-scrollbar-track {
  355. background: transparent;
  356. }
  357. .profiler-tabs::-webkit-scrollbar-thumb {
  358. background-color: rgba(0, 0, 0, 0.25);
  359. border-radius: 10px;
  360. transition: background 0.3s ease;
  361. }
  362. .profiler-tabs::-webkit-scrollbar-thumb:hover {
  363. background-color: rgba(0, 0, 0, 0.4);
  364. }
  365. .profiler-tabs::-webkit-scrollbar-corner {
  366. background: transparent;
  367. }
  368. .profiler-controls {
  369. display: flex;
  370. position: absolute;
  371. right: 0;
  372. top: 0;
  373. height: 38px;
  374. background: var(--profiler-header-bg);
  375. border-bottom: 1px solid var(--profiler-border);
  376. }
  377. .tab-btn {
  378. position: relative;
  379. background: transparent;
  380. border: none;
  381. /*border-right: 1px solid var(--profiler-border);*/
  382. color: var(--text-secondary);
  383. padding: 8px 18px;
  384. cursor: default;
  385. display: flex;
  386. align-items: center;
  387. font-family: var(--font-family);
  388. font-weight: 600;
  389. font-size: 14px;
  390. user-select: none;
  391. transition: opacity 0.2s, transform 0.2s;
  392. touch-action: none;
  393. }
  394. .tab-btn.active {
  395. border-bottom: 2px solid var(--accent-color);
  396. color: white;
  397. }
  398. .tab-btn.active::before {
  399. content: '⋮⋮';
  400. position: absolute;
  401. left: 3px;
  402. top: calc(50% - 2px);
  403. transform: translateY(-50%);
  404. color: var(--profiler-border);
  405. font-size: 18px;
  406. letter-spacing: -2px;
  407. opacity: 0.6;
  408. }
  409. .tab-btn.no-detach.active::before {
  410. display: none;
  411. }
  412. #floating-btn,
  413. #maximize-btn,
  414. #hide-panel-btn {
  415. background: transparent;
  416. border: none;
  417. border-left: 1px solid var(--profiler-border);
  418. color: var(--text-secondary);
  419. width: 45px;
  420. height: 100%;
  421. cursor: pointer;
  422. transition: all 0.2s;
  423. display: flex;
  424. align-items: center;
  425. justify-content: center;
  426. flex-shrink: 0;
  427. }
  428. /* Disable transitions in vertical mode to avoid broken animations */
  429. #profiler-panel.position-right #floating-btn,
  430. #profiler-panel.position-right #maximize-btn,
  431. #profiler-panel.position-right #hide-panel-btn,
  432. #profiler-panel.position-left #floating-btn,
  433. #profiler-panel.position-left #maximize-btn,
  434. #profiler-panel.position-left #hide-panel-btn {
  435. transition: background-color 0.2s, color 0.2s;
  436. }
  437. #floating-btn:hover,
  438. #maximize-btn:hover,
  439. #hide-panel-btn:hover {
  440. background-color: rgba(255, 255, 255, 0.1);
  441. color: var(--text-primary);
  442. }
  443. /* Hide maximize button when there are no tabs */
  444. #profiler-panel.position-right.no-tabs #maximize-btn,
  445. #profiler-panel.position-left.no-tabs #maximize-btn,
  446. #profiler-panel.position-bottom.no-tabs #maximize-btn,
  447. #profiler-panel.position-top.no-tabs #maximize-btn {
  448. display: none !important;
  449. }
  450. .profiler-content-wrapper {
  451. flex-grow: 1;
  452. overflow: hidden;
  453. position: relative;
  454. }
  455. .profiler-content {
  456. position: absolute;
  457. top: 0;
  458. left: 0;
  459. width: 100%;
  460. height: 100%;
  461. overflow-y: auto;
  462. font-size: 13px;
  463. visibility: hidden;
  464. opacity: 0;
  465. transition: opacity 0.2s, visibility 0.2s;
  466. box-sizing: border-box;
  467. display: flex;
  468. flex-direction: column;
  469. }
  470. .profiler-content.active {
  471. visibility: visible;
  472. opacity: 1;
  473. }
  474. .profiler-content {
  475. overflow: auto; /* make sure scrollbars can appear */
  476. }
  477. .profiler-content::-webkit-scrollbar {
  478. width: 8px;
  479. height: 8px;
  480. }
  481. .profiler-content::-webkit-scrollbar-track {
  482. background: transparent;
  483. }
  484. .profiler-content::-webkit-scrollbar-thumb {
  485. background-color: rgba(0, 0, 0, 0.25);
  486. border-radius: 10px;
  487. transition: background 0.3s ease;
  488. }
  489. .profiler-content::-webkit-scrollbar-thumb:hover {
  490. background-color: rgba(0, 0, 0, 0.4);
  491. }
  492. .profiler-content::-webkit-scrollbar-corner {
  493. background: transparent;
  494. }
  495. .profiler-content {
  496. scrollbar-width: thin; /* "auto" | "thin" */
  497. scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
  498. }
  499. .list-item-row {
  500. display: grid;
  501. align-items: center;
  502. padding: 4px 8px;
  503. border-radius: 3px;
  504. transition: background-color 0.2s;
  505. gap: 10px;
  506. border-bottom: none;
  507. }
  508. .list-item-wrapper {
  509. margin-top: 2px;
  510. margin-bottom: 2px;
  511. }
  512. .list-item-wrapper:first-child {
  513. /*margin-top: 0;*/
  514. }
  515. .list-item-wrapper:not(.header-wrapper):nth-child(odd) > .list-item-row {
  516. background-color: rgba(0,0,0,0.1);
  517. }
  518. .list-item-wrapper.header-wrapper>.list-item-row {
  519. color: var(--accent-color);
  520. background-color: rgba(0, 170, 255, 0.1);
  521. }
  522. .list-item-wrapper.header-wrapper>.list-item-row>.list-item-cell:first-child {
  523. font-weight: 600;
  524. }
  525. .list-item-row.collapsible,
  526. .list-item-row.actionable {
  527. cursor: pointer;
  528. }
  529. .list-item-row.collapsible {
  530. background-color: rgba(0, 170, 255, 0.15) !important;
  531. }
  532. .list-item-row.collapsible.alert,
  533. .list-item-row.alert {
  534. background-color: rgba(244, 67, 54, 0.1) !important;
  535. }
  536. @media (hover: hover) {
  537. .list-item-row:hover:not(.collapsible):not(.no-hover),
  538. .list-item-row:hover:not(.no-hover),
  539. .list-item-row.actionable:hover,
  540. .list-item-row.collapsible.actionable:hover {
  541. background-color: rgba(255, 255, 255, 0.05) !important;
  542. }
  543. .list-item-row.collapsible:hover {
  544. background-color: rgba(0, 170, 255, 0.25) !important;
  545. }
  546. }
  547. .list-item-cell {
  548. white-space: pre;
  549. display: flex;
  550. align-items: center;
  551. }
  552. .list-item-cell:not(:first-child) {
  553. justify-content: flex-end;
  554. font-weight: 600;
  555. }
  556. .list-header {
  557. display: grid;
  558. align-items: center;
  559. padding: 4px 8px;
  560. font-weight: 600;
  561. color: var(--text-secondary);
  562. padding-bottom: 6px;
  563. border-bottom: 1px solid var(--profiler-border);
  564. margin-bottom: 5px;
  565. gap: 10px;
  566. }
  567. .list-item-wrapper.section-start {
  568. margin-top: 5px;
  569. margin-bottom: 5px;
  570. }
  571. .list-header .list-header-cell:not(:first-child) {
  572. text-align: right;
  573. }
  574. .list-children-container {
  575. padding-left: 1.5em;
  576. overflow: hidden;
  577. transition: max-height 0.1s ease-out;
  578. margin-top: 2px;
  579. }
  580. .list-children-container.closed {
  581. max-height: 0;
  582. }
  583. .item-toggler {
  584. display: inline-block;
  585. margin-right: 0.8em;
  586. text-align: left;
  587. }
  588. .list-item-row.open .item-toggler::before {
  589. content: '-';
  590. }
  591. .list-item-row:not(.open) .item-toggler::before {
  592. content: '+';
  593. }
  594. .list-item-cell .value.good {
  595. color: var(--color-green);
  596. }
  597. .list-item-cell .value.warn {
  598. color: var(--color-yellow);
  599. }
  600. .list-item-cell .value.bad {
  601. color: var(--color-red);
  602. }
  603. .list-scroll-wrapper {
  604. overflow-x: auto;
  605. width: 100%;
  606. }
  607. .list-container.parameters .list-item-row:not(.collapsible) {
  608. height: 31px;
  609. }
  610. .graph-container {
  611. width: 100%;
  612. box-sizing: border-box;
  613. padding: 8px 0;
  614. position: relative;
  615. }
  616. .graph-svg {
  617. width: 100%;
  618. height: 80px;
  619. background-color: var(--profiler-header);
  620. border: 1px solid var(--profiler-border);
  621. border-radius: 4px;
  622. }
  623. .graph-path {
  624. stroke-width: 2;
  625. fill-opacity: 0.4;
  626. }
  627. .console-header {
  628. padding: 10px;
  629. border-bottom: 1px solid var(--profiler-border);
  630. display: flex;
  631. gap: 20px;
  632. flex-shrink: 0;
  633. align-items: center;
  634. justify-content: space-between;
  635. }
  636. .console-filters-group {
  637. display: flex;
  638. gap: 20px;
  639. }
  640. .console-filter-input {
  641. background-color: var(--profiler-bg);
  642. border: 1px solid var(--profiler-border);
  643. color: var(--text-primary);
  644. border-radius: 4px;
  645. padding: 4px 8px;
  646. font-family: var(--font-mono);
  647. flex-grow: 1;
  648. max-width: 300px;
  649. border-radius: 15px;
  650. }
  651. #console-log {
  652. display: flex;
  653. flex-direction: column;
  654. gap: 4px;
  655. padding: 10px;
  656. overflow-y: auto;
  657. flex-grow: 1;
  658. }
  659. .log-message {
  660. padding: 2px 5px;
  661. white-space: pre-wrap;
  662. word-break: break-all;
  663. border-radius: 3px;
  664. line-height: 1.5 !important;
  665. }
  666. .log-message.hidden {
  667. display: none;
  668. }
  669. .log-message.info {
  670. color: var(--text-primary);
  671. }
  672. .log-message.warn {
  673. color: var(--color-yellow);
  674. }
  675. .log-message.error {
  676. color: #f9dedc;
  677. background-color: rgba(244, 67, 54, 0.1);
  678. }
  679. .log-prefix {
  680. color: var(--text-secondary);
  681. margin-right: 8px;
  682. }
  683. .log-code {
  684. background-color: rgba(255, 255, 255, 0.1);
  685. border-radius: 3px;
  686. padding: 1px 4px;
  687. }
  688. .thumbnail-container {
  689. display: flex;
  690. align-items: center;
  691. }
  692. .thumbnail-svg {
  693. width: 40px;
  694. height: 22.5px;
  695. flex-shrink: 0;
  696. margin-right: 8px;
  697. }
  698. .param-control {
  699. display: flex;
  700. align-items: center;
  701. justify-content: flex-end;
  702. gap: 10px;
  703. width: 100%;
  704. }
  705. .param-control input,
  706. .param-control select,
  707. .param-control button {
  708. background-color: var(--profiler-bg);
  709. border: 1px solid var(--profiler-border);
  710. color: var(--text-primary);
  711. border-radius: 4px;
  712. padding: 4px 6px;
  713. padding-bottom: 2px;
  714. font-family: var(--font-mono);
  715. width: 100%;
  716. box-sizing: border-box;
  717. }
  718. .param-control select {
  719. padding-top: 3px;
  720. padding-bottom: 1px;
  721. }
  722. .param-control input[type="number"] {
  723. cursor: ns-resize;
  724. }
  725. .param-control input[type="color"] {
  726. padding: 2px;
  727. }
  728. .param-control button {
  729. cursor: pointer;
  730. transition: background-color 0.2s;
  731. }
  732. .param-control button:hover {
  733. background-color: var(--profiler-header);
  734. }
  735. .param-control-vector {
  736. display: flex;
  737. gap: 5px;
  738. }
  739. .custom-checkbox {
  740. display: inline-flex;
  741. align-items: center;
  742. cursor: pointer;
  743. gap: 8px;
  744. }
  745. .custom-checkbox input {
  746. display: none;
  747. }
  748. .custom-checkbox .checkmark {
  749. width: 14px;
  750. height: 14px;
  751. border: 1px solid var(--profiler-border);
  752. border-radius: 3px;
  753. display: inline-flex;
  754. justify-content: center;
  755. align-items: center;
  756. transition: background-color 0.2s, border-color 0.2s;
  757. }
  758. .custom-checkbox .checkmark::after {
  759. content: '';
  760. width: 8px;
  761. height: 8px;
  762. background-color: var(--accent-color);
  763. border-radius: 1px;
  764. display: block;
  765. transform: scale(0);
  766. transition: transform 0.2s;
  767. }
  768. .custom-checkbox input:checked+.checkmark {
  769. border-color: var(--accent-color);
  770. }
  771. .custom-checkbox input:checked+.checkmark::after {
  772. transform: scale(1);
  773. }
  774. .param-control input[type="range"] {
  775. -webkit-appearance: none;
  776. appearance: none;
  777. width: 100%;
  778. height: 16px;
  779. background: var(--profiler-header);
  780. border-radius: 5px;
  781. border: 1px solid var(--profiler-border);
  782. outline: none;
  783. padding: 0px;
  784. padding-top: 8px;
  785. }
  786. .param-control input[type="range"]::-webkit-slider-thumb {
  787. -webkit-appearance: none;
  788. appearance: none;
  789. width: 18px;
  790. height: 18px;
  791. background: var(--profiler-bg);
  792. border: 1px solid var(--accent-color);
  793. border-radius: 3px;
  794. cursor: pointer;
  795. margin-top: -8px;
  796. }
  797. .param-control input[type="range"]::-moz-range-thumb {
  798. width: 18px;
  799. height: 18px;
  800. background: var(--profiler-bg);
  801. border: 2px solid var(--accent-color);
  802. border-radius: 3px;
  803. cursor: pointer;
  804. }
  805. .param-control input[type="range"]::-moz-range-track {
  806. width: 100%;
  807. height: 16px;
  808. background: var(--profiler-header);
  809. border-radius: 5px;
  810. border: 1px solid var(--profiler-border);
  811. }
  812. @media screen and (max-width: 450px) and (orientation: portrait) {
  813. .console-filter-input {
  814. max-width: 100px;
  815. }
  816. }
  817. /* Touch device optimizations */
  818. @media (hover: none) and (pointer: coarse) {
  819. .panel-resizer {
  820. top: -10px !important;
  821. height: 20px !important;
  822. }
  823. #profiler-panel.position-top .panel-resizer {
  824. top: auto !important;
  825. bottom: -10px !important;
  826. height: 20px !important;
  827. }
  828. #profiler-panel.position-left .panel-resizer {
  829. right: -10px !important;
  830. width: 20px !important;
  831. height: 100% !important;
  832. }
  833. #profiler-panel.position-right .panel-resizer {
  834. left: -10px !important;
  835. width: 20px !important;
  836. height: 100% !important;
  837. }
  838. .detached-tab-resizer-top,
  839. .detached-tab-resizer-bottom {
  840. height: 10px !important;
  841. }
  842. .detached-tab-resizer-left,
  843. .detached-tab-resizer-right {
  844. width: 10px !important;
  845. }
  846. }
  847. .drag-preview-indicator {
  848. position: fixed;
  849. background-color: rgba(0, 170, 255, 0.2);
  850. border: 2px dashed var(--accent-color);
  851. z-index: 999;
  852. pointer-events: none;
  853. transition: all 0.2s ease-out;
  854. }
  855. /* Detached Tab Windows */
  856. .detached-tab-panel {
  857. position: fixed;
  858. width: 500px;
  859. height: 400px;
  860. background: var(--profiler-bg);
  861. border: 1px solid var(--profiler-border);
  862. border-radius: 8px;
  863. box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  864. z-index: 1002;
  865. display: flex;
  866. flex-direction: column;
  867. backdrop-filter: blur(10px);
  868. overflow: hidden;
  869. opacity: 1;
  870. visibility: visible;
  871. transition: opacity 0.2s, visibility 0.2s;
  872. }
  873. #profiler-panel:not(.visible) ~ * .detached-tab-panel,
  874. body:has(#profiler-panel:not(.visible)) .detached-tab-panel {
  875. opacity: 0;
  876. visibility: hidden;
  877. pointer-events: none;
  878. }
  879. .detached-tab-header {
  880. background: var(--profiler-header-bg);
  881. padding: 0 7px 0 15px;
  882. font-family: var(--font-family);
  883. font-size: 14px;
  884. color: var(--text-primary);
  885. font-weight: 600;
  886. display: flex;
  887. justify-content: space-between;
  888. align-items: center;
  889. border-bottom: 1px solid var(--profiler-border);
  890. cursor: grab;
  891. user-select: none;
  892. height: 38px;
  893. flex-shrink: 0;
  894. -webkit-font-smoothing: antialiased;
  895. -moz-osx-font-smoothing: grayscale;
  896. touch-action: none;
  897. }
  898. .detached-tab-header:active {
  899. cursor: grabbing;
  900. }
  901. .detached-header-controls {
  902. display: flex;
  903. gap: 5px;
  904. }
  905. .detached-reattach-btn {
  906. background: transparent;
  907. border: none;
  908. color: var(--text-secondary);
  909. font-family: var(--font-family);
  910. font-size: 18px;
  911. line-height: 1;
  912. cursor: pointer;
  913. padding: 4px 8px;
  914. border-radius: 4px;
  915. transition: all 0.2s;
  916. display: flex;
  917. align-items: center;
  918. justify-content: center;
  919. -webkit-font-smoothing: antialiased;
  920. -moz-osx-font-smoothing: grayscale;
  921. }
  922. .detached-reattach-btn:hover {
  923. background: rgba(0, 170, 255, 0.2);
  924. color: var(--accent-color);
  925. }
  926. .detached-tab-content {
  927. flex: 1;
  928. overflow: auto;
  929. position: relative;
  930. background: var(--profiler-bg);
  931. }
  932. .detached-tab-content::-webkit-scrollbar {
  933. width: 8px;
  934. height: 8px;
  935. }
  936. .detached-tab-content::-webkit-scrollbar-track {
  937. background: transparent;
  938. }
  939. .detached-tab-content::-webkit-scrollbar-thumb {
  940. background-color: rgba(0, 0, 0, 0.25);
  941. border-radius: 10px;
  942. transition: background 0.3s ease;
  943. }
  944. .detached-tab-content::-webkit-scrollbar-thumb:hover {
  945. background-color: rgba(0, 0, 0, 0.4);
  946. }
  947. .detached-tab-content::-webkit-scrollbar-corner {
  948. background: transparent;
  949. }
  950. .detached-tab-content .profiler-content {
  951. display: block !important;
  952. height: 100%;
  953. visibility: visible !important;
  954. opacity: 1 !important;
  955. position: relative !important;
  956. }
  957. .detached-tab-content .profiler-content > * {
  958. font-family: var(--font-mono);
  959. color: var(--text-primary);
  960. }
  961. .detached-tab-resizer {
  962. position: absolute;
  963. bottom: 0;
  964. right: 0;
  965. width: 20px;
  966. height: 20px;
  967. cursor: nwse-resize;
  968. z-index: 10;
  969. touch-action: none;
  970. }
  971. .detached-tab-resizer::after {
  972. content: '';
  973. position: absolute;
  974. bottom: 2px;
  975. right: 2px;
  976. width: 12px;
  977. height: 12px;
  978. border-right: 2px solid var(--profiler-border);
  979. border-bottom: 2px solid var(--profiler-border);
  980. border-bottom-right-radius: 6px;
  981. opacity: 0.5;
  982. }
  983. .detached-tab-resizer:hover::after {
  984. opacity: 1;
  985. border-color: var(--accent-color);
  986. }
  987. /* Edge resizers */
  988. .detached-tab-resizer-top {
  989. position: absolute;
  990. top: 0;
  991. left: 0;
  992. right: 0;
  993. height: 5px;
  994. cursor: ns-resize;
  995. z-index: 10;
  996. touch-action: none;
  997. }
  998. .detached-tab-resizer-right {
  999. position: absolute;
  1000. top: 0;
  1001. right: 0;
  1002. bottom: 0;
  1003. width: 5px;
  1004. cursor: ew-resize;
  1005. z-index: 10;
  1006. touch-action: none;
  1007. }
  1008. .detached-tab-resizer-bottom {
  1009. position: absolute;
  1010. bottom: 0;
  1011. left: 0;
  1012. right: 0;
  1013. height: 5px;
  1014. cursor: ns-resize;
  1015. z-index: 10;
  1016. touch-action: none;
  1017. }
  1018. .detached-tab-resizer-left {
  1019. position: absolute;
  1020. top: 0;
  1021. left: 0;
  1022. bottom: 0;
  1023. width: 5px;
  1024. cursor: ew-resize;
  1025. z-index: 10;
  1026. touch-action: none;
  1027. }
  1028. /* Input number spin buttons - hide arrows */
  1029. /* Chrome, Safari, Edge, Opera */
  1030. #profiler-panel input[type="number"]::-webkit-outer-spin-button,
  1031. #profiler-panel input[type="number"]::-webkit-inner-spin-button,
  1032. .detached-tab-content input[type="number"]::-webkit-outer-spin-button,
  1033. .detached-tab-content input[type="number"]::-webkit-inner-spin-button {
  1034. -webkit-appearance: none;
  1035. margin: 0;
  1036. }
  1037. /* Firefox */
  1038. #profiler-panel input[type="number"],
  1039. .detached-tab-content input[type="number"] {
  1040. -moz-appearance: textfield;
  1041. }
  1042. `;
  1043. const styleElement = document.createElement( 'style' );
  1044. styleElement.id = 'profiler-styles';
  1045. styleElement.textContent = css;
  1046. document.head.appendChild( styleElement );
  1047. }
  1048. }
粤ICP备19079148号