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.
79 lines
1.8 KiB
79 lines
1.8 KiB
<!DOCTYPE html>
|
|
<html lang="zh-CN">
|
|
<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/marked/marked.min.js"></script>
|
|
<style>
|
|
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
body {
|
|
margin: 0;
|
|
padding: 24px 16px;
|
|
background: #0b0f14;
|
|
color: #e5e7eb;
|
|
font-family: Arial, -apple-system, sans-serif;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
.container { max-width: 960px; margin: auto; }
|
|
|
|
.card {
|
|
background: rgba(255,255,255,0.04);
|
|
border: 1px solid rgba(255,255,255,0.08);
|
|
border-radius: 14px;
|
|
padding: 18px;
|
|
margin-bottom: 14px;
|
|
}
|
|
|
|
.header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
.btn {
|
|
padding: 6px 10px;
|
|
font-size: 12px;
|
|
background: #22c55e;
|
|
border: none;
|
|
border-radius: 8px;
|
|
cursor: pointer;
|
|
color: #0b0f14;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.btn:hover { background: #16a34a; }
|
|
|
|
.content { margin-top: 12px; }
|
|
.content pre { background: #111827; padding: 12px; border-radius: 10px; overflow: auto; font-size: 14px; }
|
|
|
|
@media (max-width: 600px) {
|
|
body { padding: 16px 12px; }
|
|
.card { padding: 14px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="card header">
|
|
<div>📄 临时文本内容</div>
|
|
<button class="btn" onclick="copyText()">一键复制</button>
|
|
</div>
|
|
<div class="card content" id="md"></div>
|
|
</div>
|
|
|
|
<script>
|
|
const content = `{{ content|replace('\n','\\n')|safe }}`;
|
|
document.getElementById("md").innerHTML = marked.parse(content);
|
|
|
|
function copyText(){
|
|
navigator.clipboard.writeText(content)
|
|
.then(() => alert("复制成功"))
|
|
.catch(() => alert("复制失败"));
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |