Files
blog/themes/Ying/layouts/_default/tiaozhuan.html
T

274 lines
8.8 KiB
HTML
Raw Normal View History

2024-08-03 16:55:54 +08:00
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, viewport-fit=cover">
<meta name="fragment" content="!">
2026-01-24 17:08:10 +08:00
<script>
(function() {
var theme = localStorage.getItem('theme');
if (!theme) {
if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) {
theme = 'dark';
} else {
theme = 'light';
}
}
document.documentElement.setAttribute('data-theme', theme);
})();
</script>
2024-08-03 17:15:02 +08:00
<title>即将离开{{ site.Title }}</title>
2024-08-03 16:55:54 +08:00
<style>
2026-01-24 17:08:10 +08:00
:root {
--bg-color: #f3f4f6;
--card-bg: #ffffff;
--text-primary: #111827;
--text-secondary: #4b5563;
--text-tertiary: #9ca3af;
--accent-color: #000000;
--accent-hover: #333333;
--accent-text: #ffffff;
--code-bg: #f9fafb;
--code-text: #6b7280;
--border-color: #e5e7eb;
--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
[data-theme="dark"] {
--bg-color: #0f172a;
--card-bg: #1e293b;
--text-primary: #f3f4f6;
--text-secondary: #9ca3af;
--text-tertiary: #6b7280;
--accent-color: #3b82f6;
--accent-hover: #2563eb;
--accent-text: #ffffff;
--code-bg: #020617;
--code-text: #94a3b8;
--border-color: #334155;
--shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
* {
box-sizing: border-box;
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
body {
background-color: var(--bg-color);
margin: 0;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
color: var(--text-primary);
transition: background-color 0.3s ease, color 0.3s ease;
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
.container {
2024-08-03 16:55:54 +08:00
width: 100%;
2026-01-24 17:08:10 +08:00
max-width: 480px;
padding: 20px;
}
.card {
background: var(--card-bg);
border-radius: 24px;
padding: 40px 32px;
box-shadow: var(--shadow);
text-align: center;
transition: background-color 0.3s ease, box-shadow 0.3s ease;
border: 1px solid var(--border-color);
}
.card-icon {
width: 80px;
height: 80px;
margin: 0 auto 24px;
display: flex;
align-items: center;
justify-content: center;
background-color: var(--code-bg);
border-radius: 50%;
overflow: hidden; /* 确保图片不溢出圆角 */
}
.card-icon img {
width: 100%; /* 宽度铺满 */
height: 100%; /* 高度铺满 */
object-fit: cover; /* 裁剪图片以填充容器,保持纵横比 */
}
.card-title {
font-size: 24px;
font-weight: 700;
margin: 0 0 12px;
color: var(--text-primary);
}
.card-desc {
font-size: 15px;
line-height: 1.6;
color: var(--text-secondary);
margin: 0 0 32px;
}
.link-preview {
background: var(--code-bg);
padding: 16px;
border-radius: 12px;
border: 1px solid var(--border-color);
margin-bottom: 32px;
text-align: left;
display: flex;
align-items: center;
gap: 12px;
transition: background-color 0.3s ease, border-color 0.3s ease;
}
.link-icon {
flex-shrink: 0;
color: var(--text-tertiary);
}
.link-url {
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
2024-08-03 16:55:54 +08:00
font-size: 13px;
2026-01-24 17:08:10 +08:00
color: var(--code-text);
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
.btn {
display: inline-flex;
justify-content: center;
align-items: center;
width: 100%;
padding: 14px 24px;
background-color: var(--accent-color);
color: var(--accent-text);
font-size: 16px;
font-weight: 600;
border: none;
border-radius: 12px;
cursor: pointer;
transition: background-color 0.2s ease, transform 0.1s ease;
text-decoration: none;
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
.btn:hover {
background-color: var(--accent-hover);
}
.btn:active {
transform: scale(0.98);
}
.footer {
margin-top: 40px;
font-size: 13px;
color: var(--text-tertiary);
text-align: center;
}
.footer a {
2024-08-03 16:55:54 +08:00
color: inherit;
2026-01-24 17:08:10 +08:00
text-decoration: none;
border-bottom: 1px dashed var(--text-tertiary);
padding-bottom: 2px;
transition: color 0.2s ease;
2024-08-03 16:55:54 +08:00
}
2026-01-24 17:08:10 +08:00
.footer a:hover {
color: var(--text-secondary);
border-bottom-style: solid;
}
/* Animation */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
.card {
animation: fadeIn 0.5s ease-out forwards;
2024-08-03 16:55:54 +08:00
}
</style>
</head>
2026-01-24 17:08:10 +08:00
<body>
<div class="container">
<div class="card">
<div class="card-icon">
<img src="{{ .Site.Params.author.avatar }}" alt="Icon">
2024-08-03 16:55:54 +08:00
</div>
2026-01-24 17:08:10 +08:00
<h1 class="card-title">即将离开{{ site.Title }}</h1>
<p class="card-desc">
您正在尝试访问一个外部链接。请注意,外部网站可能包含未知的安全风险,请确保您信任该站点。
</p>
<div class="link-preview" onclick="copyLink()" title="点击复制链接" style="cursor: pointer;">
<div class="link-icon">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"></path>
<path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"></path>
</svg>
</div>
<div id="target-url" class="link-url">正在解析目标地址...</div>
2024-08-03 16:55:54 +08:00
</div>
2026-01-24 17:08:10 +08:00
<a id="continue-btn" href="#" class="btn">继续访问</a>
<div class="footer">
<p>&copy; {{ now.Year }} {{ site.Title }} · <a href="https://beian.miit.gov.cn/" target="_blank">鄂ICP备2022015735号-1</a></p>
2024-08-03 16:55:54 +08:00
</div>
</div>
</div>
2026-01-24 17:08:10 +08:00
2024-08-03 16:55:54 +08:00
<script>
2026-01-24 17:08:10 +08:00
// 解析 URL 参数
2024-08-03 16:55:54 +08:00
const params = new URLSearchParams(window.location.search);
const encodedTarget = params.get('target');
2026-01-24 17:08:10 +08:00
let targetUrl = '';
2024-08-03 16:55:54 +08:00
2026-01-24 17:08:10 +08:00
try {
if (encodedTarget) {
targetUrl = atob(encodedTarget); // Base64 解码
}
} catch (e) {
console.error('解码失败', e);
}
const urlElement = document.getElementById('target-url');
const btnElement = document.getElementById('continue-btn');
if (targetUrl) {
urlElement.textContent = targetUrl;
btnElement.href = targetUrl;
2024-08-03 16:55:54 +08:00
} else {
2026-01-24 17:08:10 +08:00
urlElement.textContent = '无效的目标链接';
btnElement.classList.add('disabled');
btnElement.style.opacity = '0.5';
btnElement.style.pointerEvents = 'none';
btnElement.textContent = '无法继续';
}
// 复制链接功能
function copyLink() {
if (!targetUrl) return;
navigator.clipboard.writeText(targetUrl).then(() => {
const originalText = urlElement.textContent;
urlElement.textContent = '已复制到剪贴板';
setTimeout(() => {
urlElement.textContent = originalText;
}, 2000);
}).catch(err => {
console.error('复制失败', err);
});
2024-08-03 16:55:54 +08:00
}
</script>
</body>
2026-01-24 17:08:10 +08:00
</html>