html表格账号密码备忘录:表格内容将通过JavaScript动态生成。点击查看密码10秒关闭

news2024/9/24 1:27:33

 

<!DOCTYPE html>
<html lang="zh-CN">

<head>
	<meta charset="UTF-8">
	<title>账号密码备忘录</title>
	<style>
		body {
			background: #2c3e50;
			text-shadow: 1px 1px 1px #100000;
		}

		/* 首页样式开始 */
		.home_page {
			color: #ffffffa4;
			text-shadow: 1px 1px 1px #100000;
			border: 1px solid #4CAF50;
			font-size: 20px;
			padding: 2px 5px;
			border-radius: 5px;
			text-decoration: none;
			/* 粗体 */
			font-weight: bold;
			cursor: pointer;
			/* 往上移动一点 */
			position: relative;
			top: -4px;

			&:hover {
				background-color: #e4f904;
				color: rgb(245, 5, 5);
			}
		}

		/* 首页样式结束 */
		/* 关闭按钮样式 */
		#closeBtn {
			color: #d6d301;
			font-weight: bold;
			cursor: pointer;
			margin-left: 400px;
			background-color: #839aa17d;
			border: none;
			border-radius: 5px;
			padding: 5px 10px;
			position: relative;
			top: -4px;

			img {
				width: 30px;
				cursor: pointer;
			}

			&:hover {
				background: #ffd000;
			}
		}

		/* 关闭按钮样式结束 */
		table {
			border-collapse: collapse;
			width: 100%;

			tr:nth-child(odd) {
				background-color: #144756;
			}

			th,
			td {
				border: 1px solid rgba(255, 255, 255, 0.532);
				padding: 8px;
				text-align: center;
			}

			th {
				color: #ebf704;
				background-color: #555;
			}

			td {
				color: hsla(160, 100%, 37%, 0.63);
			}

			/* 第6个元素左对齐 */
			details,
			th:nth-child(6) {
				text-align: left;
			}

			button {
				color: hsla(0, 0%, 100%, 0.63);
				background-color: #55555582;
				text-shadow: 1px 1px 1px #100000;
				border: 0;
				font-size: 18px;
			}

			span {
				color: #ff0000;
			}

			.center {
				text-align: center;
			}

			input {
				/* 设置字体大小 */
				font-size: 20px;
				/* 表格边框 */
				border: 0px solid black;
				background-color: rgba(220, 0, 0, 1);
				color: rgb(255, 213, 0);
				text-shadow: 1px 1px 1px #000;
				border-radius: 10px;
				box-shadow:
					inset 4px 4px 4px rgba(255, 255, 255, 0.6),
					inset -4px -4px 5px rgba(0, 0, 0, 0.6);
				background-image: linear-gradient(to top left,
						rgba(0, 0, 0, 0.2),
						rgba(0, 0, 0, 0.2) 30%,
						rgba(0, 0, 0, 0));
			}
		}
	</style>
</head>

