83 lines
2.5 KiB
HTML
83 lines
2.5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>提交URL</title>
|
|
<!-- 引入Material Design Lite CSS -->
|
|
<link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/material-design-lite/1.3.0/material.indigo-pink.min.css">
|
|
<!-- 引入Material Design Lite组件的JavaScript -->
|
|
<script src="https://cdn.bootcdn.net/ajax/libs/material-design-lite/1.3.0/material.min.js"></script>
|
|
<style>
|
|
.page-content {
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 80vh;
|
|
flex-direction: column;
|
|
}
|
|
.submit-form {
|
|
margin: 20px;
|
|
}
|
|
.footer {
|
|
text-align: center;
|
|
padding: 20px;
|
|
position: fixed;
|
|
left: 0;
|
|
bottom: 0;
|
|
width: 100%;
|
|
background-color: #f5f5f5;
|
|
color: #888;
|
|
}
|
|
/* Mix color button design */
|
|
.mdl-button--colored {
|
|
background: linear-gradient(45deg, #2196F3 30%, #21CBF3 90%);
|
|
color: white;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="page-content">
|
|
<h1>提交URL</h1>
|
|
<div class="submit-form">
|
|
<form action="/submitUrl" method="post" id="urlForm">
|
|
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
|
|
<input class="mdl-textfield__input" type="text" id="urlInput" name="url">
|
|
<label class="mdl-textfield__label" for="urlInput">请输入URL</label>
|
|
</div>
|
|
<button type="submit" class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--colored">
|
|
提交
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="footer">
|
|
Copyright 2024 Powered By 方一力
|
|
</div>
|
|
|
|
<script>
|
|
document.getElementById('urlForm').onsubmit = function(event) {
|
|
event.preventDefault();
|
|
var url = document.getElementById('urlInput').value;
|
|
fetch('/submitUrl', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json',
|
|
},
|
|
body: JSON.stringify({ url: url }),
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
console.log('Success:', data);
|
|
})
|
|
.catch((error) => {
|
|
console.error('Error:', error);
|
|
});
|
|
};
|
|
</script>
|
|
|
|
</body>
|
|
</html>
|