|
| 1 | +<meta charset="UTF-8"> |
| 2 | +<style> |
| 3 | +* { box-sizing: border-box; } |
| 4 | +*:focus { |
| 5 | + outline: none; |
| 6 | +} |
| 7 | +html, body { |
| 8 | + font-family: sans-serif; |
| 9 | + background: #eee; |
| 10 | + color: #444; |
| 11 | + margin: 0; |
| 12 | + padding: 0; |
| 13 | +} |
| 14 | + |
| 15 | + |
| 16 | +.app { |
| 17 | + display: flex; |
| 18 | + flex-direction: column; |
| 19 | + height: 100vh; |
| 20 | + padding: 20px; |
| 21 | +} |
| 22 | +.app > a { |
| 23 | + position: absolute; |
| 24 | + width: 100px; |
| 25 | + height: 100px; |
| 26 | + right: 0; |
| 27 | + bottom: 0; |
| 28 | + background-image: url(logo-statebox.svg); |
| 29 | + background-size: 100% 100%; |
| 30 | + background-origin: content-box; |
| 31 | + background-repeat: no-repeat; |
| 32 | + padding: 20px; |
| 33 | +} |
| 34 | +.main { |
| 35 | + flex: 1; |
| 36 | + display: flex; |
| 37 | +} |
| 38 | +aside { |
| 39 | + display: flex; |
| 40 | + flex-direction: column; |
| 41 | + width: 25vw; |
| 42 | + margin: -10px 0 0 20px; |
| 43 | +} |
| 44 | +h2 { |
| 45 | + font-size: inherit; |
| 46 | + margin-top: 20px; |
| 47 | + margin-bottom: 10px; |
| 48 | +} |
| 49 | +footer { |
| 50 | + overflow: auto; |
| 51 | + margin-right: 80px; |
| 52 | +} |
| 53 | + |
| 54 | + |
| 55 | +.bricks { |
| 56 | + position: relative; |
| 57 | + justify-self: stretch; |
| 58 | + display: grid; |
| 59 | + grid-gap: 2px; |
| 60 | + flex: 1; |
| 61 | + user-select: none; |
| 62 | + -webkit-user-select: none; |
| 63 | +} |
| 64 | +.bricks svg { |
| 65 | + position: absolute; |
| 66 | + top: 0; |
| 67 | + left: 0; |
| 68 | + width: 100%; |
| 69 | + height: 100%; |
| 70 | +} |
| 71 | +.box > rect:first-child { |
| 72 | + fill: rgba(0, 0, 0, .07); |
| 73 | + transition: fill 0.3s; |
| 74 | +} |
| 75 | +.bricks:focus .box.selected > rect:first-child { |
| 76 | + fill: rgba(0, 112, 204, 0.2); |
| 77 | +} |
| 78 | +.bricks.show-wires:not(:focus) .box > rect:first-child { |
| 79 | + fill: rgba(221, 221, 221, 0) !important; |
| 80 | +} |
| 81 | +.inner-box { |
| 82 | + fill: rgba(255, 255, 255, 0); |
| 83 | + stroke: rgba(68, 68, 68, 0); |
| 84 | + stroke-width: 0.01; |
| 85 | + transition: fill 0.3s, stroke 0.3s; |
| 86 | +} |
| 87 | +.inner-box-text { |
| 88 | + fill: white; |
| 89 | + font-size: .4px; |
| 90 | + font-weight: bold; |
| 91 | + transition: fill 0.3s; |
| 92 | +} |
| 93 | +.bricks.show-wires .inner-box { |
| 94 | + fill: white; |
| 95 | + stroke: #444; |
| 96 | +} |
| 97 | +.bricks.show-wires .inner-box-text { |
| 98 | + fill: #444; |
| 99 | +} |
| 100 | +.selection { |
| 101 | + fill: none; |
| 102 | + stroke: rgba(112, 112, 112, 0); |
| 103 | + stroke-width: 0.02; |
| 104 | + pointer-events: none; |
| 105 | + transition: stroke 0.3s; |
| 106 | +} |
| 107 | +.bricks:focus .selection { |
| 108 | + stroke: rgba(0, 112, 204, 0.7); |
| 109 | +} |
| 110 | +.object { |
| 111 | + fill: #444; |
| 112 | + stroke-width: 0; |
| 113 | + transition: opacity 0.3s; |
| 114 | + font-family: 'Times New Roman', Times, serif; |
| 115 | + font-style: italic; |
| 116 | + font-size: 0.13px; |
| 117 | +} |
| 118 | +.object.invalid { |
| 119 | + fill: rgba(204, 0, 0, 1); |
| 120 | +} |
| 121 | +.show-wires path, .show-wires .object circle { |
| 122 | + opacity: 0; |
| 123 | +} |
| 124 | +.object.equal.valid span.output { |
| 125 | + display: none; |
| 126 | +} |
| 127 | +.line { |
| 128 | + stroke: #444; |
| 129 | + stroke-width: 0.01; |
| 130 | + fill: none; |
| 131 | + transition: opacity 0.3s, stroke 0.3s, stroke-width 0.3s; |
| 132 | +} |
| 133 | +.arrowhead { |
| 134 | + fill: #444; |
| 135 | +} |
| 136 | +.object.invalid .line, .object.invalid .arrowhead { |
| 137 | + stroke: rgba(204, 0, 0, 1); |
| 138 | +} |
| 139 | +.show-wires .line, .show-wires .arrowhead { |
| 140 | + opacity: 1; |
| 141 | +} |
| 142 | +.show-bricks .box .line { |
| 143 | + stroke: rgba(68, 68, 68, 0); |
| 144 | +} |
| 145 | +.bricks:focus::after { |
| 146 | + content: 'Press alt to toggle between bricks and wires.'; |
| 147 | + position: absolute; |
| 148 | + right: 0; |
| 149 | + top: 100%; |
| 150 | + font-family: 'Times New Roman', Times, serif; |
| 151 | + font-style: italic; |
| 152 | + padding-top: 5px; |
| 153 | +} |
| 154 | +.wires { |
| 155 | + fill: #444; |
| 156 | +} |
| 157 | +.wires > rect:first-child { |
| 158 | + opacity: 0; |
| 159 | +} |
| 160 | +.wires .node { |
| 161 | + stroke: #444; |
| 162 | + stroke-width: 0.01; |
| 163 | + z-index: 1; |
| 164 | +} |
| 165 | +.wires .node.white { |
| 166 | + fill: #fff; |
| 167 | +} |
| 168 | +.bricks:focus .wires.selected > rect:first-child { |
| 169 | + fill: rgba(0, 112, 204, 0.1); |
| 170 | + opacity: 1; |
| 171 | +} |
| 172 | +text.object[text-anchor=start] { |
| 173 | + transform: translate(0.05px, -0.05px); |
| 174 | +} |
| 175 | +text.object[text-anchor=end] { |
| 176 | + transform: translate(-0.05px, -0.05px); |
| 177 | +} |
| 178 | +text.object.centered { |
| 179 | + text-anchor: middle !important; |
| 180 | + transform: translate(0, -0.07px); |
| 181 | +} |
| 182 | + |
| 183 | +.fieldset { |
| 184 | + display: grid; |
| 185 | + grid-template-columns: auto 1fr; |
| 186 | + grid-gap: 10px; |
| 187 | + align-items: center; |
| 188 | +} |
| 189 | +.inputs { |
| 190 | + display: grid; |
| 191 | + grid-gap: 0 10px; |
| 192 | +} |
| 193 | +textarea, input { |
| 194 | + border: none; |
| 195 | + border-radius: 3px; |
| 196 | + width: 100%; |
| 197 | + font-family: 'Fira Code', 'Courier New', Courier, monospace; |
| 198 | + font-size: 14px; |
| 199 | + font-weight: 500; |
| 200 | + color: inherit; |
| 201 | + padding: 8px; |
| 202 | +} |
| 203 | +textarea { |
| 204 | + flex: 1; |
| 205 | +} |
| 206 | + |
| 207 | + |
| 208 | +.term { |
| 209 | + line-height: 20px; |
| 210 | + margin-top: -10px; |
| 211 | +} |
| 212 | +.tc, .tt { |
| 213 | + display: flex; |
| 214 | + border-top: 20px solid rgba(0, 0, 0, .1); |
| 215 | + border-radius: 5px; |
| 216 | + transition: background-color 0.3s; |
| 217 | +} |
| 218 | +.selected.tc, .selected.tt, .selected .tc, .selected .tt { |
| 219 | + border-top-color: rgba(0, 112, 204, 0.3); |
| 220 | +} |
| 221 | +.term > .tc, .term > .tt { |
| 222 | + border-top: none; |
| 223 | +} |
| 224 | +.term span, .term i { |
| 225 | + display: inline-block; |
| 226 | + background: rgba(0, 0, 0, .2); |
| 227 | + color: white; |
| 228 | + min-width: 20px; |
| 229 | + padding: 0 3px; |
| 230 | + border-radius: 5px; |
| 231 | + text-align: center; |
| 232 | + font-family: 'Times New Roman', Times, serif; |
| 233 | + transition: background-color 0.3s; |
| 234 | +} |
| 235 | +.term .selected span, .term .selected i { |
| 236 | + background: rgba(0, 112, 204, 0.7); |
| 237 | + color: white; |
| 238 | +} |
| 239 | +.term i { |
| 240 | + background: rgba(0, 0, 0, .1); |
| 241 | + color: inherit; |
| 242 | +} |
| 243 | +.term div { |
| 244 | + margin: 5px 1px 0 1px; |
| 245 | +} |
| 246 | +</style> |
| 247 | +<body></body> |
| 248 | +<script src="index.js"></script> |
0 commit comments