gsap实现Vista风格ui卡片面板滚动设计代码

代码语言:html

所属分类:布局界面

代码描述:gsap实现Vista风格ui卡片面板滚动设计代码,结合了ScrollSmoother、MorphSVGPlugin3、ScrollTrigger插件一起实现。

代码标签: gsap Vista 风格 ui 卡片 面板 滚动 设计 代码

下面为部分代码预览,完整代码请点击下载或在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(.44,0,.63,1);
  background-image: url(//repo.bfw.wiki/bfwrepo/image/63dca8896f791.png);
  background-size: cover;
  background-attachment: fixed;
}

#smooth-wrapper {
  position: relative;
  max-width: 500px;
  height: 100%;
  width: 100%;
  margin: auto;
  overflow: auto;
  border-radius: 35px;
  box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.5);
}

#smooth-content {
  overflow-y: hidden !important;
}

.hero {
  position: relative;
  height: 40vh;
  min-height: 300px;
  color: white;
  display: flex;
}
.hero .hero-circle {
  width: 25px;
  height: 25px;
  background: #D7DCEB;
  border-radius: 50%;
  margin-left: 1rem;
  margin-top: 0.5rem;
}
.hero .hero-btn {
  overflow: visible;
  width: 50px;
}
.hero .hero-btn .hero-btn-circle {
  cursor: pointer;
  transform-origin: center center;
  transition: transform 0.4s var(--ease);
}
.hero .hero-btn:hover .hero-btn-circle {
  transform: scale(1.1);
}

h1 {
  font-size: 0.7rem;
  font-weight: 100;
  margin: 1rem 0;
  text-transform: uppercase;
}

.hero-bg {
  position: absolute;
  height: 200%;
  width: 100%;
  background-size: auto 50%;
  background-repeat: no-repeat;
  background-position: left top;
}

.hero-content {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding: 2em 1em;
  box-sizing: border-box;
}

.wave {
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 50px;
}

.hidden-wave {
  display: none;
}

.gradient {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #9398c4, rgba(147, 152, 196, 0.5) 100px, rgba(147, 152, 196, 0) 200px);
  mix-blend-mode: multiply;
  opacity: 0.8;
  z-index: 100;
  pointer-events: none;
}

.content {
  background: white;
  position: relative;
  color: var(--color-purple);
}

.content-inner {
  padding: 2em;
  max-width: 800px;
  margin: auto;
}

.label {
  position: absolute;
  top: -10px;
  display: flex;
  color: var(--color-gray);
  align-items: center;
}

.label-icon {
  border-radius: 50%;
  width: 30px;
  height: 30px;
  background: #c97984;
}

.label-text {
  font-size: 10px;
  text-transform: uppercase;
  line-height: 0.5em;
  height: 1em;
  border: 1px solid var(--color-gray);
  padding: 0.3rem 0.8rem;
  margin-left: 1em;
  border-radius: 20px;
  vertical-align: middle;
  display: flex;
  justify-content: center;
  align-items: center;
}

.title {
  margin: 2em 0;
  display: flex;
  justify-content: space-between;
  font-size: 1.5rem;
  font-weight: 400;
  text-transform: capitalize;
}

.price {
  display: flex;
  align-items: center;
}
.price::after {
  margin-left: 0.2em;
  content: "";
  display: block;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.gr.........完整代码请登录后点击上方下载按钮下载查看

网友评论0