乐于分享
好东西不私藏

很酷的科技感登录页面HTML!!附源码!!

很酷的科技感登录页面HTML!!附源码!!

  效果展示  

  完整源码  

HTML
<!DOCTYPE html><htmllang="en"><head>	<metaname="viewport"content="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">	<metacharset="UTF-8">	<title>登录页</title>	<linkhref="css/style.css"rel="stylesheet"></head><body>	<divclass="loginav">		<divclass="video"><videosrc="images/video.mp4"mutedautoplayloop></div>		<divclass=""></div>		<divclass="loginbox boxall">			<divclass="logo">				<h1>智能科技平台登录页</h1>				<h2>zhi neng ke ji ping tai</h2>				<!-- <img src="images/logo.png"> -->			</div>			<divclass="logintit">用户登录</div>			<ulclass="logininput">				<li>					<i><imgsrc="images/user.png"></i>					<inputclass="forminput"value=""type="text"placeholder="用户名">				</li>				<li>					<i><imgsrc="images/password.png"></i>					<inputclass="forminput"type="password"value=""placeholder="密码">				</li>				<divclass=" flex1"style="padding: 15px 0;">					<label> <inputtype="checkbox"checkedclass="aui-checkbox">&nbsp;记住密码</label>					<ahref="#"class="text-primary"> 忘记密码?</a>				</div>				<li>					<ahref="#"class="btn btnblock btn-lg btn-block btn-primary">登录</a>				</li>			</ul>			<divclass="boxfoot"></div>		</div>	</div>	<divclass="copyright">版权所有:All Right By <ahref="http://www.bootstrapmb.com">Reserved</a> 2022-2022</div>	<canvasid='canvas'		style="position:fixed; width:100%; height:100%; left: 0; top: 0; opacity: .3; pointer-events: none;"></canvas>	<script>		var canvas = document.querySelector('canvas');		var ctx = canvas.getContext('2d');		var w = window.innerWidth;//获取屏幕宽高		var h = window.innerHeight * 2 / 2;		canvas.width = w;//将屏幕宽高赋值给canvas		canvas.height = h;		// canvas.style.cssText += `;width:${w}px;height:${h}px;`;		var dots = [];		var minScale = 1;//设置圆点的最小缩放		var maxScale = 3;//设置圆点的最大缩放		var bei = 1;		for (var i = 0; i < 300; i += 1) {  //设置白圆点的个数			dots.push(new Dot())		}		render = () => {			ctx.clearRect(00, w, h);			ctx.fillStyle = 'rgba(26,94,199,.6)';			ctx.fillRect(00, w, h);//描绘底层蓝色背景			for (var i = 0; i < dots.length; i += 1) {				var dot = dots[i];				dot.update();				dot.paint();			}			requestAnimationFrame(render)		}		render();		function Dot() {			this.radius = Math.floor(Math.random() * 3 + 2);//在选一个随机数为圆点半径			this.d = Math.random() * 2 * Math.PI;//在0-2π之间随机一个弧度值			this.rx = Math.random() * w * (Math.random() > 0.6 ? 2 / 3 : 1 / 4);// 选一个随机数,作为椭圆长轴顶点a的数值,也就是椭圆中心的x轴坐标,此处的x,y,是相对于椭圆圆心为中心点建立的直角坐标系。			this.ry = Math.random() * h - h / 2;//选一个随机数作为椭圆短轴顶点b的数值,也就是椭圆中心的y轴坐标,此处的x,y,是相对于椭圆圆心为中心点建立的直角坐标系。这两个值可以根据自已需求来定。			this.x = Math.cos(this.d) * this.rx + w / 2;			this.y = Math.sin(this.d) * this.ry + h / 2;//根据椭圆x,y求值公式,x=a*cosα,y=a*sinα.求出圆点在椭圆上的x,y轴坐标.后面加w/2,h/2只是为了居中显示。此处的x,y是相对于canvas建立的直角坐标系的,按canvas约定,其中心点(0,0)点在左上角			this.z = (Math.pow(Math.pow(this.rx2) + Math.pow(this.ry2), 0.5) / Math.pow(Math.pow(w / 22) + Math.pow(h / 22), 0.5))//求白色圆点离椭圆中心点的距离,可视为一个点到圆心的距离,用x平方+y平方=c平方求得。此处的x,y,是相对于椭圆圆心为中心点建立的直角坐标系。此处Z值只是一个比值			this.scale = (Math.cos(this.d) + 1) * (maxScale - minScale) / 2 + minScale;//圆点的缩放大小,根据余弦函数公式y=cosα.标准的余弦函数最大值和最小值分别为1,-1.这里要自行设置最大值和最小值,所以要进行改写			// this.speed = Math.random() * 0.0005 + 0.0005;			this.speed = Math.random() * 0.0004 + 0.0004;//圆点运动的速度			this.alpha = this.scale / maxScale * 0.3 + 0.1;//圆点运动的透明度			this.count = 0;			this.paint = () => {				ctx.fillStyle = 'rgba(0,130,255,' + this.alpha + ')';				ctx.beginPath();				ctx.arc(this.xthis.ythis.radius * this.scale * this.z0Math.PI * 2);				ctx.fill();			}			this.update = () => {				this.count += 0.01;				if (Math.floor(this.count) % 12 === 0 && Math.floor(this.count) != 0) {					this.d += 0.008;					if (this.count > Math.floor(this.count) + 0.5) {						this.d -= 0.008;					}					console.log(this.count)				}				this.x = Math.sin(this.d) * this.rx + w / 2;				this.y = Math.cos(this.d) * this.ry + h / 2;				this.d -= this.speed;//通过改变它的弧度值来改变圆点在椭圆中运动				this.scale = (Math.cos(this.d) + 1) * (maxScale - minScale) / 2 + minScale;				this.alpha = this.scale / maxScale * 0.3 + 0.1;			}		}	</script></body></html>
style.css
*{ padding0margin0box-sizing: border-box; user-select: none;}li{list-style-type: none;}a{text-decoration: none; color#fff;}html{background#000height100%;}bodybackground#000max-width1920pxmargin0 auto; height100%position: relative;  font-family"PingFang SC","Lantinghei SC","Microsoft YaHei","HanHei SC","Helvetica Neue","Open Sans",Arial,"Hiragino Sans GB","微软雅黑",STHeiti,"WenQuanYi Micro Hei",SimSun,sans-serif;}body::beforeposition: absolute; width100%height100%backgroundurl(../images/bg.png) no-repeat left center; content""left0top0z-index100pointer-events: none;}  .loginbg{background-image:linear-gradient(300deg,#004491,#1e88e5);position:absolute;width:100%;height:50%;left:0;top:0;z-index:0}  .loginav{max-width1300pxwidth100%height100%margin:0 auto;z-index:10;box-shadow:0 0 30px rgba(0,0,0,.1); display: flex; align-items: center;  justify-content: space-between;}  .videoposition: absolute;width1200pxleft0pxpadding-bottom40pxpointer-events: none;}  .video video{width100%;}  .video::beforeposition: absolute; content""width200pxheight100%background#000right0top0;}  .logotit{text-align:center;padding:40px 0;font-size:30px}  .loginbox{padding:30px 0 50px 0width600pxpadding:30px 50pxflex-shrink0position: relative; z-index100;}  .logininput .forminput{border:2px solid rgba(32,163,245,.4);    font-family"PingFang SC","Lantinghei SC","Microsoft YaHei","HanHei SC","Helvetica Neue","Open Sans",Arial,"Hiragino Sans GB","微软雅黑",STHeiti,"WenQuanYi Micro Hei",SimSun,sans-serif;    display:block; padding-left:50px;font-size:18px;color:#fff;width:100%;line-height:48px;outline:0;text-indent:1pxbackgroundrgba(32,163,245,.1);}  input::input-placeholder{color:  #fff;}   ::-webkit-input-placeholder {  color#fff;   }   .flex1display: flex; justify-content: space-between; align-items: center;} .flex1 label{color#fffdisplay: flex; align-items: center;}  .logininput>li{display:block;padding:15px 0;position:relative;}  .logininput li>iposition: absolute; height100%left15pxtop0display: flex; align-items: center;}  .logintit{color:#00bff4;text-align:center;position:relative;padding:25px 0;font-size:24px}  .btn-primary{background:#20a3f5display: block; text-align: center; color#fffline-height48PXfont-size24px;}  .btn-primary:hover{background:#137bd6}  .copyright{position:fixed;width:100%;left:0;bottom:10px;text-align:center;color:#006b95;font-size:12px}  .logoposition: absolute; top: -120pxwidth100%left0;  text-align: center; color#fff;}  .logo h1,  .logo h2{    backgroundlinear-gradient90deg,#009ef3#00e9d0);    background-size: cover;    -webkit-background-clip: text;    background-clip: text;    -webkit-text-fill-color: transparent;    text-fill-color: transparent;  }  .logo h1font-weight: bolder; font-size48pxfont-family"Microsoft YaHei","HanHei SC";  letter-spacing2px;}  .logo h2font-size30pxtext-transform: uppercase; font-weight: lighter; letter-spacing2px;}  .boxallborder2px solid #186bafbackgroundrgba(32,163,245,.1); position: relative; transformscale(.7); opacity0;  animation: shows 1s forwards;}  @keyframes shows  {      to {transformscale(1); opacity1;}  }  .boxall:before,.boxall:afterposition:absolute; width:30pxheight:30pxcontent"";  border-top3px solid #20a3f5top: -2px;}.boxall:before,.boxfoot:before{border-left3px solid #20a3f5;left:-2px;}.boxall:after,.boxfoot:after{border-right3px solid #20a3f5right: -2px;}.boxfootposition:absolute; bottom0width100%left:0;}.boxfoot:before,.boxfoot:afterposition:absolute; width:30pxheight:30px;  content"";border-bottom:3px solid #20a3f5bottom:-2px;}.aui-checkbox,input[type=radio]{width:24px;height:24px;backgroundrgba(32,163,245,.1);border:solid 2px rgba(32,163,245,.5);margin:0;padding:0;position:relative;cursor:default;-webkit-appearance:none;-webkit-user-select:none;user-select:none;-webkit-transition:background-color ease .1s;transition:background-color ease .1sflex-shrink0border-radius0;}.aui-checkbox,input[type=radio]{margin:0 3px 0 0 !important;position:relative;}.aui-checkbox:checked,input[type=radio]:checked{text-align:center;background-clip:padding-box;}.aui-checkbox:checked:after,.aui-checkbox:checked:before,input[type=radio]:checked:after,input[type=radio]:checked:before{content:'';width:10px;height:5px;position:absolute;top:50%;left:50%;margin-left:-6px;margin-top:-5px;background:0 0;border:2px solid #439aff;border-top:none;border-right:none;z-index:2;-webkit-border-radius:0;border-radius:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.aui-checkbox:disabled,input[type=radio]:disabled{background-color:#f5f5f;border:solid 1px #ddd}.aui-checkbox:disabled:after,.aui-checkbox:disabled:before,input[type=radio]:disabled:after,input[type=radio]:disabled:before{content:'';width:.5rem;height:.3rem;position:absolute;top:50%;left:50%;margin-left:-.25rem;margin-top:-.4rem;background:0 0;border:1px solid #fff;border-top:none;border-right:none;z-index:2;-webkit-border-radius:0;border-radius:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}input[type="radio"]border-radius20px;}input{outline: none!important;}@media (max-width1200px) {  .loginav{justify-content: center;}  .video{display: none;}  .loginbox{width96%;}  .logo h1{font-size30px;}  .logo h2{font-size20px;}  .loginbox{padding30px;}}