gsap+three实现炫酷多彩卡片立体动画效果代码

代码语言:html

所属分类:动画

代码描述:gsap+three实现炫酷多彩卡片立体动画效果代码

代码标签: gsap three 炫酷 多彩 卡片 立体 动画

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

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

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

  
  
  
<style>
html,
body {
  overflow: hidden;
}

body {
  margin: 0;
  font-family: sans-serif;
  --color-gray: #aaa;
  --color-purple: #3e3753;
  --ease: cubic-bezier(0.44, 0, 0.63, 1);
  background-image: linear-gradient(90deg, #7b89a6, #be6173);
  background-size: cover;
  background-attachment: fixed;
  height: 100vh;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#link {
  bottom: 0;
  left: 0;
  position: fixed;
  z-index: 1000;
  padding: 0.5rem 1rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  color: white;
}
#link a {
  text-decoration: none;
  color: currentColor;
  cursor: pointer;
}
#link a:hover {
  color: #d0656f;
  cursor: pointer;
  text-decoration: none;
}
#link .ai-link {
  display: flex;
  align-items: center;
  margin: 0.5rem 0;
}
#link .ai-link svg {
  margin-right: 0.5em;
}

/**/
#smooth-wrapper {
  position: relative;
  max-width: 500px;
  height: 100%;
  width: 100%;
  max-height: 900px;
  margin: auto;
  overflow: auto;
  border-radius: 35px;
  box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.5);
  transition: background-color 1s linear;
  background-size: cover;
  z-index: 1;
  background: #3b1a23;
  color: white;
  margin: 0;
  font-family: "Open Sans", sans-serif;
}

#smooth-content {
  overflow-y: hidden !important;
  min-height: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  display: flex;
  background: linear-gradient(-45deg, #142641 50%, #d9a48a 90%);
}

* {
  user-select: none;
}

.hidden {
  display: none;
}

@media screen and (max-width: 600px), screen and (max-height: 600px) {
  #smooth-wrapper {
    height: 150% !important;
    transform-origin: center center;
    margin-top: 10%;
    transform: scale(0.5);
  }
}
canvas {
  display: block;
  position: absolute;
  top: 0;
  right: 0;
  width: 100% !important;
  max-width: 100%;
  height: auto !important;
  aspect-ratio: 0.6;
}

#app {
  position: relative;
  z-index: 1;
  padding: 20px;
  box-sizing: border-box;
  display: flex;
  width: 100%;
  height: 100%;
}

main {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-right: 40px;
}

.mid {
  flex: 1;
}

.panel {
  background: #142641;
  border-radius: 30px;
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: space-between;
  padding: 20px;
  margin: 20px 0;
}

.pills {
  align-self: flex-end;
}

.pill-container {
  margin: 30px 0;
}

.pill {
  border-radius: 50px;
  background: green;
  width: 70px;
  height: 90px;
  background: linear-gradient(-45deg, #18f4cc 0%, #0f9990 75%);
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  font-size: 1.3rem;
}

.pill-container:nth-child(2) .pill {
  background: purple;
.........完整代码请登录后点击上方下载按钮下载查看

网友评论0