gsap实现图片拖动上传动画效果代码

代码语言:html

所属分类:上传

代码描述:gsap实现图片拖动上传动画效果代码

代码标签: 拖动 上传 动画 效果

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


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

<head>

  <meta charset="UTF-8">

  
  
<style>
@import url("https://fonts.googleapis.com/css?family=Nunito:400,600,700&display=swap");
* {
  box-sizing: border-box;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

body {
  background-image: linear-gradient(102.7deg, #fddaff 8.2%, #dfadfc 19.6%, #adcdfc 36.8%, #adfcf4 73.2%, #caf8d0 90.9%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: cover;
  font-family: "Nunito", sans-serif;
  color: #4f555f;
  display: flex;
  flex-direction: column;
  padding: 20px;
  height: 100vh;
  overflow: hidden;
}

.droppable {
  max-width: 400px;
  width: 100%;
  height: 360px;
  background-color: #fff;
  margin: auto;
  display: flex;
  flex-wrap: wrap;
  position: relative;
  border-radius: 12px;
  align-content: flex-start;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
  transition: 0.3s;
}

.droppable.is-dragging .list > * {
  pointer-events: none;
}

.list {
  overflow: auto;
  width: 100%;
  height: 100%;
  padding: 10px 0;
  scroll-behavior: smooth;
}

.droppable.is-over {
  box-shadow: 0px 10px 26px rgba(30, 24, 37, 0.33), 0 0 0px 15px rgba(53, 40, 66, 0.07);
}

.item {
  padding: 10px 20px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  overflow: hidden;
}

.item > * {
  opacity: 0;
}

.item-img {
  width: 60px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
}

.loaded-image {
  position: absolute;
  top: 0;
  transform-origin: center;
  left: 0;
  opacity: 0;
  width: 60px;
  height: 48px;
  border-radius: 4px;
  overflow: hidden;
  background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
}

.loaded-image > img {
  opacity: 0;
  filter: blur(10px);
}

.loaded-image > span {
  position: absolute;
  left: 50%;
  opacity: 0;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  transform-origin: center;
  top: 50%;
}

.loaded-image svg {
  width: 32px;
  height: 32px;
}

img {
  -o-object-fit: cover;
     object-fit: cover;
  -o-object-position: center;
     object-position: center;
  width: 100%;
  height: 100%;
}

img:before {
  position: absolute;
  content: "";
  height: 100%;
  width: 100%;
  background-image: linear-gradient(120deg, #e0c3fc 0%, #8ec5fc 100%);
}

.item-details {
  flex: 1;
  padding-left: 16px;
  overflow: hidden;
  padding-right: 32px;
}

.item-name {
  font-size: 15px;
  margin-bottom: 4px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-weight: 600;
}

.item-size {
  font-size: 11px;
  letter-spacing: 1px;
  color: #9699b3;
}

.item-delete {
  border: 0;
  background-color: transparent;
  width: 18px;
  height: 18px;
  padding: 0;
  margin-right: 6px;
  color: transparent;
  white-space: nowrap;
  outline: 0;
  cursor: pointer;
  position: relative;
}

.item-delete:before {
  content: "";
  position: absolute;
  left: 0;
  transition: 0.3s;
  top: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg fill='%23bac1cb' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 438.5 438.5'%3e%3cpath d='M417.7 75.7A8.9 8.9 0 00411 73H323l-20-47.7c-2.8-7-8-13-15.4-18S272.5 0 264.9 0h-91.3C166 0 158.5 2.5 151 7.4c-7.4 5-12.5 11-15.4 18l-20 47.7H27.4a9 9 0 00-6.6 2.6 9 9 0 00-2.5 6.5v18.3c0 2.7.8 4.8 2.5 6.6a8.9 8.9 0 006.6 2.5h27.4v271.8c0 15.8 4.5 29.3 13.4 40.4a40.2 40.2 0 0032.3 16.7H.........完整代码请登录后点击上方下载按钮下载查看

网友评论0