<body>
	<a href="file:///D:/web/html首页/备忘录.html" class="home_page">首页</a> <button id="closeBtn" type="button"><img
			src="file:///D:/img/关闭.svg" alt="关闭" onclick="closeAll()"> </button>
	<!-- accountTable账号列表 -->
	<table id="accountTable">
		<tr>
			<th width="50">序号</th>
			<th width="50">网数</th>
			<th width="110">网站</th>
			<th width="230">账号</th>
			<th width="200">密码</th>
			<th width="1000">备注 (点击查看详情)</th>
		</tr>
		<!-- 数据行将通过JavaScript动态生成 -->
	</table>
	<script>
		const data = [
			{
				website: "QQ",
				accounts: [
					{ account: "newAccount1", password: "newPassword1", note: "新备注1" },
					{ account: "newAccount2", password: "newPassword2", note: "新备注2" },
				]
			},
			{
				website: "微信",
				accounts: [
					{ account: "newAccount3", password: "newPassword3", note: "新备注3" }
				]
			},
			{
				website: "Steam",
				accounts: [
					{ account: "newAccount4", password: "newPassword4", note: "新备注4" }
				]
			},
			{
				website: "12123",
				accounts: [
					{ account: "newAccount5", password: "newPassword5", note: "新备注5" }
				]
			},
			{
				website: "WeGame",
				accounts: [
					{ account: "newAccount6", password: "newPassword6", note: "新备注6" }
				]
			},
			{
				website: "csdn博客",
				accounts: [
					{ account: "newAccount7", password: "newPassword7", note: "新备注7" }
				]
			},
			{
				website: "原神",
				accounts: [
					{ account: "newAccount8", password: "newPassword8", note: "新备注8" }
				]
			},
			{
				website: "gitee",
				accounts: [
					{ account: "newAccount9", password: "newPassword9", note: "新备注9" }
				]
			},
			{
				website: "Microsoft",
				accounts: [
					{ account: "newAccount10", password: "newPassword10", note: "新备注10" }
				]
			},
			{
				website: "网易",
				accounts: [
					{ account: "newAccount11", password: "newPassword11", note: "新备注11" },
					{ account: "newAccount12", password: "newPassword12", note: "新备注12" },
					{ account: "newAccount13", password: "newPassword13", note: "新备注13" },
					{ account: "newAccount14", password: "newPassword14", note: "新备注14" },
					{ account: "newAccount15", password: "newPassword15", note: "新备注15" },
					{ account: "newAccount16", password: "newPassword16", note: "新备注16" },
				]
			},
			{
				website: "哔哩哔哩",
				accounts: [
					{ account: "newAccount17", password: "newPassword17", note: "新备注17" },
					{ account: "newAccount18", password: "newPassword18", note: "新备注18" }
				]
			}
		];
		// 去重处理
		function removeDuplicates(data) {
			return data.map(item => {
				const uniqueAccounts = [];
				const accountSet = new Set();
				item.accounts.forEach(account => {
					const accountKey = `${item.website}-${account.account}-${account.password}`;
					if (!accountSet.has(accountKey)) {
						accountSet.add(accountKey);
						uniqueAccounts.push(account);
					}
				});
				return {
					...item,
					accounts: uniqueAccounts
				};
			});
		}
		const uniqueData = removeDuplicates(data);
		// console.log(JSON.stringify(uniqueData, null, 2));
		const table = document.getElementById('accountTable'); // 获取表格元素
		if (table) {
			let rowIndex = 1;
			let lastWebsite = null;
			let websiteRowSpan = 1;
			uniqueData.forEach((item, index) => { // 遍历数据
				item.accounts.forEach((account, accountIndex) => {
					const row = table.insertRow(); // 创建行
					row.insertCell().textContent = rowIndex++; // 账号序号
					row.insertCell().textContent = index + 1 + '-' + (item.accounts.indexOf(account) + 1); // 网站序号+账号序号
					const websiteCell = row.insertCell(); // 创建网站单元格
					if (item.website !== lastWebsite) {
						websiteCell.textContent = item.website; // 网站
						websiteCell.rowSpan = item.accounts.length; // 设置rowSpan
						websiteCell.classList.add('center'); // 居中
						lastWebsite = item.website;
					} else {
						websiteCell.remove(); // 移除重复的网站单元格
					}
					row.insertCell().textContent = account.account; // 账号
					const passwordCell = row.insertCell(); // 创建密码单元格
					const passwordButton = document.createElement('button'); // 创建按钮元素
					passwordButton.textContent = '查看密码'; // 按钮文本
					passwordButton.onclick = () => {
						// 检查passwordCell中是否已经存在input元素
						if (!passwordCell.querySelector('input')) {
							const passwordInput = document.createElement('input');
							// passwordInput.type = 'password';// 密码输入框类型为密码,看不见
							passwordInput.value = account.password;
							passwordCell.appendChild(passwordInput);
							// 创建倒计时显示元素
							const countdownElement = document.createElement('span');
							countdownElement.textContent = '10';
							passwordCell.appendChild(countdownElement);
							// 设置倒计时
							let countdown = 10;
							const countdownInterval = setInterval(() => {
								countdown--;
								countdownElement.textContent = countdown.toString();
								if (countdown <= 0) {
									clearInterval(countdownInterval);
									passwordCell.removeChild(passwordInput);
									passwordCell.removeChild(countdownElement);
								}
							}, 1000); // 每秒更新一次
						}
					};
					passwordCell.appendChild(passwordButton); // 密码单元格添加按钮元素
					const noteCell = row.insertCell(); // 创建备注单元格
					// noteCell.textContent = account.note; // 直接显示备注			
					noteCell.innerHTML = `<details>${account.note}</details>`; // 点击查看备注			
				});
			});
		} else {
			console.error('表格元素未找到');
			alert('表格元素未找到,请检查页面结构。');
		}
		// 关闭当前窗口
		function closeAll() {
			window.close();
		}
	</script>
