swiper实现图文九宫格图文切换幻灯片效果代码
代码语言:html
所属分类:幻灯片
代码描述:swiper实现图文九宫格图文切换幻灯片效果代码,带有入场动画效果。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <link type="text/css" rel="stylesheet" href="//repo.bfw.wiki/bfwrepo/css/swiper-bundle.11.0.4.css"> <style> @import url("https://fonts.googleapis.com/css2?family=Courgette&family=Montserrat:wght@300;400;500;600;700&display=swap"); *, *::before, *::after { padding: 0; margin: 0; box-sizing: border-box; } body { display: flex; align-items: center; justify-content: center; font-size: 14px; color: #000; min-height: 100vh; background-image: linear-gradient( 120deg, rgba(7, 7, 9, 1) 16%, rgba(27, 24, 113, 1) 96% ); background-repeat: no-repeat; } #particles-js { position: absolute; width: 100%; height: 100%; background-color: transparent; background-repeat: no-repeat; background-size: cover; background-position: 50% 50%; z-index: -1; } .swiper { width: 100%; height: 100%; } .swiper-slide { position: relative; display: grid; grid-template-columns: 45% 50%; place-items: center; gap: 40px; overflow: hidden; padding: 130px 60px; } .content { padding: 0 50px; font-family: "Montserrat", sans-serif; } .content h1 { font-family: "Courgette", cursive; font-size: clamp(2.3rem, 5vw, 4rem); line-height: 1.3; margin-bottom: 30px; color: #f6af61; pointer-events: none; } .content p { font-family: inherit; font-size: clamp(1.1rem, 5vw, 0.9rem); font-weight: 400; line-height: 1.5; margin-bottom: 30px; color: #bababb; text-align: justify; pointer-events: none; } .swiper-slide .content h1 { transform: translateY(-40px); opacity: 0; transition-duration: 1s; transition-delay: 0.6s; } .swiper-slide .content p { transform: translateY(-30px); opacity: 0; transition-duration: 1s; transition-delay: 1.2s; } .swiper-slide-active .content h1, .swiper-slide-active .content p { transform: none; opacity: 1; } .image-container { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); gap: 5px; } .item { max-width: 200px; aspect-ratio: 4/3; border-radius: 6px; pointer-events: none; opacity: 0; } .swiper-slide-active .item { animation: fadeIn 0.5s linear 1 forwards; animation-delay: calc(1.4s + (0.15s * var(--i))); } @keyframes fadeIn { 0% { opacity: 0; transform: scale(0); } 100% { opacity: 1; transform: scale(1); } } /* BUTTON */ .btn { max-width: max-content; padding: 1rem 2rem; border-radius: 0.5rem; border: none; font-size: 1rem; font-weight: 400; color: #f4f0ff; text-align: center; backdrop-filter: blur(10px); cursor: pointer; } .btn::before, .btn::after { content: ""; display: block; position: absolute; left: 0; top: 0; height: 100%; width: 1.........完整代码请登录后点击上方下载按钮下载查看
网友评论0