Leadership.vue 8.55 KB
<template>
  <div class="container leadership-bg" :class="{ rtl: $i18n.locale === 'ar' }">
    <AppHeader />
    <img src="@/assets/icon1.png" alt="" class="leadership-icon1" />
    <img src="@/assets/icon2.png" alt="" class="leadership-icon2" />
    <img src="@/assets/leadership/icon5.png" alt="" class="leadership-icon4" />
    <div class="leadership-main">
      <div class="leadership-title" v-html="$t('leadership.title')"></div>
      <img
        class="star star-left"
        src="@/assets/leadership/icon3.png"
        alt="star"
      />
      <img
        class="star star-right"
        src="@/assets/leadership/icon4.png"
        alt="star"
      />
      <div class="leadership-slider-outer">
        <div class="arrow-btn-outer">
          <div class="arrow-btn left" @click="slidePrev">
            <img src="@/assets/leadership/left.png" alt="left" />
          </div>
          <div class="arrow-btn right" @click="slideNext">
            <img src="@/assets/leadership/right.png" alt="right" />
          </div>
        </div>
        <div class="leadership-slider" :key="$i18n.locale">
          <Swiper
            :modules="modules"
            :slides-per-view="4"
            :space-between="71"
            :navigation="false"
            :loop="leaders.length > 4"
            class="leader-swiper"
            @swiper="onSwiper"
          >
            <SwiperSlide v-for="(leader, idx) in leaders" :key="idx">
              <div class="leader-card">
                <img class="leader-photo" :src="leader.photo" alt="leader" />
                <span class="dot"></span>
                <div class="leader-info-bar">
                  <div class="leader-name">{{ $t("leadership.name") }}</div>
                  <div class="leader-position">
                    {{ $t("leadership.position") }}
                  </div>
                </div>
              </div>
            </SwiperSlide>
          </Swiper>
        </div>
      </div>
      <div class="team-intro-block">
        <div class="team-intro-text">
          <div class="team-intro-title">{{ $t("leadership.team_intro") }}</div>
          <div class="team-intro-desc">{{ $t("leadership.team_desc1") }}</div>
          <div class="team-intro-desc">{{ $t("leadership.team_desc2") }}</div>
        </div>
        <img
          class="team-intro-img"
          src="@/assets/leadership/name_desc.png"
          alt="team"
        />
        <img
          src="@/assets/leadership/icon5.png"
          alt=""
          class="leadership-icon3"
        />
      </div>
    </div>
  </div>
</template>

<script setup>
import AppHeader from "@/components/AppHeader.vue";
import { Swiper, SwiperSlide } from "swiper/vue";
import { Navigation } from "swiper/modules";
import "swiper/css";
import leader1 from "@/assets/leadership/icon1.png";
import leader2 from "@/assets/leadership/icon2.png";
import leader3 from "@/assets/leadership/icon3.png";
import leader4 from "@/assets/leadership/icon4.png";
import leader5 from "@/assets/leadership/icon5.png";
import { ref, watch } from "vue";
import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();

const modules = [Navigation];
const leaders = [
  { photo: leader1 },
  { photo: leader2 },
  { photo: leader3 },
  { photo: leader4 },
  { photo: leader5 },
];
const swiperRef = ref(null);
const onSwiper = (swiper) => {
  swiperRef.value = swiper;
};
const slidePrev = () => {
  swiperRef.value && swiperRef.value.slidePrev();
};
const slideNext = () => {
  swiperRef.value && swiperRef.value.slideNext();
};

// Watch for changes in the locale
watch(locale, (newLocale) => {
  console.log("123 locale.value", newLocale);

  if (swiperRef.value) {
    console.log('123 11');
    
    swiperRef.value.update(); // Update the Swiper instance
  }
});
</script>

<style scoped lang="scss">
.leadership-bg {
  background: #000000;
  position: relative;
  padding-bottom: 40px;
}
.leadership-icon1 {
  position: absolute;
  left: -698px;
  top: -300px;
  width: 1396px;
  object-fit: cover;
  z-index: 0;
}

.leadership-icon2 {
  position: absolute;
  right: -422px;
  bottom: -308px;
  width: 1396px;
  object-fit: cover;
  z-index: 0;
}
.leadership-icon3 {
  width: 212px;
  height: 212px;
  position: absolute;
  left: 222px;
  bottom: -8px;
}
.leadership-icon4 {
  width: 212px;
  height: 212px;
  position: absolute;
  right: -24px;
  top: 577px;
}

