~cytrogen/realm

97d34cd52dc2019141e4079a77462de660c6a0dc — Cytrogen a month ago c4c9992
添加博客迁移过渡页:/posts/* 跳转至 blog.cytrogen.icu
1 files changed, 90 insertions(+), 0 deletions(-)

A redirect.html
A redirect.html => redirect.html +90 -0
@@ 0,0 1,90 @@
<!DOCTYPE html>
<html lang="zh-Hans">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Blog Moved — cytrogen.icu</title>
	<meta name="robots" content="noindex">
	<link rel="stylesheet" href="realm.css">
	<style>
		.redirect-page {
			display: grid;
			place-items: center;
			min-height: 100dvh;
			padding: var(--space-lg);
		}

		.redirect-card {
			max-width: 32rem;
			text-align: center;
		}

		.redirect-card h1 {
			font-family: var(--font-mono);
			font-size: var(--text-lg);
			color: var(--accent);
			margin-bottom: var(--space-md);
		}

		.redirect-card p {
			font-family: var(--font-body);
			font-size: var(--text-base);
			color: var(--text-secondary);
			line-height: 1.6;
			margin-bottom: var(--space-md);
		}

		.redirect-card a {
			color: var(--accent);
			text-decoration: underline;
			text-underline-offset: 0.2em;
		}

		.redirect-card a:hover,
		.redirect-card a:focus-visible {
			color: var(--accent-bright);
		}

		.countdown {
			font-family: var(--font-mono);
			color: var(--text-dim);
			font-size: var(--text-sm);
		}
	</style>
</head>
<body>
	<main class="redirect-page">
		<div class="redirect-card">
			<h1>Blog Moved</h1>
			<p>
				博客已迁移至新域名<br>
				<a id="target-link" href="https://blog.cytrogen.icu">blog.cytrogen.icu</a>
			</p>
			<p class="countdown" id="countdown">3 秒后自动跳转…</p>
			<noscript>
				<p>请前往 <a href="https://blog.cytrogen.icu">blog.cytrogen.icu</a> 访问博客。</p>
			</noscript>
		</div>
	</main>
	<script>
		(function () {
			var path = location.pathname;
			var target = "https://blog.cytrogen.icu" + path;
			var link = document.getElementById("target-link");
			var countdown = document.getElementById("countdown");
			link.href = target;
			link.textContent = "blog.cytrogen.icu" + path;
			var seconds = 3;
			var timer = setInterval(function () {
				seconds--;
				if (seconds <= 0) {
					clearInterval(timer);
					location.replace(target);
				} else {
					countdown.textContent = seconds + " 秒后自动跳转…";
				}
			}, 1000);
		})();
	</script>
</body>
</html>