Home.vue 7.72 KB
<template>
  <div class="home-container">
    <!-- 全屏背景图 - 海报@2x.png -->
    <div class="full-background"></div>

    <!-- 左下角背景装饰图 - bg@2x.png -->
    <div class="bottom-left-decoration"></div>

    <!-- 主要内容区域 -->
    <div class="main-content">
      <!-- 顶部Banner图片 -->
      <div class="banner-section">
        <img
          src="@/assets/images/02 西园戒幢律寺三坛大戒法会/banner@2x.png"
          alt="三坛大戒法会Banner"
          class="banner-image"
        />
      </div>

      <!-- 视频播放器区域 -->
      <div class="video-section">
        <VideoPlayer
          :video-url="videoUrl"
          video-id="home-video"
          :autoplay="false"
          :options="videoOptions"
        />
      </div>

      <!-- 法会流程 -->
      <div class="ceremony-process">
        <!-- 标题 -->
        <div class="ceremony-title">
          <img src="/src/assets/images/02 西园戒幢律寺三坛大戒法会/法會流程@2x.png" alt="法会流程" />
        </div>

        <!-- 流程步骤 -->
        <div class="process-container">
          <!-- 麻绳背景 -->
          <div class="rope-background"></div>

          <!-- 流程步骤 -->
          <div class="process-steps">
            <div
            v-for="(step, index) in processSteps"
            :key="index"
            class="process-step"
            :class="{ active: step.active }"
            @click="selectStep(index)"
          >
              <!-- 顶部白色圆形占位(选中状态) -->
              <div class="top-circle"></div>

              <!-- 步骤内容 -->
              <div class="step-content">
                <span class="step-text">{{ step.name }}</span>
              </div>

              <!-- 底部箭头(选中状态) -->
              <div v-if="step.active" class="bottom-arrow">
                <img src="/src/assets/images/02 西园戒幢律寺三坛大戒法会/点@2x.png" alt="选中" />
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import VideoPlayer from '@/components/VideoPlayer.vue'

// 视频配置
const videoUrl = ref('/src/assets/images/02 西园戒幢律寺三坛大戒法会/sample-10s.mp4')

const videoOptions = ref({
  fluid: true,
  responsive: true,
  aspectRatio: '16:9',
  controls: true,
  preload: 'metadata',
  poster: '',
  playbackRates: [0.5, 1, 1.25, 1.5, 2],
  sources: [{
    src: '/src/assets/images/02 西园戒幢律寺三坛大戒法会/sample-10s.mp4',
    type: 'video/mp4'
  }]
})

// 法会流程步骤数据
const processSteps = ref([
  { name: '准 备', active: true },
  { name: '正式开堂', active: false },
  { name: '封堂洒净', active: false },
  { name: '正授沙弥戒', active: false },
  { name: '二坛比丘戒', active: false },
  { name: '三坛菩萨戒', active: false },
  { name: '圆 满', active: false }
])

// 点击切换步骤状态
const selectStep = (index) => {
  processSteps.value.forEach((step, i) => {
    step.active = i === index
  })
}
</script>

<style scoped>
.home-container {
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

/* 全屏背景图 - 海报@2x.png */
.full-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('@/assets/images/02 西园戒幢律寺三坛大戒法会/海报@2x.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  z-index: -2;
}

/* 左下角背景装饰图 - bg@2x.png */
.bottom-left-decoration {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 50%;
  height: 50%;
  background-image: url('@/assets/images/02 西园戒幢律寺三坛大戒法会/bg@2x.png');
  background-size: contain;
  background-position: bottom left;
  background-repeat: no-repeat;
  z-index: -1;
  pointer-events: none;
}

/* 主要内容区域 */
.main-content {
  position: relative;
  z-index: 1;
  width: 100%;
}

/* Banner区域 */
.banner-section {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* 视频播放器区域 */
.video-section {
  width: 100%;
  margin: 0;
  padding: 0;
}

.video-section :deep(.video-player-container) {
  width: 100%;
  background: transparent;
}

.video-section :deep(.video-player) {
  width: 100%;
  height: auto;
}

/* 响应式设计 */
@media (max-width: 48rem) {
  .bottom-left-decoration {
    width: 60%;
    height: 40%;
  }
}

@media (max-width: 30rem) {
  .bottom-left-decoration {
    width: 70%;
    height: 35%;
  }
}

/* 法会流程模块 */
.ceremony-process {
  width: 100%;
  padding: 2rem 1rem;
  position: relative;
  z-index: 2;
}

/* 标题部分 */
.ceremony-title {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 2rem;
}

.ceremony-title img {
  max-width: 12rem;
  height: auto;
}

/* 流程容器 */
.process-container {
  position: relative;
  width: 100%;
}

/* 麻绳背景 */
.rope-background {
  position: absolute;
  top: 10%;
  left: 0;
  right: 0;
  height: 0.3rem;
  background-image: url('@/assets/images/02 西园戒幢律寺三坛大戒法会/麻绳@2x.png');
  background-size: cover;
  background-position: top;
  background-repeat: repeat-x;
  transform: translateY(-10%);
  z-index: 1;
}

/* 流程步骤容器 */
.process-steps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
  padding: 0 0.5rem;
  gap: 0.5rem;
}

/* 单个流程步骤 */
.process-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.process-step:hover {
  transform: scale(1.05);
}

/* 步骤内容 */
.step-content {
  width: 4rem;
  height: 10rem;
  background: linear-gradient(180deg, #DAC39E 0%, #BE9C63 100%);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s ease;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

/* 选中状态的步骤内容 */
.process-step.active .step-content {
  background: linear-gradient(180deg, #C8916C 0%, #975021 100%);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.2);
}

/* 步骤文字 */
.step-text {
  color: white;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  text-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.3);
  margin-top: 0.85rem;
  /* 文字间隔 */
  letter-spacing: 0.05rem;
}

/* 顶部白色圆形占位 */
.top-circle {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: 50%;
  z-index: 3;
}

/* 底部箭头 */
.bottom-arrow {
  position: absolute;
  bottom: -1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
}

.bottom-arrow img {
  width: 1rem;
  height: 1rem;
}

/* 响应式调整 */
@media (max-width: 48rem) {
  .ceremony-process {
    padding: 1.5rem 0.5rem;
  }

  .ceremony-title img {
    max-width: 10rem;
  }

  .step-content {
    width: 3rem;
    height: 8rem;
  }

  .step-text {
    font-size: 0.9rem;
  }

  .process-steps {
    padding: 0 0.25rem;
    gap: 0.25rem;
  }
}

@media (max-width: 30rem) {
  .ceremony-process {
    padding: 1rem 0.25rem;
  }

  .ceremony-title img {
    max-width: 8rem;
  }

  .step-content {
    width: 2.5rem;
    height: 6.5rem;
  }

  .step-text {
    font-size: 0.8rem;
  }

  .top-circle {
    width: 0.75rem;
    height: 0.75rem;
  }

  .bottom-arrow img {
    width: 1rem;
    height: 0.75rem;
  }

  .process-steps {
    gap: 0.125rem;
  }
}
</style>