ScrollTrigger+gsap实现ipad视觉差异滚动图片相册效果代码

代码语言:html

所属分类:视觉差异

代码描述:ScrollTrigger+gsap实现ipad视觉差异滚动图片相册效果代码

代码标签: ScrollTrigger gsap ipad 视觉差异 滚动 图片 相册

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开

<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  

  
  
<style>
* {
  margin: 0;
}

a {
  position: absolute;
  font-size: 10px;
  color: gray;
  left: 320px;
  bottom: 5px;
  text-decoration: none;
}

#wrapper {
  background-color: black;
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, sans-serif;
  perspective: 1200px;
}

#ipad {
  transform: rotate3d(1, 0, 0, 30deg);
}

#ipad-border {
  height: min-content;
  width: min-content;
  padding: 2px;
  border-radius: 24px;
  background: linear-gradient(131deg, #8a8a8a 0%, hsl(0, 0%, 41%) 100%);
}

#ipad-bezel {
  background: #222222;
  border-radius: inherit;
  box-shadow: 0 0 #0000004d, 0 9px 20px #0000004a, 0 37px 37px #00000042,
    0 84px 50px #00000026, 0 149px 60px #0000000a, 0 233px 65px #00000003;
  padding: 18px;
}

#screen {
  width: 700px;
  aspect-ratio: 4/3;
  background-color: black;
  border-radius: 8px;
  padding: 12px;
  overflow: hidden;
}

#images {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.col {
  width: 100%;
  height: 180px;
  overflow: hidden;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: 200ms;
}

.col:hover {
  scale: 1.03;
}

/* --------------- IMAGES --------------- */

.col:nth-child(17n) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6323c19e047f5.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 1) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6323c1b87acb3.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 2) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/632984d601276.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 3) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/634529e7a97fc.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 4) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6348d34ae66ed.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 5) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/634f719141624.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 6) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/637467e803d75.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 7) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/637467fb4d3d9.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 8) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6374680372999.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 9) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6385803fb4bcb.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 10) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/6385bc55f359d.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 11) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/639522144435c.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 12) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/63b80b5516338.png?x-oss-process=image/auto-orient,1/resize,m_fill,w_200,h_300,/quality,q_90);
}

.col:nth-child(17n + 13) {
  background-image: url(//repo.bfw.wiki/bfwrepo/image/63b80bbd5450f.png?x-os.........完整代码请登录后点击上方下载按钮下载查看

网友评论0