You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
3.2 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>选择页面</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #283c86, #45a247); /* 深蓝到绿色的渐变 */
height: 100vh;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
color: #ffffff;
}
.container {
text-align: center;
background: rgba(50, 50, 70, 0.9); /* 更深的背景色 */
padding: 40px;
border-radius: 20px;
box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
border: 1px solid rgba(255, 255, 255, 0.2);
backdrop-filter: blur(10px); /* 增加模糊效果 */
}
#nameDisplay {
font-size: 2.5em;
margin-bottom: 30px;
text-shadow: 2px 2px 5px rgba(0, 0, 0, 0.5); /* 文字阴影 */
}
button {
padding: 15px 30px;
font-size: 1.2em;
border: none;
border-radius: 50px;
background: linear-gradient(45deg, #fc5c7d, #6a82fb); /* 渐变按钮 */
color: white;
cursor: pointer;
transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
margin: 10px;
}
button:hover {
background: linear-gradient(45deg, #e54d84, #5a72d6); /* 悬停时加深 */
transform: translateY(-3px); /* 悬停时上移效果 */
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<div class="container">
<div id="nameDisplay">欢迎, </div>
<button id="answerButton">老实回答问题</button>
<button id="lotteryButton">消耗积分抽奖</button>
</div>
<script>
// 获取URL中的参数名字
const urlParams = new URLSearchParams(window.location.search);
const name = urlParams.get('student_name');
const id = urlParams.get('student_id');
// 显示被抽中的名字
const nameDisplay = document.querySelector('#nameDisplay');
nameDisplay.textContent = ` ${name} 你的选择是:`;
// 回答问题功能,跳转到回答问题页面
document.querySelector('#answerButton').addEventListener('click', () => {
window.location.href = `answer.html?student_name=${encodeURIComponent(name)}&student_id=${encodeURIComponent(id)}`;
});
// 抽奖功能,跳转到抽奖页面
document.querySelector('#lotteryButton').addEventListener('click', () => {
window.location.href = `lottery.html?student_name=${encodeURIComponent(name)}&student_id=${encodeURIComponent(id)}`;
});
</script>
</body>
</html>