hero-image.html 800 Bytes
<link rel="import" href="../../bower_components/iron-image/iron-image.html">

<dom-module id="hero-image">
  <style>
    :host {
      position: relative;
      @apply(--layout-horizontal);
      @apply(--layout-center-justified);
      @apply(--layout-center);
    }

    iron-image {
      @apply(--layout-fit);
    }

    iron-image::shadow img {
      fill: white;
    }
  </style>
  <template>
    
  </template>
</dom-module>

<script>
Polymer({
  is: 'hero-image',
  properties: {
    src: {type: String, observer: '_update'},
    _src: String
  },
  ready: function() {
    this._update();
  },
  _update: function(src) {
    if (src && src.length) {
      this._src = src;
    } else {
      this._src = "/images/hero/random-" + Math.ceil(Math.random() * 4) + ".svg";
    }
  }
});
</script>