使用css3制作3d图集

使用了一些转换器生成gif,忽略水印。

  • html
<main>
    <ul>
      <li><img src="https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1596272321&di=8654a0aaa39f3df06f07f321e69116cf&src=http://a3.att.hudong.com/14/75/01300000164186121366756803686.jpg" alt=""></li>
      <li><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1596283366542&di=5faec52636f30416e12eff3d0b5759d8&imgtype=0&src=http%3A%2F%2Fa3.att.hudong.com%2F55%2F22%2F20300000929429130630222900050.jpg" alt=""></li>
      <li><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1596283366540&di=39ef9f22b97c9d725822880a99820b99&imgtype=0&src=http%3A%2F%2Fbjimg.focus.cn%2Fupload%2Fphotos%2F128%2F8BYzSdXP.gif" alt=""></li>
      <li><img src="https://ss1.bdstatic.com/70cFvXSh_Q1YnxGkpoWK1HF6hhy/it/u=894586452,1799351005&fm=26&gp=0.jpg" alt=""></li>
      <li><img src="https://ss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=1900883959,1006465321&fm=26&gp=0.jpg" alt=""></li>
      <li><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1596283366548&di=201889959ac4a213953870eedd30da06&imgtype=0&src=http%3A%2F%2Fa1.att.hudong.com%2F62%2F02%2F01300542526392139955025309984.jpg" alt=""></li>

    </ul>
  </main>
  • css

main{
  width: 400px;
  height: 400px;
  cursor: pointer;
}
main ul{
  padding: 0;
  margin: 0;
  list-style: none;
  position: relative;
  transform-style: preserve-3d;
  transform: perspective(600px);
  transform-origin: center -100px -150px;
  transition: all 2s linear;
}
main:hover ul{
  transform: perspective(600px) rotateY(360deg);
}

ul li{
  position: absolute;
  top: 120px;
  left: 150px;
  width: 100px;
  height: 100px;
  background: #986;
  color: #fff;
  font-size: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  transform-style: preserve-3d;
  transform-origin: center center -150px;
  overflow: hidden;
}
div{
  width: 100px;
  height: 100px;
  overflow: hidden;
}
img{
  width: 100%;
  height: 100%;
  object-fit: cover;
}
ul li:nth-of-type(1){
  transform: rotateY(60deg);
}
ul li:nth-of-type(2){
  transform: rotateY(120deg);
}
ul li:nth-of-type(3){
  transform: rotateY(180deg);
}
ul li:nth-of-type(4){
  transform: rotateY(240deg);
}
ul li:nth-of-type(5){
  transform: rotateY(300deg);
}
ul li:nth-of-type(6){
  transform: rotateY(360deg);
}



 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值