<template>
  <ul>
    <li v-for="(gallery, index) in galleries"
        class="featured-image"
        :style="{ 'height': featuredHeight,
                  'background-image': 'url(' + gallery.featuredImage + ')' }"
        :key="index"
        @click="$emit('clicked', index)">
      <span>{{ gallery.title }}</span>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    galleries: {
      type: Array,
      required: true
    },
    featuredHeight: {
      type: String,
      required: true
    }
  },

  data () {
    return {
    }
  },

  computed: {
  },

  methods: {
  }
}
</script>

<style lang="scss" scoped>
@media (max-width: $bp__layout) {
  .featured-image {
    height: calc(50vh - #{$site-menu__header-height / 2}) !important; // must override inline style set with prop
    width: 100vw;
    flex: 0 0 100vw;
  }
}

@media (min-width: $bp__layout) {
  .featured-image {
    width: 100%;
    background-size: cover;
    background-position: center center;
  }
}

</style>
