| | |
| | | <template>
|
| | | <div class="art-mien">
|
| | | <div class="bg">
|
| | | <span class="title font-bold">文艺·风采</span>
|
| | | </div>
|
| | | <div class="content">
|
| | | <el-carousel type="card" indicator-position="none" loop="true" interval="2000" height="360px" :autoplay="true">
|
| | | <el-carousel-item v-for="(item, index) in list" :key="index">
|
| | | |
| | | <img :src="item.imgSrc" />
|
| | | </el-carousel-item>
|
| | | </el-carousel> |
| | | <!-- <div class="swiper-container"> |
| | | <template> |
| | | <div class="art-mien"> |
| | | <div class="bg"> |
| | | <span class="title font-bold">文艺·风采</span> |
| | | </div> |
| | | <div class="content"> |
| | | <el-carousel type="card" indicator-position="none" :loop="true" :interval="2000" height="360px" :autoplay="true"> |
| | | <el-carousel-item v-for="(item, index) in list" :key="index"> |
| | | |
| | | <img :src="item.imgSrc"> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | <!-- <div class="swiper-container"> |
| | | <div class="swiper-wrapper"> |
| | | <div class="swiper-slide" v-for="(item,index) in list" :key="index"> |
| | | <img :src="item.imgSrc" /> |
| | |
| | | <div class="swiper-pagination"></div> |
| | | <div class="swiper-button-prev"></div> |
| | | <div class="swiper-button-next"></div> |
| | | </div> -->
|
| | | </div>
|
| | | </div>
|
| | | </template>
|
| | |
|
| | | </div> --> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | // import '../../../utils/swiper.min.js'; |
| | | |
| | | export default {
|
| | | name: "ArtMien",
|
| | | data() {
|
| | | return {
|
| | | list: [{
|
| | | imgSrc: require("@/assets/home/art_mien/1.png")
|
| | | },
|
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/2.png")
|
| | | },
|
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/3.png")
|
| | | }, |
| | | |
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/4.png")
|
| | | },
|
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/5.png")
|
| | | },
|
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/6.png")
|
| | | },
|
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/7.png")
|
| | | },
|
| | | {
|
| | | imgSrc: require("@/assets/home/art_mien/8.png")
|
| | | }
|
| | | ], |
| | | certifySwiper:null
|
| | | }
|
| | | }, |
| | | // beforeMount() { |
| | | // var certifySwiper = new Swiper('.content .swiper-container', { |
| | | // watchSlidesProgress: true, |
| | | // slidesPerView: 'auto', |
| | | // centeredSlides: true, |
| | | // loop: true, |
| | | // loopedSlides: 5, |
| | | // autoplay: 3000, |
| | | // prevButton: '.swiper-button-prev', |
| | | // nextButton: '.swiper-button-next', |
| | | // pagination: '.swiper-pagination', |
| | | // //paginationClickable :true, |
| | | // onProgress: function(swiper, progress) { |
| | | // for (i = 0; i < swiper.slides.length; i++) { |
| | | // var slide = swiper.slides.eq(i); |
| | | // var slideProgress = swiper.slides[i].progress; |
| | | // modify = 1; |
| | | // if (Math.abs(slideProgress) > 1) { |
| | | // modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; |
| | | // } |
| | | // translate = slideProgress * modify * 260 + 'px'; |
| | | // scale = 1 - Math.abs(slideProgress) / 5; |
| | | // zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); |
| | | // slide.transform('translateX(' + translate + ') scale(' + scale + ')'); |
| | | // slide.css('zIndex', zIndex); |
| | | // slide.css('opacity', 1); |
| | | // if (Math.abs(slideProgress) > 3) { |
| | | // slide.css('opacity', 0); |
| | | // } |
| | | // } |
| | | // }, |
| | | // onSetTransition: function(swiper, transition) { |
| | | // for (var i = 0; i < swiper.slides.length; i++) { |
| | | // var slide = swiper.slides.eq(i) |
| | | // slide.transition(transition); |
| | | // } |
| | | // import '../../../utils/swiper.min.js'; |
| | | |
| | | export default { |
| | | name: 'ArtMien', |
| | | data() { |
| | | return { |
| | | list: [{ |
| | | imgSrc: require('@/assets/home/art_mien/1.png') |
| | | }, |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/2.png') |
| | | }, |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/3.png') |
| | | }, |
| | | |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/4.png') |
| | | }, |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/5.png') |
| | | }, |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/6.png') |
| | | }, |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/7.png') |
| | | }, |
| | | { |
| | | imgSrc: require('@/assets/home/art_mien/8.png') |
| | | } |
| | | ], |
| | | certifySwiper: null |
| | | } |
| | | } |
| | | // beforeMount() { |
| | | // var certifySwiper = new Swiper('.content .swiper-container', { |
| | | // watchSlidesProgress: true, |
| | | // slidesPerView: 'auto', |
| | | // centeredSlides: true, |
| | | // loop: true, |
| | | // loopedSlides: 5, |
| | | // autoplay: 3000, |
| | | // prevButton: '.swiper-button-prev', |
| | | // nextButton: '.swiper-button-next', |
| | | // pagination: '.swiper-pagination', |
| | | // //paginationClickable :true, |
| | | // onProgress: function(swiper, progress) { |
| | | // for (i = 0; i < swiper.slides.length; i++) { |
| | | // var slide = swiper.slides.eq(i); |
| | | // var slideProgress = swiper.slides[i].progress; |
| | | // modify = 1; |
| | | // if (Math.abs(slideProgress) > 1) { |
| | | // modify = (Math.abs(slideProgress) - 1) * 0.3 + 1; |
| | | // } |
| | | // translate = slideProgress * modify * 260 + 'px'; |
| | | // scale = 1 - Math.abs(slideProgress) / 5; |
| | | // zIndex = 999 - Math.abs(Math.round(10 * slideProgress)); |
| | | // slide.transform('translateX(' + translate + ') scale(' + scale + ')'); |
| | | // slide.css('zIndex', zIndex); |
| | | // slide.css('opacity', 1); |
| | | // if (Math.abs(slideProgress) > 3) { |
| | | // slide.css('opacity', 0); |
| | | // } |
| | | // } |
| | | // }, |
| | | // onSetTransition: function(swiper, transition) { |
| | | // for (var i = 0; i < swiper.slides.length; i++) { |
| | | // var slide = swiper.slides.eq(i) |
| | | // slide.transition(transition); |
| | | // } |
| | | |
| | | // }, |
| | | // //处理分页器bug |
| | | // onSlideChangeStart: function(swiper) { |
| | | // if (swiper.activeIndex == 4) { |
| | | // swiper.bullets.eq(9).addClass('swiper-pagination-bullet-active'); |
| | | // console.log(swiper.bullets.length); |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | }
|
| | | </script>
|
| | |
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | // }, |
| | | // //处理分页器bug |
| | | // onSlideChangeStart: function(swiper) { |
| | | // if (swiper.activeIndex == 4) { |
| | | // swiper.bullets.eq(9).addClass('swiper-pagination-bullet-active'); |
| | | // console.log(swiper.bullets.length); |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @import "~@/styles/variables.scss"; |
| | | // @import "../../../styles/swiper.min.css";
|
| | |
|
| | | .art-mien {
|
| | | width: $appWidth;
|
| | | height: 36rem;
|
| | |
|
| | | .bg {
|
| | | height: 8rem;
|
| | | overflow: hidden;
|
| | | position: relative;
|
| | | background-image: url("../../../assets/home/art_mien/bg.png");
|
| | | background-size: cover;
|
| | | text-align: center;
|
| | | line-height: 8rem;
|
| | |
|
| | | .title {
|
| | | // 文件渐变 TODO
|
| | | background: linear-gradient(to bottom, #ffffff, #949494);
|
| | | font-size: 60px;
|
| | | letter-spacing: 4.2rem;
|
| | | margin-left: 3.1rem; // 加上使文字居中
|
| | | background-clip: text;
|
| | | -webkit-background-clip: text;
|
| | | color: #fff;
|
| | | // color: transparent;
|
| | | text-shadow: 0.3rem 0.2rem 0.2rem #4a1308;
|
| | | }
|
| | | }
|
| | |
|
| | | .content {
|
| | | margin-top: 1rem;
|
| | | height: 27rem;
|
| | | position: relative;
|
| | | background-image: url("../../../assets/home/art_subject/bg.png");
|
| | | // @import "../../../styles/swiper.min.css"; |
| | | |
| | | .art-mien { |
| | | width: $appWidth; |
| | | height: 36rem; |
| | | |
| | | .bg { |
| | | height: 8rem; |
| | | overflow: hidden; |
| | | position: relative; |
| | | background-image: url("../../../assets/home/art_mien/bg.png"); |
| | | background-size: cover; |
| | | text-align: center; |
| | | line-height: 8rem; |
| | | |
| | | .title { |
| | | // 文件渐变 TODO |
| | | background: linear-gradient(to bottom, #ffffff, #949494); |
| | | font-size: 60px; |
| | | letter-spacing: 4.2rem; |
| | | margin-left: 3.1rem; // 加上使文字居中 |
| | | background-clip: text; |
| | | -webkit-background-clip: text; |
| | | color: #fff; |
| | | // color: transparent; |
| | | text-shadow: 0.3rem 0.2rem 0.2rem #4a1308; |
| | | } |
| | | } |
| | | |
| | | .content { |
| | | margin-top: 1rem; |
| | | height: 27rem; |
| | | position: relative; |
| | | background-image: url("../../../assets/home/art_subject/bg.png"); |
| | | background-size: 100% 100%; |
| | | |
| | | // position: relative; |
| | |
| | | // .swiper-button-next:hover { |
| | | // background-position: 0 -139px; |
| | | // background-size: 100% |
| | | // }
|
| | |
|
| | | /deep/ .el-carousel__indicators--outside {
|
| | | margin-top: 23px;
|
| | | }
|
| | |
|
| | | img {
|
| | | position: absolute;
|
| | | width: 18.5rem;
|
| | | height: 30rem;
|
| | | }
|
| | |
|
| | | img:nth-child(1) {
|
| | | left: 0;
|
| | | }
|
| | |
|
| | | img:nth-child(2) {
|
| | | left: 11.2rem;
|
| | | }
|
| | |
|
| | | img:nth-child(3) {
|
| | | left: 18.7rem;
|
| | | }
|
| | |
|
| | | img:nth-child(4) {
|
| | | left: 26.1rem;
|
| | | }
|
| | |
|
| | | img:nth-child(5) {
|
| | | left: 37rem;
|
| | | z-index: 5;
|
| | | }
|
| | |
|
| | | img:nth-child(6) {
|
| | | left: 47.6rem;
|
| | | z-index: 4;
|
| | | }
|
| | |
|
| | | img:nth-child(7) {
|
| | | left: 55.5rem;
|
| | | width: 17.5rem;
|
| | | z-index: 3;
|
| | | }
|
| | |
|
| | | img:nth-child(8) {
|
| | | right: 0;
|
| | | z-index: 2;
|
| | | }
|
| | | }
|
| | | }
|
| | | // } |
| | | |
| | | /deep/ .el-carousel__indicators--outside { |
| | | margin-top: 23px; |
| | | } |
| | | |
| | | img { |
| | | position: absolute; |
| | | width: 18.5rem; |
| | | height: 30rem; |
| | | } |
| | | |
| | | img:nth-child(1) { |
| | | left: 0; |
| | | } |
| | | |
| | | img:nth-child(2) { |
| | | left: 11.2rem; |
| | | } |
| | | |
| | | img:nth-child(3) { |
| | | left: 18.7rem; |
| | | } |
| | | |
| | | img:nth-child(4) { |
| | | left: 26.1rem; |
| | | } |
| | | |
| | | img:nth-child(5) { |
| | | left: 37rem; |
| | | z-index: 5; |
| | | } |
| | | |
| | | img:nth-child(6) { |
| | | left: 47.6rem; |
| | | z-index: 4; |
| | | } |
| | | |
| | | img:nth-child(7) { |
| | | left: 55.5rem; |
| | | width: 17.5rem; |
| | | z-index: 3; |
| | | } |
| | | |
| | | img:nth-child(8) { |
| | | right: 0; |
| | | z-index: 2; |
| | | } |
| | | } |
| | | } |
| | | </style> |