<!--{* banner *}--> <div id="banner" {{ app('visual').url('section', 18430) }}> <div class="swiper swiper-container"> <ul class="swiper-wrapper"> {% for value in app('section').id(18430) %} <li class="swiper-slide"> <a href="{{ value.url }}"> <div class="imgs"> <img src="{{ value.img[0] | img_format }}" alt="{{ value.name }}"> </div> {% if value.img[1] is not empty %} <div class="banner_wz hidden1"> <img src="{{ value.img[1] | img_format }}" alt="{{ value.name }}"> </div> {% endif %} </a> </li> {% endfor %} <li class="swiper-slide"> <video muted autoplay data-autoplay id="myvideo" style="width:100vw;height:100vh;object-fit:cover;" loop="loop"> <source src="{{ app('section').id(58126).content.link | videos_url }}" type="video/mp4"> </video> </li> </ul> </div> <div class="banner_control"> <div class="dth_wh flex"> <div class="banner_arrow"> <div class="swiper-button-prev"></div> <div class="swiper-button-next"></div> </div> <div class="banner_progress"> <span></span> </div> <div class="banner_beat"></div> </div> </div> </div> <script> let banner_progress = $(".banner_progress"); let banner_swiper = new Swiper("#banner .swiper-container", { autoplay: { delay: 21000, stopOnLastSlide: false, disableOnInteraction: false, }, loop: true, breakpointsBase: 'container', watchOverflow: true, //一个不启动 并隐藏 点 箭头等 loop 失效 roundLengths : true, // 将slide的宽和高取整 navigation: { nextEl: "#banner .swiper-button-next", prevEl: "#banner .swiper-button-prev", }, observer: true, on: { autoplayTimeLeft(s, time, progress) { // progressCircle.style.setProperty("--progress", 1 - progress); // progressContent.textContent = `${Math.ceil(time / 1000)}s`; banner_progress.find("span").css("width", (1 - progress) * 100 + "%"); } } }); </script> #banner{position:relative;width:100vw;height:100vh} #banner li a{display:block} #banner li .imgs{display:block} #banner li .imgs img{width:100%;min-height:240px;object-fit:cover} #banner li .banner_wz{position:absolute;left:9%;top:50%;transform:translate(50%,-50%);max-width:82%;opacity:0;transition:.2s all} #banner li.swiper-slide-active .banner_wz{transform:translate(0,-50%);opacity:1;transition:1s ease-out} #banner li .banner_wz img{max-width:100%} #banner .hi{display:none} .banner_control{position:absolute;left:0;bottom:4.1%;width:100%;z-index:30} .banner_control .dth_wh{align-items:center;justify-content:space-between} .banner_control .banner_arrow{width:140px;flex-shrink:0;display:flex;align-items:center;justify-content:space-between} #banner .swiper-button-next,#banner .swiper-button-prev{width:80px;height:80px;background-color:transparent;display:block;position:relative;margin:0;transform:none;background-repeat:no-repeat;background-position:center;background-size:auto;border:1px solid rgba(255,255,255,.2);border-radius:50%;flex-shrink:0} #banner .swiper-button-prev{left:0;background-image:url(//cdn.myxypt.com/97c00003/24/11/64be6ffcae03c1cbc5ca019b224b21c75483db46.png)} #banner .swiper-button-next{right:0;background-image:url(//cdn.myxypt.com/97c00003/24/11/ab6673957b1760f5055701b164e99f1990cf5586.png);margin-left:-20px} #banner .swiper-button-next:hover,#banner .swiper-button-prev:hover{border-color:#fff} #banner .swiper-button-next::after,#banner .swiper-button-prev::after{display:none} .banner_control .banner_progress{margin:0 7% 0 4.2%;flex-grow:1;background-color:rgba(255,255,255,.3);height:1px;display:block;overflow:hidden} .banner_control .banner_progress span{background-color:#fff;width:0;max-width:100%;height:100%;display:block} .banner_control .banner_beat{width:80px;height:80px;background-color:#62832b;display:block;position:relative;border-radius:50%} .banner_control .banner_beat::before{content:"";display:block;width:10px;height:117px;background-repeat:no-repeat;background-position:center;background-size:contain;background-image:url(//cdn.myxypt.com/97c00003/24/11/c97d489c933187869d96e2841188c5245bfbf165.png);position:absolute;left:50%;bottom:50%;transform:translate(-50%,-5px);animation:upDown 1.5s ease-in-out infinite} @keyframes upDown{0%,100%{opacity:.6;transform:translate(-50%,-5px)} 50%{opacity:1;transform:translate(-50%,5px)} } #banner .swiper-pagination-bullet{width:14px;height:14px} #banner .swiper-pagination-bullet.swiper-pagination-bullet-active,#banner .swiper-pagination-bullet:hover{background-color:#ff4500} @media (min-width:1201px){#banner li .imgs img{height:100vh;object-fit:cover} } @media (max-width:1660px){#banner li.swiper-slide-active .banner_wz{left:2%;max-width:96%} .banner_control .banner_arrow{width:8.4vw} #banner .swiper-button-next,#banner .swiper-button-prev{width:4.82vw;height:4.82vw;background-size:18px auto} #banner .swiper-button-next{margin-left:-1.24vw} .banner_control .banner_beat{width:4.82vw;height:4.82vw} .banner_control .banner_beat::before{height:7vw;width:.6vw} } @media (max-width:1200px){#banner li .imgs img{min-height:220px} #banner li.swiper-slide-active .banner_wz{left:15px;max-width:calc(100vw - 30px)} .banner_control .banner_arrow{width:100px} #banner .swiper-button-next,#banner .swiper-button-prev{width:56px;height:56px;background-size:14px auto} #banner .swiper-button-next{margin-left:-12px} .banner_control .banner_beat{width:56px;height:56px} .banner_control .banner_beat::before{height:84px;width:8px} } @media (max-width:990px){#banner li .imgs img{min-height:200px} #banner .swiper-pagination-bullet{width:12px;height:12px} .banner_control .banner_beat{display:none} #banner{width:100%;height:100%} #banner video{width:100%!important;height:100%!important} } @media (max-width:640px){#banner li .imgs img{min-height:180px} .banner_control{display:none} #banner .swiper-pagination-bullet{width:8px;height:8px;margin:0 5px} }
上一篇:l浏览量
下一篇:已经是最后一篇