<!DOCTYPE html>
<html>
<head>
	<title>蛋学传教组织查分系统 - 查询你的分数</title>
	<style>
		@keyframes egg {
			0% {
				transform: scale(1);
				opacity: 1;
			}
			50% {
				transform: scale(0.8);
				opacity: 0.5;
			}
			100% {
				transform: scale(1);
				opacity: 1;
			}
		}
		body {
			margin: 0;
			padding: 0;
			background-color: #f3f3f3;
			font-family: Arial, sans-serif;
		}
		.container {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: center;
			height: 100vh;
		}
		.egg {
			width: 100px;
			height: 100px;
			background-image: url('https://cdn.pixabay.com/photo/2015/12/08/15/29/egg-1086904_960_720.png');
			background-size: cover;
			animation: egg 2s ease-in-out;
		}
		h1 {
			text-align: center;
			margin-top: 50px;
		}
		form {
			display: flex;
			flex-direction: column;
			align-items: center;
			margin-top: 50px;
		}
		label {
			font-size: 20px;
			margin-bottom: 10px;
		}
		input[type='text'] {
			padding: 10px;
			font-size: 16px;
			border: none;
			border-radius: 5px;
			box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
			margin-bottom: 20px;
		}
		button {
			padding: 10px 20px;
			font-size: 16px;
			background-color: #4CAF50;
			color: #fff;
			border: none;
			border-radius: 5px;
			box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
			cursor: pointer;
			transition: all 0.2s ease-in-out;
		}
		button:hover {
			transform: scale(1.05);
			background-color: #3e8e41;
		}
		.result {
			margin-top: 20px;
			text-align: center;
		}
		.result p {
			font-size: 24px;
			margin-bottom: 10px;
		}
		.error {
			color: red;
			font-size: 18px;
		}
	</style>
</head>
<body>
	<div class='container'>
		<div class='egg'></div>
		<h1>蛋学传教组织查分系统</h1>
		<form>
			<label for='name'>请输入姓名:</label>
			<input type='text' id='name' name='name'>
			<button type='button' onclick='checkScore()'>查询</button>
		</form>
		<div class='result' id='result'></div>
	</div>
	<script>
		function checkScore() {
			// 获取输入的姓名
			var name = document.getElementById('name').value;
			// 读取分数数据
			fetch('分数.csv')
				.then(response => response.text())
				.then(data => {
					// 将分数数据转为二维数组
					var scores = data.split('
').map(row => row.split(','));
					// 查找姓名对应的分数
					var found = false;
					for (var i = 0; i < scores.length; i++) {
						if (scores[i][0] === name) {
							found = true;
							var writtenScore = scores[i][1];
							var interviewScore = scores[i][2];
							// 显示分数
							document.getElementById('result').innerHTML = '<p>笔试分数:' + writtenScore + '</p><p>面试分数:' + interviewScore + '</p>';
							break;
						}
					}
					// 显示错误提示
					if (!found) {
						document.getElementById('result').innerHTML = '<p class='error'>没有学生:' + name + '</p>';
					}
				});
		}
	</script>
</body>
</html>
蛋学传教组织查分系统 - 查询你的分数

原文地址: https://www.cveoy.top/t/topic/oqpr 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录