</body>

</html>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1924637.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Qt:22.鼠标相关事件(实例演示——鼠标进入/离开某控件的事件、鼠标按下事件、鼠标释放事件、鼠标双击事件)

目录 1.实例演示——鼠标进入/离开某控件的事件&#xff1a; 2.鼠标按下事件&#xff1a; 3.鼠标释放事件&#xff1a; 4.鼠标双击事件&#xff1a; 1.实例演示——鼠标进入/离开某控件的事件&#xff1a; 首先创建一个C类文件 Label&#xff0c;填写好要继承的父类 QLabe…

【ARM】使用JasperGold和Cadence IFV科普

#工作记录# 原本希望使用CCI自带的验证脚本来验证修改过后的address map decoder&#xff0c;但是发现需要使用JasperGold或者Cadence家的IFV的工具&#xff0c;我们公司没有&#xff0c;只能搜搜资料做一下科普了解&#xff0c;希望以后能用到吧。这个虽然跟ARM没啥关系不过在…

HarmonyOS NEXT:一次开发,多端部署

寄语 这几年特别火的uni-app实现了“一次开发&#xff0c;多端使用”&#xff0c;它这个端指的是ios、安卓、各种小程序这些&#xff0c;而HarmonyOS NEXT也提出了“一次开发&#xff0c;多端部署”&#xff0c;而它这个端指的是终端设备&#xff0c;也就是我们的手机、平板、电…

基于大语言模型(LLM)的合成数据生成、策展和评估的综述

节前&#xff0c;我们星球组织了一场算法岗技术&面试讨论会&#xff0c;邀请了一些互联网大厂朋友、参加社招和校招面试的同学。 针对算法岗技术趋势、大模型落地项目经验分享、新手如何入门算法岗、该如何准备、面试常考点分享等热门话题进行了深入的讨论。 合集&#x…

【Mongodb-04】Mongodb聚合管道操作基本功能

Mongodb系列整体栏目 内容链接地址【一】Mongodb亿级数据性能测试和压测https://zhenghuisheng.blog.csdn.net/article/details/139505973【二】springboot整合Mongodb(详解)https://zhenghuisheng.blog.csdn.net/article/details/139704356【三】亿级数据从mysql迁移到mongodb…

【Mac】App Cleaner Uninstaller(Mac应用清理和卸载)及同类型软件介绍

今天给大家介绍的软件是App Cleaner & Uninstaller&#xff0c;这是一款mac应用清理和卸载软件&#xff0c;还会介绍同类型的其他几款软件&#xff0c;大家可以选择自己适合的来使用。 App Cleaner & Uninstaller软件介绍 App Cleaner & Uninstaller 是一款专门用…

《知识点扫盲 · 学会 WebService》

&#x1f4e2; 大家好&#xff0c;我是 【战神刘玉栋】&#xff0c;有10多年的研发经验&#xff0c;致力于前后端技术栈的知识沉淀和传播。 &#x1f497; &#x1f33b; CSDN入驻不久&#xff0c;希望大家多多支持&#xff0c;后续会继续提升文章质量&#xff0c;绝不滥竽充数…

《斯科特·凯尔比的风光摄影手册》读书笔记

写在前面 《斯科特凯尔比的风光摄影手册》读书笔记整理没有全部读完&#xff0c;选择了感兴趣的章节理解不足小伙伴帮忙指正 &#x1f603;,生活加油 99%的焦虑都来自于虚度时间和没有好好做事&#xff0c;所以唯一的解决办法就是行动起来&#xff0c;认真做完事情&#xff0c;…

NLP之词的重要性

文章目录 何为重要词TF*IDFTF*IDF其他版本TFIDF 算法特点TF*IDF的优势TF*IDF劣势 TF*IDF的应用搜索引擎文本摘要文本相似度计算 上一篇文章介绍了新词的发现&#xff0c;用内部凝固度和左右熵来发现新词。这时候机器对一篇文章有了对词的一定理解&#xff0c;这时我们让机器上升…

云服务器重置密码后,xshell远程连接不上,重新启用密码登录方式

