swiper实现图片卡片堆叠拖拽切换更换效果代码
代码语言:html
所属分类:拖放
代码描述:swiper实现图片卡片堆叠拖拽切换更换效果代码,带有动态漂浮背景,左侧显示文字,右侧图片可拖拽更换。
代码标签: 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.8.4.7.css"> <style> @import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300;400;500;600;700&family=Poppins:wght@300;400;500;600;700;800&display=swap'); *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Comfortaa', cursive; } section { position: relative; display: flex; justify-content: center; align-items: center; background: #262626; min-height: 100vh; overflow: hidden; } .content { display: flex; flex-direction: row; justify-content: center; align-items: center; gap: 30px; background: linear-gradient( 180deg, rgba(255, 255, 255, 0.28) 0%, rgba(255, 255, 255, 0) 100% ); backdrop-filter: blur(30px); border-radius: 20px; width: min(900px, 100%); box-shadow: 0 0.5px 0 1px rgba(255, 255, 255, 0.23) inset, 0 1px 0 0 rgba(255, 255, 255, 0.66) inset, 0 4px 16px rgba(0, 0, 0, 0.12); z-index: 10; } .info { display:flex; flex-direction: column; justify-content: center; align-items: center; max-width: 450px; padding: 0 35px; text-align: justify; } .info p{ color: #fff; font-weight: 500; font-size: 1rem; margin-bottom: 20px; line-height: 1.5; } .movie-night { background: linear-gradient(225deg, #ff3cac 0%, #784ba0 50%, #2b86c5 100%); } .btn { display: block; padding: 10px 40px; margin: 10px auto; font-size: 1.1rem; font-weight: 700; border-radius: 4px; border: none; outline: none; text-decoration: none; color: #784ba0; background: rgba(255, 255, 255, 0.9); box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1); border: 1px solid rgba(255, 255, 255, 0.3); cursor: pointer; } .btn:hover, .btn:focus, .btn:active, .btn:visited { transition-timing-function: cubic-bezier(0.6, 4, 0.3, 0.8); animation: gelatine 0.5s 1; } @keyframes gelatine { 0%, 100% { transform: scale(1, 1); } 25% { transform: scale(0.9, 1.1); } 50% { transform: scale(1.1, 0.9); } 75% { transform: scale(0.95, 1.05); } } /* SWIPER */ .swiper { width: 250px; height: 450px; padding: 50px 0; } .swiper-slide { position: relative; box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2); border-radius: 10px; } .swiper-slide span { position: absolute; top: 0; right: 0; color: #fff; padding: 7px 18px; margin: 10px; border-radius: 20px; letter-spacing: 2px; font-size: 0.8rem; font-weight: 700; font-family: inherit; background: rgba(255, 255, 255, 0.095); box-shadow: inset 2.01px -2.01px 20px rgba(214, 214, 214, 0.17), inset -3.01333px 3.01333px 3.01333px rgba(255, 255, 255, 0.39); backdrop-filter: blur(74px); } .swiper-slide h2 { position: absolute; bottom: 0; left: 0; color: #fff; font-weight: 400; font-size: 1.1rem; line-height: 1.4; margin: 0 0 20px 20px; } .swiper-slide:nth-child(1n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url(//repo.bfw.wiki/bfwrepo/image/61c837d449c88.png) no-repeat 50% 50% / cover; } .swiper-slide:nth-child(2n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/6454c4ca0d59b.png") no-repeat 50% 50% / cover; } .swiper-slide:nth-child(3n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/6454c4e71fb2f.png") no-repeat 50% 0% / cover; } .swiper-slide:nth-child(4n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/5fc1af0ba6cc8.png") no-repeat 50% 50% / cover; } .swiper-slide:nth-child(5n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/5fc1afe38993c.png") no-repeat 50% 50% / cover; } .swiper-slide:nth-child(6n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/5fe1bc8e0ed82.png") no-repeat 50% 50% / cover; } .swiper-slide:nth-child(7n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/5fe1bcbdf1b79.png") no-repeat 50% 50% / cover; } .swiper-slide:nth-child(8n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/5fe1bd1861604.png") no-repeat 50% 0% / cover; } .swiper-slide:nth-child(9n) { background: linear-gradient(to top, #0f2027, #203a4300, #2c536400), url("//repo.bfw.wiki/bfwrepo/image/6454c4fd64064.png") no-repeat 50% 50% / cover; } /* ANIMATED BACKGROUND */ .circles{ position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; } .circles li{ position: absolute; display: block; .........完整代码请登录后点击上方下载按钮下载查看
网友评论0