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.

144 lines
26 KiB

2 years ago
2 years ago
2 years ago
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-wrap: wrap;
  75. flex-direction: row;
  76. justify-content: flex-start;
  77. align-items: center;
  78. }
  79. .struct-info-bytegroup {
  80. margin: 2em 0;
  81. display: flex;
  82. flex-wrap: wrap;
  83. flex-direction: row;
  84. justify-content: flex-start;
  85. align-items: center;
  86. }
  87. .struct-info-bytegroup:hover {
  88. background-color: orange;
  89. .struct-info-declaration {
  90. font-weight: bold;
  91. color: orange;
  92. }
  93. }
  94. .struct-info-header {
  95. font-weight: bold;
  96. font-family: monospace;
  97. }
  98. .struct-info-byte {
  99. position: relative;
  100. display: flex;
  101. justify-content: center;
  102. align-items: center;
  103. border: 1px solid black;
  104. width: 30px;
  105. height: 45px;
  106. }
  107. .struct-info-byte-first {
  108. border-left-width: 3px;
  109. }
  110. .struct-info-byte-unknown {
  111. border-left-width: 3px;
  112. background-color: maroon;
  113. font-weight: bold;
  114. color: white;
  115. }
  116. .struct-info-byte-counted-ellipsis {
  117. background-color: #808000;
  118. font-weight: bold;
  119. }
  120. .struct-info-byte-ellipsis {
  121. background-color: #400000;
  122. font-weight: bold;
  123. color: white;
  124. }
  125. </style>
  126. <script>
  127. </script>
  128. <body>
  129. <!-- c code will terminate the body and html tags -->
  130. <div class='struct-info'><label class='struct-info-header'>struct Declaration - alias: </label><div class='struct-info-byte-row'><div class='struct-info-bytegroup'><div class='struct-info-byte struct-info-byte-first'><div class='struct-info-declaration struct-info-declaration-top'>char <span class='struct-info-declaration-name'>type[64]</span></div></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div></div><div class='struct-info-bytegroup'><div class='struct-info-byte struct-info-byte-first'><div class='struct-info-declaration struct-info-declaration-bottom'>char <span class='struct-info-declaration-name'>name[64]</span></div></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div class='struct-info-byte'></div><div clas