master
lion 4 weeks ago
parent a2b2f162ed
commit a460db75a0

@ -1,10 +1,3 @@
@font-face {
font-family: "Event Heiti";
src: url("fonts/SourceHanSansSC-Regular-gb2312.woff2?v=20260828") format("woff2");
font-weight: 400 900;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Event Songti";
src: url("fonts/SourceHanSerifSC-Regular-gb2312.woff2?v=20260828") format("woff2");

@ -9,6 +9,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32.png?v=20260828">
<link rel="icon" type="image/png" sizes="192x192" href="assets/favicon-192.png?v=20260828">
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png?v=20260828">
<link rel="stylesheet" href="assets/event-site-songti.css?v=20260828">
<style>
@font-face {
font-family: "Event Heiti";
@ -6139,37 +6140,6 @@
}
}, 120);
});
(function () {
function assetBase() {
var node = document.querySelector("script[src*='prototype-scale']");
if (node && node.src) return node.src.replace(/prototype-scale\.js.*$/, "");
return "/frontend/assets/";
}
function hasLocalFont(names) {
var ctx = document.createElement("canvas").getContext("2d");
if (!ctx) return false;
var sample = "沪苏汉字國體";
ctx.font = "72px Courier New, monospace";
var fallback = ctx.measureText(sample).width;
for (var i = 0; i < names.length; i++) {
ctx.font = '72px "' + names[i] + '", Courier New, monospace';
if (Math.abs(ctx.measureText(sample).width - fallback) > 1) return true;
}
return false;
}
function loadWebfontsIfNeeded() {
var hasHeiti = hasLocalFont(["Heiti SC", "STHeiti", "PingFang SC", "黑体", "SimHei"]);
var hasSongti = hasLocalFont(["Songti SC", "STSong", "STSongti-SC-Bold", "宋体", "SimSun", "NSimSun"]);
if (hasHeiti && hasSongti) return;
var fonts = document.createElement("link");
fonts.rel = "stylesheet";
fonts.href = assetBase() + "event-site-fonts.css?v=20260828";
document.head.appendChild(fonts);
}
if (document.readyState === "complete") window.setTimeout(loadWebfontsIfNeeded, 60);
else window.addEventListener("load", function () { window.setTimeout(loadWebfontsIfNeeded, 60); });
}());
</script>
<script>

@ -9,6 +9,7 @@
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32.png?v=20260828">
<link rel="icon" type="image/png" sizes="192x192" href="assets/favicon-192.png?v=20260828">
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png?v=20260828">
<link rel="stylesheet" href="assets/event-site-songti.css?v=20260828">
<style>
@font-face {
font-family: "Event Heiti";
@ -5924,18 +5925,6 @@
if (node && node.src) return node.src.replace(/prototype-scale\.js.*$/, "");
return "/frontend/assets/";
}
function hasLocalFont(names) {
var ctx = document.createElement("canvas").getContext("2d");
if (!ctx) return false;
var sample = "沪苏汉字國體";
ctx.font = "72px Courier New, monospace";
var fallback = ctx.measureText(sample).width;
for (var i = 0; i < names.length; i++) {
ctx.font = '72px "' + names[i] + '", Courier New, monospace';
if (Math.abs(ctx.measureText(sample).width - fallback) > 1) return true;
}
return false;
}
function loadLate() {
if (done) return;
done = true;
@ -5953,15 +5942,6 @@
photo.src = base + "generated/hero-photonic-youth-blue-purple-balanced-v7-sharp-trails-4k.jpg?v=20260828c";
photonic.appendChild(photo);
}
var hasHeiti = hasLocalFont(["Heiti SC", "STHeiti", "PingFang SC", "PingFangSC-Regular", "黑体", "SimHei"]);
var hasSongti = hasLocalFont(["Songti SC", "STSongti-SC-Regular", "STSong", "STSongti-SC-Bold", "宋体", "SimSun", "NSimSun"]);
if (!hasHeiti || !hasSongti) {
var fonts = document.createElement("link");
fonts.rel = "stylesheet";
fonts.href = base + "event-site-fonts.css?v=20260828";
document.head.appendChild(fonts);
}
}
function startLate() { window.setTimeout(loadLate, 60); }
if (document.readyState === "complete") startLate();

Loading…
Cancel
Save