当前位置: 首页 > news >正文

炫酷HTML蜘蛛侠登录页面

全篇使用HTML、CSS、JavaScript,建议有过基础的进行阅读。 

一、预览图

二、HTML代码

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>蜘蛛侠登录界面</title><link rel="stylesheet" href="styles.css">
</head>
<body><div class="center-container"><div class="login-container"><div class="spiderman-logo"><img src="logo.png" alt="Spider-Man Logo"></div><h2>欢迎回家</h2><form class="login-form"><div class="input-group"><label for="username">用户名</label><input type="text" id="username" placeholder="输入你的用户名"></div><div class="input-group"><label for="password">密码</label><input type="password" id="password" placeholder="输入你的密码"></div><button type="submit">登录</button></form></div></div><canvas id="spider-web"></canvas><script src="script.js"></script>
</body>
</html>

三、CSS代码

* {margin: 0;padding: 0;box-sizing: border-box;
}body {font-family: Arial, sans-serif;background-color: #0A0A2A;display: flex;justify-content: center;align-items: center;height: 100vh;overflow: hidden;position: relative;color: white;
}.center-container {display: flex;justify-content: center;align-items: center;z-index: 2;position: relative;
}.login-container {background: linear-gradient(145deg, #c8102e, #0a0a2a);padding: 40px;border-radius: 15px;box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);text-align: center;width: 300px;z-index: 2;
}.spiderman-logo img {width: 50px;height: 60px;margin-bottom: 5px;
}/* Form styles */
.login-form {display: flex;flex-direction: column;
}.input-group {margin-bottom: 20px;
}.input-group label {margin-bottom: 8px;font-size: 14px;float: left;
}.input-group input {width: 100%;padding: 10px;border: none;border-radius: 5px;background-color: #ffffff;color: black;font-size: 16px;
}button {padding: 10px 20px;border: none;background-color: #ff4c4c;color: white;font-size: 18px;border-radius: 5px;cursor: pointer;transition: background-color 0.3s ease;
}button:hover {background-color: #ff1c1c;
}#spider-web {position: absolute;top: 50%;left: 50%;transform: translate(-50%, -50%);z-index: 1;width: 100vw;height: 100vh;
}

四、JavaScript代码

const canvas = document.getElementById('spider-web');
const ctx = canvas.getContext('2d');canvas.width = window.innerWidth;
canvas.height = window.innerHeight;function drawWeb() {const centerX = canvas.width / 2;const centerY = canvas.height / 2;const radiusStep = 30;const radialStep = 10;const rings = 10;const lines = 12;for (let i = 1; i <= rings; i++) {ctx.beginPath();ctx.arc(centerX, centerY, radiusStep * i, 0, Math.PI * 2);ctx.strokeStyle = 'white';ctx.lineWidth = 1;ctx.stroke();}for (let i = 0; i < lines; i++) {const angle = (i / lines) * Math.PI * 2;const x = centerX + Math.cos(angle) * radiusStep * rings;const y = centerY + Math.sin(angle) * radiusStep * rings;ctx.beginPath();ctx.moveTo(centerX, centerY);ctx.lineTo(x, y);ctx.strokeStyle = 'white';ctx.lineWidth = 1;ctx.stroke();}for (let i = 1; i < rings; i++) {for (let j = 0; j < lines; j++) {const angle1 = (j / lines) * Math.PI * 2;const angle2 = ((j + 1) / lines) * Math.PI * 2;const x1 = centerX + Math.cos(angle1) * radiusStep * i;const y1 = centerY + Math.sin(angle1) * radiusStep * i;const x2 = centerX + Math.cos(angle2) * radiusStep * i;const y2 = centerY + Math.sin(angle2) * radiusStep * i;ctx.beginPath();ctx.moveTo(x1, y1);ctx.lineTo(x2, y2);ctx.strokeStyle = 'white';ctx.lineWidth = 1;ctx.stroke();}}
}drawWeb();

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 裸金属服务器与云服务器的区别有哪些?
  • vue3路由基本使用
  • leetcode练习 子集II
  • uni-app实现web-view和App之间的相互通信
  • 思维训练900
  • windows系统安装docker
  • PostgreSQL - tutorial
  • TCP Analysis Flags 之 TCP ZeroWindow
  • 原型模式详细介绍和代码实现
  • 人工智能浪潮下,程序员如何锻造不可替代的核心竞争力?
  • Remix 学习 - @remix-run/react 中的主要组件
  • Maven 常见问题以及常用命令
  • 熵权法详细讲解+Python代码实现
  • RNN股票预测(Pytorch版)
  • 【AI视频】复刻抖音爆款AI数字人作品初体验
  • [微信小程序] 使用ES6特性Class后出现编译异常
  • create-react-app项目添加less配置
  • es6要点
  • Mocha测试初探
  • SegmentFault 社区上线小程序开发频道,助力小程序开发者生态
  • sessionStorage和localStorage
  • SOFAMosn配置模型
  • webpack入门学习手记(二)
  • 记录:CentOS7.2配置LNMP环境记录
  • mysql面试题分组并合并列
  • ​DB-Engines 11月数据库排名:PostgreSQL坐稳同期涨幅榜冠军宝座
  • ​LeetCode解法汇总2304. 网格中的最小路径代价
  • !!java web学习笔记(一到五)
  • # Redis 入门到精通(九)-- 主从复制(1)
  • #NOIP 2014# day.1 T3 飞扬的小鸟 bird
  • (06)金属布线——为半导体注入生命的连接
  • (07)Hive——窗口函数详解
  • (C语言)编写程序将一个4×4的数组进行顺时针旋转90度后输出。
  • (react踩过的坑)antd 如何同时获取一个select 的value和 label值
  • (Spark3.2.0)Spark SQL 初探: 使用大数据分析2000万KF数据
  • (第30天)二叉树阶段总结
  • (九十四)函数和二维数组
  • (六)Hibernate的二级缓存
  • (免费分享)基于springboot,vue疗养中心管理系统
  • (一)为什么要选择C++
  • (译)计算距离、方位和更多经纬度之间的点
  • .apk 成为历史!
  • .NET Windows:删除文件夹后立即判断,有可能依然存在
  • .NET/C#⾯试题汇总系列:⾯向对象
  • .net访问oracle数据库性能问题
  • .NET连接MongoDB数据库实例教程
  • @angular/cli项目构建--http(2)
  • @Resource和@Autowired的区别
  • @selector(..)警告提示
  • [2544]最短路 (两种算法)(HDU)
  • [AIGC] MySQL存储引擎详解
  • [BUG] Hadoop-3.3.4集群yarn管理页面子队列不显示任务
  • [C#]winform基于opencvsharp结合Diffusion-Low-Light算法实现低光图像增强黑暗图片变亮变清晰
  • [c++] 自写 MyString 类
  • [C++][opencv]基于opencv实现photoshop算法图像剪切