<template>
  <div class="container">
    <div class="block1">
      <div class="video">
        <img src="/src/assets/images/map/img16.png" alt="" />
      </div>
    </div>
    <div class="block2">
      <layout-title title="实时告警监控" />
      <div class="options">
        <div
          class="option mb-10"
          v-for="(item, index) in data.block1OptionsList"
          :key="index"
        >
          <div class="img">
            <img :src="item.img" alt="" />
          </div>
          <div class="info" :class="item.type === 1 ? '' : 'bg_blue'">
            <div class="title">
              <div class="tit">{{ item.title }}</div>
              <div class="ico">
                <img :src="item.type === 1 ? item.img1 : item.img2" alt="" />
              </div>
            </div>
            <div class="time">{{ item.time }}</div>
            <div class="text">{{ item.text }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script setup>
import LayoutTitle from "./title.vue";
import { reactive } from "vue";

const data = reactive({
  block1OptionsList: [
    {
      img: new URL("/src/assets/images/map/img16.png", import.meta.url).href,
      img1: new URL("/src/assets/images/map/img17.png", import.meta.url).href,
      img2: new URL("/src/assets/images/map/img18.png", import.meta.url).href,
      title: "未戴安全帽",
      time: "2023-08-09  15:14:23",
      text: "告警源：油品库包装裤袋",
      type: 1,
    },
    {
      img: new URL("/src/assets/images/map/img16.png", import.meta.url).href,
      img1: new URL("/src/assets/images/map/img17.png", import.meta.url).href,
      img2: new URL("/src/assets/images/map/img18.png", import.meta.url).href,
      title: "未戴安全帽",
      time: "2023-08-09  15:14:23",
      text: "告警源：油品库包装裤袋",
      type: 1,
    },
    {
      img: new URL("/src/assets/images/map/img16.png", import.meta.url).href,
      img1: new URL("/src/assets/images/map/img17.png", import.meta.url).href,
      img2: new URL("/src/assets/images/map/img18.png", import.meta.url).href,
      title: "未戴安全帽",
      time: "2023-08-09  15:14:23",
      text: "告警源：油品库包装裤袋",
      type: 1,
    },
    {
      img: new URL("/src/assets/images/map/img16.png", import.meta.url).href,
      img1: new URL("/src/assets/images/map/img17.png", import.meta.url).href,
      img2: new URL("/src/assets/images/map/img18.png", import.meta.url).href,
      title: "未戴安全帽",
      time: "2023-08-09  15:14:23",
      text: "告警源：油品库包装裤袋",
      type: 1,
    },
    {
      img: new URL("/src/assets/images/map/img16.png", import.meta.url).href,
      img1: new URL("/src/assets/images/map/img17.png", import.meta.url).href,
      img2: new URL("/src/assets/images/map/img18.png", import.meta.url).href,
      title: "未戴安全帽",
      time: "2023-08-09  15:14:23",
      text: "告警源：油品库包装裤袋",
      type: 2,
    },
  ],
});
</script>
<style scoped lang="scss">
.container {
  width: 100%;

  .block1 {
    width: 430px;

    .video {
      width: 100%;
      height: 260px;
      border: 2px solid #11acd7;
      border-radius: 4px;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }

  .block2 {
    width: 430px;
    margin-top: 10px;

    .options {
      width: 100%;
      min-height: 100px;
      background-image: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0),
        rgba(0, 0, 0, 0.8)
      );
      border-radius: 10px;
      border: 1px solid;
      border-image: linear-gradient(
          to bottom,
          rgba(58, 122, 149, 0),
          rgba(16, 188, 236, 1)
        )
        1;
      border-top: none;
      display: flex;
      flex-direction: column;
      padding: 10px;

      .option {
        width: 100%;
        display: flex;
        align-items: center;

        .img {
          width: 180px;
          height: 115px;
          border: 1px solid #11acd7;

          img {
            width: 100%;
            height: 100%;
          }
        }

        .info {
          flex: 1;
          background-image: linear-gradient(
            to top,
            rgba(0, 0, 0, 0),
            rgba(148, 129, 39, 0.6)
          );
          padding: 10px;
          height: 115px;
          display: flex;
          justify-content: space-between;
          flex-direction: column;

          .title {
            width: 100%;
            display: flex;
            justify-content: space-between;
            font-size: 16px;

            .tit {
              font-weight: bold;
            }
          }
        }

        .bg_blue {
          background-image: linear-gradient(
            to top,
            rgba(0, 0, 0, 0),
            rgba(2, 119, 242, 0.6)
          );
        }
      }
    }
  }

  @keyframes slideY {
    0% {
      transform: translateY(0);
    }
    50% {
      transform: translateY(-5px);
    }
    100% {
      transform: translateY(0);
    }
  }
  @keyframes scale {
    0% {
      transform: translateX(-50%) scale(1);
    }
    50% {
      transform: translateX(-50%) scale(0.5);
    }
    100% {
      transform: translateX(-50%) scale(1);
    }
  }
}
</style>
