css实现卡片列表数据分页动画效果代码
代码语言:html
所属分类:其他
代码描述:css实现卡片列表数据分页动画效果代码,新数据进入有入场渐显动画效果。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="en" > <head> <meta charset="UTF-8"> <style> body { font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif; margin: 0; overflow: hidden; } *, *:before, *:after { box-sizing: border-box; } input { display: none; opacity: 0; height: 0; width: 0; visibility: hidden; pointer-events: none; } .page-wrapper { display: flex; flex-direction: column; align-items: center; background-color: #fbfbfb; padding: 40px; height: 100vh; width: 100vw; box-shadow: 0 0 120px -50px #ff00004d inset; } .content { position: relative; background-color: #f3f3f3; height: calc(100% - 60px); width: 100%; max-width: 991px; } .page { position: absolute; display: flex; flex-wrap: wrap; top: 20px; left: 20px; height: calc(100% - 40px); width: calc(100% - 40px); } .page .item { background-color: #d7d7d7; box-shadow: 0 0 15px -12px rgb(0 0 0 / 21%), 0 0 30px -21px rgb(61 14 14 / 44%) inset; height: calc((100% - 20px) / 2); width: calc((100% - 40px) / 3); margin-right: 20px; margin-bottom: 20px; opacity: 0; pointer-events: none; z-index: 1; } .page1 .item { background-color: #d6e9d6; } .page2 .item { background-color: #e9d6d6; } .page3 .item { background-color: #d6e0e9; } .page4 .item { background-color: #e5d6e9; } .page5 .item { background-color: #e9e7d6; } .page .item.item:nth-child(3n) { margin-right: 0; } .navigation { display: flex; justify-content: center; align-items: center; position: relative; background-color: rgb(231, 231, 231); height: 60px; padding: 10px 60px; width: 100%; max-width: 991px; box-shadow: 0 0 3px -7px black inset; user-select: none; } .navigation-wrapper { display: flex; } .navigation-wrapper .nav-item div { display: flex; align-items: center; justify-content: center; color: #f3f3f3; text-shadow: 0 0 2px rgba(0, 0, 0, 0.322), 0 0 2px #000000, 0 0 2px #000000, 0 0 1px #000000, 0 0 1px #000000, 0 0 1px #000000, 0 0 1px #000000; height: 36px; width: 36px; background-color: #626fbf; border-radius: 50%; margin: 0 6px; font-weight: 600; transition: background-color 0.21s cubic-bezier(0.23, 1, 0.320, 1); } .navigation:before { content: ''; position: absolute; background-color: rgb(231, 231, 231); border-radius: 50%; height: 80px; width: 78px; left: 0; top: -10px; right: 0; margin: 0 auto; } .navigation .nav-item { position: relative; cursor: pointer; z-index: 1; } .navigation .nav-item div { transition: background-color 0.135s ease-out; } .navigation .nav-item:hover div, .navigation .arrow:hover { background-color: rgb(127, 127, 219); } .navigation .arrow { background-color: #626fbf; color: #ffffff; position: absolute; height: 60px; width: 60px; top: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; cursor: pointer; transition: background-color 0.21s cubic-bezier(0.23, 1, 0.320, 1); z-index: 1; } .navigation .arrow span { transform: scale(1, 1.82); font-weight: 600; font-size: 17px; text-shadow: 0 0 1px #000000; } .navigation .arrow label { height: 100%; width: 100%; position: absolute; cursor: pointer; left: 0; } .navigation .arrow-left { left: 0; } .navigation .arrow-right { right: 0; } #page1-input:checked ~ .page-wrapper .nav-page1 div, #page2-input:checked ~ .page-wrapper .nav-page2 div, #page3-input:checked ~ .page-wrapper .nav-page3 div, #page4-input:checked ~ .page-wrapper .nav-page4 div, #page5-input:checked ~ .page-wrapper .nav-page5 div { background-color: #38448d; transform: scale(1.06); } .blocker { position: absolute; background: red; opacity: 0.5; top: 0; left: 0; height: 100%; width: 100%; } .page .item:nth-child(1) { animation: hidePageItem1 0.86s forwards; opacity: 1; } @keyframes hidePageItem1 { 0% { transform: none } 48% { background-color: white; } 100% { transform: skew(8deg, 10deg) rotate(-40deg) translate(-80%, 150%) scale(0.12); background-color: white; opacity: 0; } } .page .item:nth-child(2) { animation: hidePageItem2 0.86s 0.09s forwards; opacity: 1; } @keyframes hidePageItem2 { 0% { transform: none } 48% { background-color: white; } 100% { transform: translate(0, 150%) scale(0.12); background-color: white; opacity: 0; } } .page .item:nth-child(3) { animation: hidePageItem3 0.86s 0.18s forwards; opacity: 1; } @keyframes hidePageItem3 { 0% { transform: none; } 48% { background-color: white; } 100% { transform: skew(-8deg, -10deg) rotate(40deg) translate(80%, 150%) scale(0.12); background-color: white; opacity: 0; } } .page .item:nth-child(4) { animation: hidePageItem4 0.86s 0.27s forwards; opacity: 1; } @keyframes hidePageItem4 { 0% { transform: none; } 48% { background-color: white; } 100% { transform: skew(8deg, 10deg) rotate(-40deg) translate(0, 75%) scale(0.12); background-color: white; opacity: 0; } } .page .item:nth-child(5) { animation: hidePageItem5 0.86s 0.36s forwards; opacity: 1; } @keyframes hidePageItem5 { 0% { transform: none; } 48% { background-color: white; } 100% { transform: translate(0, 75%) scale(0.12); background-color: white; opacity: 0; } } .page .item:nth-child(6) { animation: hidePageItem6 0.86s 0.45s forwards; opacity: 1; } @keyframes hidePageItem6 { 0% { transform: none; } 48% { background-color: white; } 100% { transform: skew(-8deg, -10deg) rotate(40deg) translate(0, 75%) scale(0.12); background-color: white; opacity: 0; } } #page1-input:checked ~ .page-wrapper .page1 .item, #page2-input:checked ~ .page-wrapper .page2 .item, #page3-input:checked ~ .page-wrapper .page3 .item, #page4-input:checked ~ .page-wrapper .page4 .item, #page5-input:checked ~ .page-wrapper .page5 .item { opacity: 0; pointer-events: initial; z-index: 0; animation: showPageItem 0.38s forwards } @keyframes showPageItem { 0% { opacity: 0; transform: translate(0, 20px); } 88% { opacity: 1; } 100% { opacity: 1; transform: translate(0, 0); } } #page1-input:checked ~ .page-wrapper .page1 .item:nth-child(1), #page2-input:checked ~ .page-wrapper .page2 .item:nth-child(1), #page3-input:checked ~ .page-wrapper .page3 .item:nth-child(1), #page4-input:checked ~ .page-wrapper .page4 .item:nth-child(1), #page5-input:checked ~ .page-wrapper .page5 .item:nth-child(1) { animation-delay: 0.45s; } #page1-input:checked ~ .page-wrappe.........完整代码请登录后点击上方下载按钮下载查看
网友评论0