画册图片褶皱效果

codepen 地址

https://codepen.io/lynnandtonic/pen/PoZpjOr

使用

<div class="container">

  <img src="https://assets.codepen.io/1025350/schitts-creek.png" alt="the cast of Schitt’s Creek" />

  <div class="poster">
    <img src="https://assets.codepen.io/1025350/schitts-creek.png" alt="the cast of Schitt’s Creek" />
  </div>

  <img src="https://assets.codepen.io/1025350/newfoundglory.png" alt="New Found Glory tour poster: 20 years of pop punk" />

  <div class="poster">
    <img src="https://assets.codepen.io/1025350/newfoundglory.png" alt="New Found Glory tour poster: 20 years of pop punk" />
  </div>

  <img src="https://assets.codepen.io/1025350/paper-heart.png" alt="movie poster for Charlyne Yi’s Paper Heart" />

  <div class="poster">
    <img src="https://assets.codepen.io/1025350/paper-heart.png" alt="movie poster for Charlyne Yi’s Paper Heart" />
  </div>

</div>

 

样式

.poster
  width: 300px
  padding: 7%
  position: relative
  box-sizing: border-box
  background-color: white
  box-shadow: 0 3px 12px alpha(black,.2)
  filter: saturate(70%) contrast(85%)
  
  img
    width: 100%
    display: block
    z-index: 1
  
  &:before,
  &:after
    content: ''
    width: 100%
    left: 0
    position: absolute
  
  &:before
    height: 4%
    bottom: -4%
    background-repeat: no-repeat
    background-image: linear-gradient(177deg,  alpha(black,.22) 10%, transparent 50%),
                      linear-gradient(-177deg, alpha(black,.22) 10%, transparent 50%)
    background-size: 49% 100%
    background-position: 2% 0,
                         98% 0

  &:after
    height: 100%
    top: 0
    z-index: 2
    background-repeat: no-repeat
    background-image: linear-gradient(to right, alpha(white,.1) .5%, alpha(black,.15) 1.2%, transparent 1.2%),
                      linear-gradient(to bottom, alpha(white,.1) .5%, alpha(black,.15) 1.2%, transparent 1.2%),
                      linear-gradient(to bottom, alpha(white,.1) .5%, alpha(black,.15) 1.2%, transparent 1.2%),
                      linear-gradient(265deg,  alpha(black,.2), transparent 10%),
                      linear-gradient(5deg,   alpha(black,.2), transparent 15%),
                      linear-gradient(-5deg,   alpha(black,.1.6), transparent 10%),
                      linear-gradient(5deg,   alpha(black,.1.6), transparent 10%),
                      linear-gradient(-265deg,  alpha(black,.2), transparent 10%),
                      linear-gradient(-5deg,   alpha(black,.2), transparent 15%),
                      linear-gradient(266deg,  alpha(black,.2), transparent 10%)
    background-size: 50% 100%,
                     100% 33.3333%,
                     100% 33.3333%,
                     50% 33.3333%,
                     50% 33.3333%,
                     50% 33.3333%,
                     50% 33.3333%,
                     50% 33.3333%,
                     50% 33.3333%,
                     50% 33.3333%
    background-position: right top,
                         left center,
                         left bottom,
                         left  top,
                         left  top,
                         right top,
                         left  center,
                         right center,
                         right center,
                         left  bottom

body
  background-color: lightsalmon
  padding: 60px 20px
  
.container
  width: 650px
  display: grid
  grid-template-columns: 1fr 1fr
  align-items: center
  justify-items: center
  gap: 60px 30px
  margin: 0 auto

  > img
    width: 250px

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值