云服务器重置密码后 &#xff0c;xshell连接出现不能使用密码登录 解决方案&#xff1a;以下来自阿里云重新启用密码登录方式帮助文档 为轻量应用服务器创建密钥且重启服务器使密钥生效后&#xff0c;服务器会自动禁止使用root用户及密码登录。如果您需要重新启用密码登录方式&…

【python】基于决策树的语音识别

目录 引言 决策树的主要特点 决策树的构建过程 决策树的应用 数据集 代码实现 引言 决策树&#xff08;Decision Tree&#xff09;是一种常用的分类与回归方法&#xff0c;其中最为人所知的是其在分类问题上的应用。决策树模型呈树形结构&#xff0c;其中每个内部节点表…

centos7|Linux操作系统|编译最新的OpenSSL-3.3,制作rpm安装包

一、 为什么需要编译rpm包 通常&#xff0c;我们需要安装某个软件&#xff0c;尤其是在centos7这样的操作系统&#xff0c;一般是通过yum包管理器来安装软件&#xff0c;yum的作用是管理rpm包的依赖关系&#xff0c;自动的处理rpm包的安装顺序&#xff0c;安装依赖等的相关问…

【数智化案例展】沃太能源——MES系统建设引领智能制造新篇章

‍ 联想集团案例 本项目案例由联想集团投递并参与数据猿与上海大数据联盟联合推出的《2024中国数智化转型升级创新服务企业》榜单/奖项评选。 大数据产业创新服务媒体 ——聚焦数据 改变商业 沃太能源股份有限公司&#xff0c;一家在储能产品及智慧能源管理方案领域享有盛誉的…

对B-树的理解

目录 前言-为什么要使用B-树&#xff1f;B-树概念 前言-为什么要使用B-树&#xff1f; 首先&#xff0c;我们正常的搜索都有一下方式&#xff1a; 搜索二叉树&#xff0c;极端场景下会退化&#xff0c;类似于单支&#xff0c;此时的效率变成了O(N)&#xff1b;为了解决1的问题…

基于微信小程序的音乐播放平台

基于微信小程序的音乐播放平台 音乐播放小程序项目简介技术栈功能模块项目流程系统E-R图项目页面 音乐播放小程序 项目简介 微信音乐小程序旨在提供一个简洁高效的音乐播放平台&#xff0c;用户可以方便地搜索、播放和收藏自己喜欢的音乐。整个项目采用前后端分离的架构&…

Rust 测试的组织结构

测试的组织结构 本章一开始就提到&#xff0c;测试是一个复杂的概念&#xff0c;而且不同的开发者也采用不同的技术和组织。Rust 社区倾向于根据测试的两个主要分类来考虑问题&#xff1a;单元测试&#xff08;unit tests&#xff09;与 集成测试&#xff08;integration test…

基于3D感知的端到端具身操作论文导读

DexIL&#xff1a;面向双臂灵巧手柔性操作的端到端具身执行模型 模型架构 输入&#xff1a;   观测Ot&#xff1a; RGB点云&#xff0c;使用PointNet进行编码;   状态St&#xff1a; 双臂末端7x2Dof位姿16x2灵巧手关节位置&#xff0c;只进行归一化&#xff0c;无编码&am…

在word中删除endnote参考文献之间的空行

如图&#xff0c;在References中&#xff0c;每个文献之间都有空行。不建议手动删除。打开Endnote。 打开style manager 删除layout中的换行符。保存&#xff0c;在word中更新参考文献即可。

InjectFix 热更新解决方案

简介 今天来谈一谈&#xff0c;项目种的客户端热更新解决方案。InjectFix是腾讯xlua团队出品的一种用于Unity中C#代码热更新热修复的解决方案。支持Unity全系列&#xff0c;全平台。与xlua的思路类似&#xff0c;InjectFix解决的痛点主要在于Unity中C#代码写的逻辑在发包之后无…

复杂设备操作流程3D数字化全景展示好处多

传统的纸质说明书&#xff0c;尽管承载着产品的使用指南&#xff0c;但其图文平面的表现形式往往限制了表现力和说明力。对于简单产品&#xff0c;用户或许能摸索使用;但对于复杂产品&#xff0c;即使拥有详实的说明书&#xff0c;也可能因理解困难而导致使用障碍。现在&#x…