TweenMax+Physics2DPlugin实现炫酷拖放文件上传粒子带进度效果代码

代码语言:html

所属分类:上传

代码描述:TweenMax+Physics2DPlugin实现炫酷拖放文件上传粒子带进度效果代码

代码标签: TweenMax Physics2DPlugin 炫酷 拖放 文件 上传 粒子 进度

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

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

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




  <link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Roboto:400,500,700&amp;display=swap'>
  
<style>
:root {
  --primary: #5628EE;
  --success: #41D071;
  --grey-light: #99A3BA;
  --grey: #6C7486;
  --grey-dark: #3F4656;
  --light: #CDD9ED;
  --lighter: #E4ECFA;
  --shadow: rgba(18, 22, 33, .1);
}

.drop {
  --r: 0rad;
  width: 380px;
  height: 420px;
  background: #fff;
  border-radius: 6px;
  box-shadow: 0 4px 24px -2px var(--shadow);
  position: relative;
}
.drop nav {
  border-bottom: 1px solid var(--lighter);
  display: flex;
  align-items: center;
  padding: 0 16px;
}
.drop nav > svg {
  display: block;
  margin-right: 16px;
  width: 20px;
  height: 20px;
  color: var(--grey-light);
}
.drop nav ul {
  display: flex;
}
.drop nav ul:last-child {
  margin-left: auto;
}
.drop nav ul li {
  margin-bottom: -1px;
}
.drop nav ul li:not(:last-child) {
  margin-right: 16px;
}
.drop nav ul li a {
  display: block;
  font-weight: 500;
  font-size: 12px;
  line-height: 21px;
  color: var(--grey-light);
  text-decoration: none;
  padding: 12px 0 11px 0;
  border-bottom: 1px solid transparent;
}
.drop nav ul li a svg {
  width: 21px;
  height: 21px;
  display: block;
}
.drop nav ul li.active a {
  color: var(--primary);
  border-color: var(--primary);
}
.drop .center {
  --y: 52px;
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 6;
  transition: transform 0.3s ease;
  transform: translate(-50%, var(--y));
}
.drop .center > div {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  height: 43px;
  width: 120px;
  background: var(--primary);
  border-radius: 5px;
  transition: width 0.2s ease, height 0.2s ease, border-radius 0.2s ease, opacity 0.4s ease;
  pointer-events: none;
}
.drop .center > div span,
.drop .center > div .circle, .drop .center > div > svg {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: block;
}
.drop .center > div span, .drop .center > div > svg {
  color: #fff;
  transition: opacity 0.2s ease;
}
.drop .center > div span {
  font-weight: 500;
  font-size: 16px;
}
.drop .center > div > svg {
  width: 32px;
  height: 32px;
  opacity: 0;
}
.drop .center > div .circle {
  opacity: 0;
}
.drop .center > div .circle svg {
  width: 92px;
  height: 92px;
  color: var(--primary);
  display: block;
  transform: rotate(var(--r));
}
.drop .intro,
.drop .hint {
  --y: -76px;
  color: var(--grey);
  font-size: 14px;
  line-height: 23px;
  text-align: center;
  width: 100%;
  max-width: 220px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, var(--y));
  transition: opacity 0.2s ease, transform 0.4s ease;
  pointer-events: none;
}
.drop .intro h4,
.drop .hint h4 {
  margin-bottom: 8px;
  color: var(--grey-dark);
  font-family: inherit;
  font-weight: 500;
  font-size: 20px;
}
.drop .intro p,
.drop .hint p {
  margin: 0;
}
.drop .hint {
  --y: 80px;
  opacity: 0;
}
.drop ul {
  padding: 0;
  margin: 0;
  list-style: none;
}
.drop ul.list li {
  --y: 8px;
  padding: 16px;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(var(--y));
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.drop ul.list li:not(:first-child) {
  border-top: 1px solid var(--lighter);
}
.drop ul.list li:nth-child(1) {
  transition-delay: 0.24s;
}
.drop ul.list li:nth-child(2) {
  transition-delay: 0.32s;
}
.drop ul.list li:nth-child(3) {
  transition-delay: 0.4s;
}
.drop ul.list li:nth-child(4) {
  transition-delay: 0.48s;
}
.drop ul.list li:nth-child(5) {
  transition-delay: 0.56s;
}
.drop ul.list li img {
  border-radius: 5px;
  width: 84px;
  height: 48px;
  -o-object-fit: cover;
     object-fit: cover;
  margin-right: 12px;
  box-shadow: 0 4px 12px var(--shadow);
}
.drop ul.list li .text strong {
  display: block;
  font-size: 16px;
  font-weight: 500;
  color: var(--grey-dark);
  margin-bottom: 4px;
}
.drop ul.list li .text small {
  display: block;
  color: var(--grey-light);
  font-size: 14px;
}
.drop ul.list li .progress {
  margin-left: auto;
  border-radius: 50%;
  backgroun.........完整代码请登录后点击上方下载按钮下载查看

网友评论0