css+div实现手风琴鼠标悬浮伸缩波浪式图片相册列表效果代码
代码语言:html
所属分类:画廊相册
代码描述:css+div实现手风琴鼠标悬浮伸缩波浪式图片相册列表效果代码,点击可展开图片。
代码标签: css div 手风琴 鼠标 悬浮 伸缩 波浪 图片 相册 列表
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html> <html lang="zh"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> * { margin: 0; padding: 0; box-sizing: border-box; } :root{ --index: calc(1vw + 1vh); --transition: cubic-bezier(.1, .7, 0, 1); } body{ background-color: #141414; } .wrapper{ display: flex; align-items: center; justify-content: center; height: 80vh; } .items{ display: flex; gap: 0.4rem; perspective: calc(var(--index) * 35); } .item{ width: calc(var(--index) * 3); height: calc(var(--index) * 12); background-color: #222; background-size: cover; background-position: center; cursor: pointer; filter: grayscale(1) brightness(.5); transition: transform 1.25s var(--transition), filter 3s var(--transition), width 1.25s var(--transition); will-change: transform, filter, rotateY, width; } .item::before, .item::after{ content: ''; position: absolute; height: 100%; width: 20px; right: calc(var(--index) * -1); } .item::after{ left: calc(var(--index) * -1); } .items .item:hover{ filter: inherit; transform: translateZ(calc(var(--index) * 10)); } /*Right*/ .items .item:hover + *{ filter: inherit; transform: translateZ(calc(var(--index) * 8.5)) rotateY(35deg); z-index: -1; } .items .item:hover + * + *{ filter: inherit; transform: translateZ(calc(var(--index) * 5.6)) rotateY(40deg); z-index: -2; } .items .item:hover + * + * + *{ filter: inherit; transform: translateZ(calc(var(--index) * 2.5)) rotateY(30deg); z-index: -3; } .items .item:hover + * + * + * + *{ filter: inherit; transform: translateZ(calc(var(--index) * .6)) rotateY(15deg); z-index: -4; } /*Left*/ .items .item:has( + :hover){ filter: inherit; transform: translateZ(calc(var(--index) * 8.5)) rotateY(-35deg); } .items .item:has( + * + :hover){ filter: inherit; transform: translateZ(calc(var(--index) * 5.6)) rotateY(-40deg); } .items .item:has( + * + * + :hover){ .........完整代码请登录后点击上方下载按钮下载查看
网友评论0