visualize the data structures in a C program
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
2.8 KiB

2 years ago
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>Struct Visualization</title>
  6. <base href="/">
  7. <meta name="viewport" content="width=device-width, initial-scale=1">
  8. <link rel="icon" type="image/x-icon" href="favicon.ico">
  9. </head>
  10. <style>
  11. :root {
  12. --r1: pink;
  13. --r2: blue;
  14. --r3: magenta;
  15. --r4: yellow;
  16. --r5: cyan;
  17. --r6: orange;
  18. --r7: lime;
  19. --r8: olive;
  20. }
  21. *::before,
  22. *::after,
  23. * {
  24. margin: 0;
  25. padding: 0;
  26. box-sizing: border-box;
  27. }
  28. html, body {
  29. min-height: 100vh;
  30. height: 100vh;
  31. overscroll-behavior: none;
  32. background: #F0EAD6;
  33. direction: ltr;
  34. font: 16px HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;
  35. }
  36. .struct-info {
  37. padding: 0 20px 20px 20px;
  38. border-bottom: 1px solid silver;
  39. margin-bottom: 20px;
  40. }
  41. .struct-info-declaration {
  42. position: absolute;
  43. font-family: monospace;
  44. min-width: min-content;
  45. max-width: 20em;
  46. text-overflow: ellipsis;
  47. white-space: nowrap;
  48. font-size: 0.9em;
  49. transform: translateX(calc(50% - 10px));
  50. color: black;
  51. font-weight: normal;
  52. }
  53. .struct-info-declaration-name {
  54. font: 16px HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;
  55. }
  56. .struct-info-declaration-top {
  57. top: -30px;
  58. }
  59. .struct-info-declaration-bottom {
  60. bottom: -30px;
  61. }
  62. .struct-info-byte-row-ellipsis {
  63. position: absolute;
  64. right: 1em;
  65. }
  66. .struct-info-byte-rows {
  67. display: flex;
  68. flex-direction: column;
  69. justify-content: flex-start;
  70. align-items: flex-start;
  71. }
  72. .struct-info-byte-row {
  73. display: flex;
  74. flex-direction: row;
  75. justify-content: flex-start;
  76. align-items: center;
  77. }
  78. .struct-info-bytegroup {
  79. margin: 2em 0;
  80. display: flex;
  81. flex-wrap: wrap;
  82. flex-direction: row;
  83. justify-content: flex-start;
  84. align-items: center;
  85. }
  86. .struct-info-bytegroup:hover {
  87. background-color: orange;
  88. .struct-info-declaration {
  89. font-weight: bold;
  90. color: orange;
  91. }
  92. }
  93. .struct-info-header {
  94. font-weight: bold;
  95. font-family: monospace;
  96. }
  97. .struct-info-byte {
  98. position: relative;
  99. display: flex;
  100. justify-content: center;
  101. align-items: center;
  102. border: 1px solid black;
  103. width: 30px;
  104. height: 45px;
  105. }
  106. .struct-info-byte-first {
  107. border-left-width: 3px;
  108. }
  109. .struct-info-byte-unknown {
  110. border-left-width: 3px;
  111. background-color: maroon;
  112. font-weight: bold;
  113. color: white;
  114. }
  115. .struct-info-byte-counted-ellipsis {
  116. background-color: #808000;
  117. font-weight: bold;
  118. }
  119. .struct-info-byte-ellipsis {
  120. background-color: #400000;
  121. font-weight: bold;
  122. color: white;
  123. }
  124. </style>
  125. <script>
  126. </script>
  127. <body>
  128. <!-- c code will terminate the body and html tags -->