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.

135 lines
3.8 KiB

<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>课堂点名系统</title>
<script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
<style>
.joinbutton {
border-radius: 15px;
}
body {
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 20px;
display: flex;
flex-direction: column;
align-items: center; /* 垂直居中 */
justify-content: center; /* 水平居中 */
height: 90vh; /* 使 body 高度占满视口 */
}
h1 {
color: #333;
margin-bottom: 20px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
margin-bottom: 10px;
padding: 10px;
border: 2px solid #007BFF;
border-radius: 20px;
width: 250px;
top
}
button {
background-color: #020202;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
margin: 5px;
transition: background-color 0.3s;
}
button:hover {
background-color: #0056b3;
}
#result {
margin-top: 100px;
padding: 10px;
background: white;
border: 1px solid #ddd;
border-radius: 5px;
width: 500px;
text-align: center;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.modal {
position: fixed;
z-index: 1; /* 在最上层 */
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5); /* 半透明黑色背景 */
}
.modal-content {
background-color: #fff;
margin: 15% auto;
padding: 40px;
border: 1px solid #888;
width: 40%; /* 可以根据需要调整宽度 */
}
</style>
</head>
<body>
<div id="app">
<h1>课堂点名系统</h1>
<input type="text" placeholder="请输入房间号..." />
<div> <button class="joinbutton" @click="tanchuang">加入(创建)房间</button> </div>
<!-- 模态框 -->
<div class="modal" v-if="isModalVisible">
<div class="modal-content">
<span @click="closeModal" style="cursor:pointer; float:right;">&times;</span>
<h1>当前房间号没有被创建是否创建房间</h1>
<button @click="goToAboutPage">确认创建房间</button>
</div>
</div>
<!-- 结束模态框 -->
</div>
</div>
<script>
new Vue({
el: '#app',
data: {
isModalVisible:false,
isModalVisible2:false
},
methods: {
goToAboutPage() {
window.location.href = 'index.html'; // 跳转到 index.html
},
handleFileUpload(event) {
// 这里可以添加处理文件上传的逻辑
},
tanchuang()
{
this.isModalVisible = true;
},
uploadFile() {
// 调用外部的 uploadFile 函数
uploadFile();
},
closeModal() {
this.isModalVisible = false; // 关闭模态框
}
}
});
</script>
</body>
</html>