0x/visualizer/cmp/key.js
Renée Kooi 69d6faf6dc
Style fixes
- Fixes the height of the graph in FF
  For some reason `height: calc(100% - 66px)` does something totally
  different than `height: 100%`, but with `100vh` the behaviour is the
  same either way. This seems like a FF CSS bug maybe…
- Use floating + margins instead of absolute positions for top bar
  controls
  Default button and input sizes are different across browsers and OSes,
  by using floats + margins the positioning adapts to sizes instead of
  having things drawn on top of each other.
2018-07-04 11:47:39 +02:00

21 lines
916 B
JavaScript

'use strict'
module.exports = (render) => ({colors, enableOptUnopt}) => render`
<div id=key class='fr dn db-l mr1'>
<div class='fl' style="margin-right: 5px;">cold</div>
<div class='fl' style="background: ${colors[0]}; height: 20px; width: 20px; margin-right: 5px;"></div>
<div class='fl' style="background: ${colors[1]}; height: 20px; width: 20px; margin-right: 5px;"></div>
<div class='fl' style="background: ${colors[2]}; height: 20px; width: 20px; margin-right: 5px;"></div>
<div class='fl' style="background: ${colors[3]}; height: 20px; width: 20px; margin-right: 5px;"></div>
<div class='fl' style="display: block; float: left; margin-right: 5px;">hot</div>
${enableOptUnopt
? render`<div class='cf f6 silver mt3 pt1' style='margin-left:-.35em'>
<span>* optimized</span> <span class="indent">~ unoptimized</span>
</div>
`
: ''
}
</div>
`