js实现火箭上传按钮动画效果代码

代码语言:html

所属分类:表单美化

代码描述:js实现火箭上传按钮动画效果代码

代码标签: 上传 按钮 动画 效果

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


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

<head>

  <meta charset="UTF-8">
  

  <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
  
  <link rel='stylesheet' href='https://fonts.googleapis.com/css2?family=Nunito&amp;display=swap'>
  
<style>
* {
	border: 0;
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}
:root {
	--bg: #e3e4e8;
	--fg: #17181c;
	font-size: calc(20px + (40 - 20) * (100vw - 320px) / (1280 - 320));
}
body, button {
	font: 1em/1.5 Nunito, sans-serif;
}
body {
	background: var(--bg);
	color: var(--fg);
	display: grid;
	place-items: center;
	height: 100vh;
}
.upload-btn {
	--pathA: polygon(0.75em 0em,1.5em 0.45em,1.05em 0.45em,1.05em 0.9em,1.5em 0.9em,1.5em 1em,0.75em 1em,0.75em 1em,0.75em 1em,0em 1em,0em 0.9em,0.45em 0.9em,0.45em 0.45em,0em 0.45em);
	--pathB: polygon(0.75em 0em,0.975em 0.25em,0.975em 0.45em,0.975em 0.65em,1.125em 0.8em,1.125em 1em,0.9em 1em,0.75em 1em,0.6em 1em,0.375em 1em,0.375em 0.8em,0.525em 0.65em,0.525em 0.45em,0.525em 0.25em);
	--pathC: polygon(0.75em 0em,0.975em 0.25em,0.975em 0.45em,0.975em 0.65em,1.125em 0.8em,1.125em 1em,0.9em 1em,0.75em 1.5em,0.6em 1em,0.375em 1em,0.375em 0.8em,0.525em 0.65em,0.525em 0.45em,0.525em 0.25em);
	background: #255ff4;
	border-radius: 1.25em;
	color: #fff;
	cursor: pointer;
	overflow: hidden;
	padding: 0.5em 1em 0.5em 3em;
	position: relative;
	transition: all 0.1s linear;
	width: 10em;
	-webkit-tap-highlight-color: #0000;
	-webkit-appearance: none;
	appearance: none;
}
.upload-btn:disabled {
	cursor: not-allowed;
}
.upload-btn:not(:disabled):focus,
.upload-btn:not(:disabled):hover {
	background: #0b46da;
}
.upload-btn:focus {
	outline: transparent;
}
.upload-btn:before,
.upload-btn:after {
	content: "";
	display: block;
	position: absolute;
}
.upload-btn:before {
	background:
		radial-gradient(0.2em 0.2em at 1.2em 0.4em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 0.6em 0.8em,#fff 45%,#fff0 50%),
		radial-gradient(0.2em 0.2em at 0.4em 1.4em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 1em 1.3em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 0.6em 2em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 1.2em 1.9em,#fff 45%,#fff0 50%),
		radial-gradient(0.2em 0.2em at 0.9em 2.3em,#fff 45%,#fff0 50%),

		radial-gradient(0.2em 0.2em at 0.4em 2.7em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 1.2em 3.1em,#fff 45%,#fff0 50%),
		radial-gradient(0.2em 0.2em at 0.6em 3.3em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 1em 3.7em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 0.4em 4em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 1.2em 4.7em,#fff 45%,#fff0 50%),
		radial-gradient(0.2em 0.2em at 0.8em 4.4em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em at 0.3em 4.8em,#fff 45%,#fff0 50%),

		radial-gradient(0.2em 0.2em at 1.2em 5.4em,#fff 45%,#fff0 50%),
		radial-gradient(0.1em 0.1em.........完整代码请登录后点击上方下载按钮下载查看

网友评论0