electron.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
  6. <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';">
  7. <title>Netron</title>
  8. <link rel="stylesheet" type="text/css" href="view-grapher.css">
  9. <link rel="stylesheet" type="text/css" href="view-sidebar.css">
  10. <style>
  11. html { -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-text-rendering: optimizeLegibility; -moz-text-rendering: optimizeLegibility; -ms-text-rendering: optimizeLegibility; -o-text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-font-smoothing: antialiased; -ms-font-smoothing: antialiased; -o-font-smoothing: antialiased; }
  12. body { margin: 0; width: 100vw; height: 100vh; font-family: -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif, "PingFang SC"; font-size: 12px; text-rendering: geometricPrecision; }
  13. .center { position: absolute; margin: auto; top: 0; right: 0; bottom: 0; left: 0; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
  14. .select { user-select: text; -webkit-user-select: text; -moz-user-select: text; }
  15. .open-file-dialog { display: none; }
  16. .graph { overflow: auto; width: 100%; height: 100%; }
  17. .canvas { display: block; position: absolute; text-rendering: geometricPrecision; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
  18. .toolbar { position: absolute; top: 10px; left: 10px; padding: 0; margin: 0; user-select: none; -webkit-user-select: none; -moz-user-select: none; }
  19. .toolbar-button { background: None; border-radius: 6px; border: 0; margin: 0; padding: 0; fill: None; stroke: #777; cursor: hand; width: 24px; height: 24px; }
  20. .toolbar button:focus { outline: 0; }
  21. .icon .border { stroke: #fff; }
  22. .icon .stroke { stroke: #808080; }
  23. .icon:hover .stroke { stroke: #000000; }
  24. .dropdown { display: none; position: absolute; min-width: 225px; z-index: 1; border-radius: 4px; background-color: #f6f6f6; border: 1px solid rgba(0,0,0,.15); padding-top: 2px; padding-bottom: 2px; margin-left: 2px; overflow: hidden; }
  25. .dropdown button { display: block; border: none; border-radius: 0; background-color: transparent; color: black; width: 100%; text-align: left; padding: 4px 12px 5px 12px; white-space: no-wrap; font-size: 12px; }
  26. .dropdown button:hover { color: #ffffff; background-color: #2e6bd2; }
  27. .dropdown .separator { margin-top: 2px; margin-bottom: 2px; border-top: 1px; border-bottom: 0; border-style: solid; border-color: #e5e5e5; }
  28. .welcome { background-color: #ececec; color: #242424; }
  29. .welcome .logo { width: 582px; height: 128px; }
  30. .welcome .logo-text { top: -57px; width: 582px; transition: 0.1s; }
  31. .welcome .logo-icon { left: 0; top: 0; width: 128px; height: 128px; transition: 0.1s; }
  32. .welcome .logo-spinner { left: 0; top: 0; width: 128px; height: 128px; display: none; }
  33. .welcome .logo-stroke { stroke: #999999; }
  34. .welcome .logo-fill { fill: #999999; }
  35. .welcome .logo-border { stroke: #888888; }
  36. .welcome .logo-glyph { fill: #999999; }
  37. .welcome .logo-message { display: none; }
  38. .welcome .logo-github { display: none; }
  39. .welcome .logo button { font-size: 12px; font-weight: bold; line-height: 1.25; text-align: center; vertical-align: middle; min-width: 60px; height: 32px; border-radius: 16px; transition: 0.1s; user-select: none; -webkit-user-select: none; -moz-user-select: none; color: #888888; background-color: #ececec; border: 1px solid #aaaaaa; }
  40. .welcome .logo button:hover { color: #ececec; background-color: #aaa; cursor: hand; transition: 0.2s; }
  41. .welcome .logo button:focus { outline: 0; }
  42. .welcome .logo .open-file-button { top: 200px; width: 125px; opacity: 1; display: block; }
  43. .welcome .logo .consent-accept-button { top: 280px; left: 0px; width: 125px; display: none; opacity: 0; }
  44. .welcome .logo .consent-message { top: 160px; left: 0px; font-size: 13px; text-align: center; line-height: 20px; color: #888; display: none; opacity: 0; }
  45. .welcome .graph { display: none; opacity: 0; }
  46. .welcome.spinner .logo-spinner { display: block; -webkit-animation: orbit 0.5s infinite linear; animation: orbit 0.5s infinite linear; cursor: wait; }
  47. .welcome.spinner .logo-spinner-stroke { stroke: #ececec; }
  48. .welcome.spinner .open-file-button { opacity: 0; display: none; }
  49. .welcome.consent .open-file-button { opacity: 0; display: none; }
  50. .welcome.consent .download-button { opacity: 0; display: none; }
  51. .welcome.consent .consent-accept-button { opacity: 1; display: block; }
  52. .welcome.consent .consent-message { opacity: 1; display: block; }
  53. .welcome.spinner .graph { display: block; opacity: 0; }
  54. .welcome .toolbar { display: none; }
  55. @-webkit-keyframes orbit { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
  56. @keyframes orbit { 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } }
  57. .default { background-color: #ffffff; }
  58. .default .logo { display: none; }
  59. .default .graph { display: block; opacity: 1; }
  60. .default .toolbar { display: block; }
  61. @media (prefers-color-scheme: dark) {
  62. .default { background-color: #404040; }
  63. .graph { background-color: #404040; }
  64. .welcome { background-color: #1e1e1e; color: #666666; }
  65. .welcome .logo-stroke { stroke: #666666; }
  66. .welcome .logo-fill { fill: #666666; }
  67. .welcome .logo-border { stroke: #000000; }
  68. .welcome .logo-glyph { fill: #555555; }
  69. .welcome .logo-spinner-stroke { stroke: #aaaaaa; }
  70. .welcome .logo button { color: #666666; background-color: #1e1e1e; border-color: #666666; }
  71. .welcome .logo button:hover { color: #1e1e1e; background-color: #666666; }
  72. .icon .border { stroke: #1d1d1d; }
  73. .icon .stroke { stroke: #aaaaaa; }
  74. .icon:hover .stroke { stroke: #dfdfdf; }
  75. .dropdown { background-color: #373737; border-color: #000000; }
  76. .dropdown button { color: #ffffff; }
  77. .dropdown button:hover { color: #ffffff; background-color: #1d59d1; }
  78. .dropdown .separator { border-color: #5a5a5a; }
  79. }
  80. </style>
  81. </head>
  82. <body class="welcome spinner">
  83. <div class="center logo">
  84. <svg class="center logo-icon" viewbox="0 0 1024 1024">
  85. <circle class="logo-stroke" cx="512" cy="512" r="431" fill="none" stroke-width="32"></circle>
  86. <circle class="logo-border" cx="512" cy="512" r="450" fill="none" stroke-width="6"></circle>
  87. <circle class="logo-border" cx="512" cy="512" r="412" fill="none" stroke-width="6"></circle>
  88. <line class="logo-stroke" x1="296" y1="392" x2="540" y2="280" stroke-width="12"></line>
  89. <line class="logo-stroke" x1="296" y1="632" x2="540" y2="280" stroke-width="12"></line>
  90. <line class="logo-stroke" x1="296" y1="392" x2="540" y2="435" stroke-width="12"></line>
  91. <line class="logo-stroke" x1="296" y1="632" x2="540" y2="435" stroke-width="12"></line>
  92. <line class="logo-stroke" x1="296" y1="392" x2="540" y2="590" stroke-width="12"></line>
  93. <line class="logo-stroke" x1="296" y1="632" x2="540" y2="590" stroke-width="12"></line>
  94. <line class="logo-stroke" x1="296" y1="392" x2="540" y2="744" stroke-width="12"></line>
  95. <line class="logo-stroke" x1="296" y1="632" x2="540" y2="744" stroke-width="12"></line>
  96. <line class="logo-stroke" x1="540" y1="280" x2="785" y2="512" stroke-width="12"></line>
  97. <line class="logo-stroke" x1="540" y1="590" x2="785" y2="512" stroke-width="12"></line>
  98. <line class="logo-stroke" x1="540" y1="435" x2="785" y2="512" stroke-width="12"></line>
  99. <line class="logo-stroke" x1="540" y1="744" x2="785" y2="512" stroke-width="12"></line>
  100. <g transform="translate(296, 392)">
  101. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  102. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  103. </g>
  104. <g transform="translate(296, 632)">
  105. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  106. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  107. </g>
  108. <g transform="translate(540, 280)">
  109. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  110. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  111. </g>
  112. <g transform="translate(540, 435)">
  113. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  114. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  115. </g>
  116. <g transform="translate(540, 590)">
  117. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  118. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  119. </g>
  120. <g transform="translate(540, 744)">
  121. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  122. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  123. </g>
  124. <g transform="translate(785, 512)">
  125. <circle class="logo-fill" cx="0" cy="0" r="51"></circle>
  126. <circle class="logo-border" cx="0" cy="0" r="51" fill="none" stroke-width="6"></circle>
  127. </g>
  128. </svg>
  129. <svg id="logo-spinner" class="center logo-spinner" viewbox="0 0 1024 1024">
  130. <g transform="translate(512, 512)" style="opacity: 1">
  131. <path class="logo-spinner-stroke" d="M-431,0 A-431,-431 0 0,1 0,-431" stroke-width="24" fill="None"></path>
  132. </g>
  133. </svg>
  134. <span class="center consent-message">This app uses cookies to report errors and anonymous usage information.</span>
  135. <button id="consent-accept-button" class="center consent-accept-button">Accept</button>
  136. <button id="open-file-button" class="center open-file-button">Open Model&hellip;</button>
  137. <!-- Preload fonts to workaround Chrome SVG layout issue -->
  138. <div style="font-weight: normal; color: rgba(0, 0, 0, 0.01); user-select: none;">.</div>
  139. <div style="font-weight: bold; color: rgba(0, 0, 0, 0.01); user-select: none;">.</div>
  140. <div style="font-weight: bold; color: rgba(0, 0, 0, 0.01); user-select: none;">.</div>
  141. </div>
  142. <div id="graph" class="graph">
  143. <svg id="canvas" class="canvas" preserveaspectratio="xMidYMid meet" width="100%" height="100%"></svg>
  144. </div>
  145. <div id="toolbar" class="toolbar">
  146. <button id="menu-button" class="toolbar-button" title="Model Properties">
  147. <svg class="icon" viewbox="0 0 100 100">
  148. <rect class="border" x="12" y="12" width="76" height="76" rx="16" ry="16" stroke-width="8"></rect>
  149. <line class="border" x1="30" y1="37" x2="70" y2="37" stroke-width="8" stroke-linecap="round" stroke="#fff"></line>
  150. <line class="border" x1="30" y1="50" x2="70" y2="50" stroke-width="8" stroke-linecap="round" stroke="#fff"></line>
  151. <line class="border" x1="30" y1="63" x2="70" y2="63" stroke-width="8" stroke-linecap="round" stroke="#fff"></line>
  152. <rect class="stroke" x="12" y="12" width="76" height="76" rx="16" ry="16" stroke-width="4"></rect>
  153. <line class="stroke" x1="30" y1="37" x2="70" y2="37" stroke-width="4" stroke-linecap="round"></line>
  154. <line class="stroke" x1="30" y1="50" x2="70" y2="50" stroke-width="4" stroke-linecap="round"></line>
  155. <line class="stroke" x1="30" y1="63" x2="70" y2="63" stroke-width="4" stroke-linecap="round"></line>
  156. </svg>
  157. </button>
  158. <button id="zoom-in-button" class="toolbar-button" title="Zoom In">
  159. <svg class="icon" viewbox="0 0 100 100">
  160. <circle class="border" cx="50" cy="50" r="35" stroke-width="8" stroke="#fff"></circle>
  161. <line class="border" x1="50" y1="38" x2="50" y2="62" stroke-width="8" stroke-linecap="round" stroke="#fff"></line>
  162. <line class="border" x1="38" y1="50" x2="62" y2="50" stroke-width="8" stroke-linecap="round" stroke="#fff"></line>
  163. <line class="border" x1="78" y1="78" x2="82" y2="82" stroke-width="12" stroke-linecap="square" stroke="#fff"></line>
  164. <circle class="stroke" cx="50" cy="50" r="35" stroke-width="4"></circle>
  165. <line class="stroke" x1="50" y1="38" x2="50" y2="62" stroke-width="4" stroke-linecap="round"></line>
  166. <line class="stroke" x1="38" y1="50" x2="62" y2="50" stroke-width="4" stroke-linecap="round"></line>
  167. <line class="stroke" x1="78" y1="78" x2="82" y2="82" stroke-width="8" stroke-linecap="square"></line>
  168. </svg>
  169. </button>
  170. <button id="zoom-out-button" class="toolbar-button" title="Zoom Out">
  171. <svg class="icon" viewbox="0 0 100 100">
  172. <circle class="border" cx="50" cy="50" r="35" stroke-width="8" stroke="#fff"></circle>
  173. <line class="border" x1="38" y1="50" x2="62" y2="50" stroke-width="8" stroke-linecap="round" stroke="#fff"></line>
  174. <line class="border" x1="78" y1="78" x2="82" y2="82" stroke-width="12" stroke-linecap="square" stroke="#fff"></line>
  175. <circle class="stroke" cx="50" cy="50" r="35" stroke-width="4"></circle>
  176. <line class="stroke" x1="38" y1="50" x2="62" y2="50" stroke-width="4" stroke-linecap="round"></line>
  177. <line class="stroke" x1="78" y1="78" x2="82" y2="82" stroke-width="8" stroke-linecap="square"></line>
  178. </svg>
  179. </button>
  180. </div>
  181. <div id="sidebar" class="sidebar"></div>
  182. <script type="text/javascript">require('./electron');</script>
  183. </body>
  184. </html>