<!-- 用来展示火势的图片或者视频数据 -->
<template>
    <div>
        <el-dialog class="dialogbig" model-value="imgShow" style="background-color: rgba(0, 0, 0, 0)"  >
            <div class="media-container">
                <!-- 图片展示行 -->
                <div class="image-row" >
                    <h3>图片</h3>
                    <div class="image-list" v-if="images">
                      <div v-for="item in images" class="image-item">
                          <img src="../../static/image/loginback.png" :alt="item.name" />

                          {{ typeof item.url }}--{{ item }}
                          
                      </div>
                    </div>
                    <div v-else> 暂无图片数据</div>
                </div>
                
                <!-- 视频展示行 -->
                <div class="video-row" v-if="videos">
                    <h3>视频</h3>
                    <div class="video-list" v-if="videos">
                    <div v-for="(video, index) in videos" :key="index" class="video-item">
                        <video :src="video.url" controls :poster="video.poster">
                        您的浏览器不支持视频播放
                        </video>
                    </div>
                    </div>
                    <div v-else> 暂无视频数据</div>
                </div>
                </div>
        </el-dialog>
    </div>
</template>

<script setup>
    // import { onMounted } from 'vue';
    const props = defineProps(["imgShow", "images", "videos", "imgShow"]);
  
    // console.log('获取图片和视频数据',props)

</script>

<style  scoped>
.horizontal-container {
  margin: 20px 0 10px 0;
  display: flex;
  align-items: center; /* 垂直居中对齐 */
}
.media-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
  background: rgb(4, 33, 54);
  border-radius: 10px;
}
/* 图片行样式 */
.image-row {
  margin-bottom: 40px;
}

.image-list {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 0;
}

.image-item {
  position: relative;
  flex-shrink: 0;
  width: 200px;
  height: 150px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.image-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-item:hover .image-overlay {
  opacity: 1;
}

/* 视频行样式 */
.video-row {
  margin-bottom: 20px;
}

.video-list {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  padding: 10px 0;
}

.video-item {
  flex-shrink: 0;
  width: 300px;
  border-radius: 8px;
  overflow: hidden;
  /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); */
  /* background: white; */
}

.video-item video {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.video-info {
  padding: 10px;
  background: white;
  text-align: center;
  font-weight: 500;
  color: #333;
}

/* 图片模态框 */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
}

.modal-content img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
}

.close-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 标题样式 */
h3 {
  color: #fcfcfc;
  margin-bottom: 15px;
  font-size: 20px;
  font-weight: 600;
  padding-left: 10px;
  border-left: 4px solid #007bff;
}

/* 滚动条美化 */
.image-list::-webkit-scrollbar,
.video-list::-webkit-scrollbar {
  height: 8px;
}

.image-list::-webkit-scrollbar-track,
.video-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.image-list::-webkit-scrollbar-thumb,
.video-list::-webkit-scrollbar-thumb {
  background: #154e8a;
  border-radius: 4px;
}

.image-list::-webkit-scrollbar-thumb:hover,
.video-list::-webkit-scrollbar-thumb:hover {
  background: #3b5775;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .media-container {
    padding: 15px;
  }
  
  .image-item {
    width: 150px;
    height: 120px;
  }
  
  .video-item {
    width: 250px;
  }
  
  .video-item video {
    height: 150px;
  }
}
</style>