linker/templates/link.html
2025-08-27 19:44:33 -05:00

96 lines
2.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Markdown Link Preview</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
font-family: sans-serif;
background-color: #1e1e2f;
color: #ddd;
padding: 2rem;
display: flex;
flex-direction: column;
align-items: center;
}
img {
max-width: 100%;
border-radius: 0.5rem;
margin-bottom: 1rem;
}
.card {
background-color: #2c2c3a;
border-radius: 1rem;
padding: 2rem;
max-width: 800px;
text-align: center;
}
button {
background-color: #4f46e5;
color: white;
border: none;
padding: 0.75rem 1.5rem;
font-size: 1rem;
border-radius: 0.5rem;
cursor: pointer;
margin-top: 1rem;
}
button:hover {
background-color: #4338ca;
}
textarea {
width: 100%;
height: 6rem;
margin-top: 1rem;
padding: 1rem;
font-family: monospace;
font-size: 0.9rem;
border-radius: 0.5rem;
border: none;
background-color: #1f1f2f;
color: #ccc;
}
footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #1e1e2f;
padding: 1rem;
text-align: center;
}
</style>
</head>
<body>
<div class="card">
<h2>Markdown Link Preview</h2>
<a href="{{ url }}" target="_blank">
<img src="{{ preview_image }}" alt="{{ title_author }}">
</a>
<p><strong>{{ title_author }}</strong></p>
<textarea id="markdown" readonly>{{ markdown_link }}</textarea>
<button onclick="copyMarkdown()">Click to Copy Markdown</button>
</div>
<script>
function copyMarkdown() {
const markdown = document.getElementById('markdown');
markdown.select();
markdown.setSelectionRange(0, 99999);
document.execCommand('copy');
alert('Markdown copied to clipboard!');
}
</script>
<footer>
<p>version: {{ version }}</p>
</footer>
</body>
</html>