.upload {
position: relative;
width: 400px;
min-height: 445px;
box-sizing: border-box;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
padding-bottom: 20px;
background: #fff;
-webkit-animation: fadeup .5s .5s ease both;
animation: fadeup .5s .5s ease both;
-webkit-transform: translateY(20px);
transform: translateY(20px);
opacity: 0;
}
.upload .upload-files header {
background: #4db6ac;
text-align: center;
}
.upload .upload-files header p {
color: #fff;
font-size: 30px;
margin: 0;
padding: 50px 0;
}
.upload .upload-files header p i {
-webkit-transform: translateY(20px);
transform: translateY(20px);
opacity: 0;
font-size: 30px;
-webkit-animation: fadeup .5s 1s ease both;
animation: fadeup .5s 1s ease both;
}
.upload .upload-files header p .up {
/*font-weight: bold;*/
-webkit-transform: translateX(-20px);
transform: translateX(-20px);
display: inline-block;
opacity: 0;
-webkit-animation: faderight .5s 1.5s ease both;
animation: faderight .5s 1.5s ease both;
}
.upload .upload-files header p .load {
display: inline-block;
font-weight: 100;
/*margin-left: -8px;*/
-webkit-transform: translateX(-20px);
transform: translateX(-20px);
opacity: 0;
-webkit-animation: faderight 1s 1.5s ease both;
animation: faderight 1s 1.5s ease both;
}
.upload .upload-files .body {
text-align: center;
padding: 50px 0;
padding-bottom: 30px;
}
.upload .upload-files .body.hidden {
display: none;
}
.upload .upload-files .body input {
visibility: hidden;
}
.upload .upload-files .body i {
font-size: 65px;
color: lightgray;
}
.upload .upload-files .body p {
font-size: 14px;
padding-top: 15px;
line-height: 1.6;
}
.upload .upload-files .body p b,
.upload .upload-files .body p a {
color: #4db6ac;
text-decoration: none;
}
.upload .upload-files .body.active {
border: dashed 2px #4db6ac;
}
.upload .upload-files .body.active i {
box-shadow: 0 0 0 -3px #fff, 0 0 0 lightgray, 0 0 0 -3px #fff, 0 0 0 lightgray;
-webkit-animation: file .5s ease both;
animation: file .5s ease both;
}
@-webkit-keyframes file {
50% {
box-shadow: -8px 8px 0 -3px #fff, -8px 8px 0 lightgray, -8px 8px 0 -3px #fff, -8px 8px 0 lightgray;
}
75%,
100% {
box-shadow: -8px 8px 0 -3px #fff, -8px 8px 0 lightgray, -16px 16px 0 -3px #fff, -16px 16px 0 lightgray;
}
}
@keyframes file {
50% {
box-shadow: -8px 8px 0 -3px #fff, -8px 8px 0 lightgray, -8px 8px 0 -3px #fff, -8px 8px 0 lightgray;
}
75%,
100% {
box-shadow: -8px 8px 0 -3px #fff, -8px 8px 0 lightgray, -16px 16px 0 -3px #fff, -16px 16px 0 lightgray;
}
} <div class="upload">
<div class="upload-files">
<header>
<p>
<i class="fa fa-cloud-upload" aria-hidden="true"></i>
<span class="up"></span>
<span class="load">文件上传</span>
</p>
</header>
<div class="body" id="drop">
<i class="fa fa-file-text-o pointer-none" aria-hidden="true"></i>
<p class="pointer-none"><b>拖放文件到这里</b><br> 或 <a href="" id="triggerFile">点此选择文件</a></p>
<input type="file" multiple="multiple" />
</div>
<footer>
<div class="divider">
<span><AR>文件列表</AR></span>
</div>
<div class="list-files">
<!-- template -->
</div>
<button class="importar">继续上传</button>
</footer>
</div>
</div> // trigger input
$("#triggerFile").addEventListener("click", evt => {
evt.preventDefault();
$("input[type=file]").click();
});
// drop events
$("#drop").ondragleave = evt => {
$("#drop").classList.remove("active");
evt.preventDefault();
};
$("#drop").ondragover = $("#drop").ondragenter = evt => {
$("#drop").classList.add("active");
evt.preventDefault();
};
$("#drop").ondrop = evt => {
$("input[type=file]").files = evt.dataTransfer.files;
$("footer").classList.add("hasFiles");
$("#drop").classList.remove("active");
evt.preventDefault();
};
//upload more
$(".importar").addEventListener("click", () => {
$(".list-files").innerHTML = "";
$("footer").classList.remove("hasFiles");
$(".importar").classList.remove("active");
setTimeout(() => {
$("#drop").classList.remove("hidden");
}, 500);
});
// input change
$("input[type=file]").addEventListener("change", handleFileSelect);
*
回帖描述:*
链接类型:*
下载链接:*
描述:*
回帖描述:*
链接类型:*
阅读权限:*
下载链接:



聚优部落技术论坛 © 版权所有 鲁ICP备15007479号-6
Copyright(C)web.com, All Rights Reserved.
