<template>
  <div
    class="container wow animate__animated animate__fadeInUp"
    v-if="url"
  >
    <div class="img">
      <img
        :src="url"
        v-if="url"
        width="100%"
        class="img"
        lazy
      />
      <img
        v-else
        src="@/assets/404_images/no-pic.png"
        alt=""
        width="100%"
        height="100%"
        class="img"
      />
    </div>
    <div class="desc">
      <span class="name">{{ title }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "CulturalRelicCard",
  props: {
    url: {
      type: String,
      default: "",
    },
    title: {
      type: String,
      default: "",
    },
  },
  methods: {},
};
</script>

<style lang='scss' scoped>
$blue: #2069c4;
.container {
  border: 1px solid #f1f1f1;
  height: 300px;
  position: relative;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  &:hover {
    // img {
    //   transform: scale(1.2);
    // }
    .desc {
      background-color: $blue;
      color: #fff;
    }
  }
  .img {
    background-color: #f8f8f8;
    height: 240px;
    cursor: pointer;
    transition: all 0.5s ease;
    overflow: hidden;
    img {
      height: 100%;
      object-fit: contain;
      // width: auto;
    }
  }
  .desc {
    padding: 16px;
    display: flex;
    justify-content: center;
    transition: all 0.5s ease;
    flex: 1;
  }
}
</style>