.leadership-main {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 48px;
}

.leadership-title {
  position: relative;
  margin-bottom: 49px;
  padding-left: 40px;
  font-family: Microsoft YaHei, Microsoft YaHei;
  font-weight: 800;
  font-size: 52px;
  color: #ffffff;
  z-index: 2;
  .highlight {
    position: relative;
    display: inline-block;
    font-weight: 800;
    background: linear-gradient(90deg, #c844ff 0%, #982fff 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
    padding-bottom: 0;
    &::after {
      content: "";
      position: absolute;
      bottom: -8px;
      left: 0;
      width: 100%;
      height: 34px;
      background: url(@/assets/leadership/name_desc.png);
      background-size: cover;
      background-repeat: no-repeat;
      z-index: -1;
    }
  }
}

.star-left {
  position: absolute;
  width: 60px;
  top: 88px;
  left: -61px;
  width: 61px;
  height: 60px;
}
.star-right {
  position: absolute;
  width: 60px;
  top: 13px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 80px;
}

.leadership-slider-outer {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 69px auto;
  position: relative;
}

.leadership-slider {
  position: relative;
  width: 100%;
  padding: 28px 17px 28px 41px;
  box-sizing: border-box;
  overflow: hidden;
}

.arrow-btn-outer {
  position: absolute;
  right: -71px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  z-index: 10;
}
.rtl .arrow-btn-outer {
  right: auto;
  left: -71px;
  flex-direction: row-reverse;
}
.arrow-btn {
  width: 18px;
  height: 26px;
  cursor: pointer;
}

.leader-swiper {
  width: 100%;
  max-width: 1400px;
  overflow: visible;
  .swiper-wrapper {
    align-items: stretch;
    overflow: visible;
  }
  .swiper-slide {
    overflow: visible;
  }
}
.leadership-cards {
  display: flex;
  gap: 71px;
  overflow: visible;
}
.leader-card {
  background: #fff1;
  border-radius: 8px;
  overflow: visible;
  width: 283px;
  height: 341px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.leader-card:hover {
  transform: scale(1.07) translateY(-8px);
  z-index: 3;
}
.leader-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}
.dot {
  position: absolute;
  top: 15px;
  right: 16px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  border: 2px solid #eaeaea;
  box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.08);
  z-index: 3;
}
.leader-info-bar {
  position: absolute;
  left: -23px;
  bottom: 13px;
  width: 262px;
  height: 102px;
  padding: 10px 22px 22px;
  background: linear-gradient(90deg, #c22fff 0%, #8b17ff 100%), #b178ff;
  border-radius: 8px;
  box-sizing: border-box;
}
.leader-name {
  margin-bottom: 5px;
  font-family: Microsoft YaHei, Microsoft YaHei;
  font-weight: 600;
  font-size: 28px;
  color: #ffffff;
}
.leader-position {
  font-family: Microsoft YaHei, Microsoft YaHei;
  font-weight: 600;
  font-size: 20px;
  color: #ffffff;
}

.team-intro-block {
  display: flex;
  align-items: center;
  margin: 0 auto;
  max-width: 1400px;
  width: 100%;
  height: 350px;
  min-height: 350px;
  padding: 32px 28px 37px 27px;
  overflow: hidden;
  background-image: url(@/assets/leadership/content_bg.png);
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}
.team-intro-desc + .team-intro-desc {
  margin-top: 12px;
}
.team-intro-text {
  padding-top: 38px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 100%;
}
.team-intro-title {
  margin-bottom: 20px;
  font-family: Microsoft YaHei, Microsoft YaHei;
  font-weight: 600;
  font-size: 32px;
  color: #ffffff;
}
.team-intro-desc {
  font-family: Microsoft YaHei, Microsoft YaHei;
  font-weight: 600;
  font-size: 16px;
  color: #ffffff;
}
.team-intro-img {
  flex: 1;
  object-fit: cover;
  width: 834px;
  height: 295px;
  border-radius: 20px;
}

@media (max-width: 1200px) {
  .leadership-main {
    max-width: 98vw;
  }
  .leader-swiper {
    width: 98vw;
  }
  .team-intro-block {
    flex-direction: column;
    min-height: 0;
  }
  .team-intro-img {
    min-width: 0;
    max-width: 100%;
    border-radius: 0 0 20px 20px;
  }
}
</style>